@types/svg-injector
TypeScript icon, indicating that this package has built-in type declarations

0.0.33 • Public • Published

Installation

npm install --save @types/svg-injector

Summary

This package contains type definitions for svg-injector (https://github.com/iconic/SVGInjector).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/svg-injector.

index.d.ts

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?: string | 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 var SVGInjector: SVGInjector.SVGInjector;
export = SVGInjector;
export as namespace SVGInjector;

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: none

Credits

These definitions were written by Patrick Westerhoff.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/svg-injector

Weekly Downloads

459

Version

0.0.33

License

MIT

Unpacked Size

5.23 kB

Total Files

5

Last publish

Collaborators

  • types