npm install --save @types/svg-injector
This package contains type definitions for svg-injector (https://github.com/iconic/SVGInjector).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/svg-injector.
declare namespace SVGInjector {
interface SVGInjector {
/**
* Replace the given elements with their full inline SVG DOM elements.
*
* @param elements Array of or single DOM element.
* @param options Injector options.
* @param done Callback that receives the injected element count as parameter.
*/
(
elements: Node | NodeList | Node[],
options?: SVGInjectorOptions,
done?: (elementCount: number) => void,
): void;
}
interface SVGInjectorOptions {
/**
* Whether to run scripts blocks found in the SVG.
*
* Possible values:
* 'always' — Run scripts every time.
* 'once' — Only run scripts once for each SVG.
* 'never' — Ignore scripts (default)
*/
evalScripts?: "always" | "once" | "never" | undefined;
/**
* Location of fallback pngs, if desired.
*/
pngFallback?: string | undefined;
/**
* Callback to run during each SVG injection. The SVG element is passed if
* the injection was successful.
*/
each?: ((svg: SVGElement | string) => void) | undefined;
}
}
declare const SVGInjector: SVGInjector.SVGInjector;
export = SVGInjector;
export as namespace SVGInjector;
- Last updated: Sat, 28 Sep 2024 17:07:16 GMT
- Dependencies: none
These definitions were written by Patrick Westerhoff.