0.0.33 • Published 6 months ago

@types/svg-injector v0.0.33

Weekly downloads
621
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for SVG Injector
// Project: https://github.com/iconic/SVGInjector
// Definitions by: Patrick Westerhoff <https://github.com/poke>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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 | Array<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: Fri, 02 Jul 2021 22:33:11 GMT
  • Dependencies: none
  • Global values: SVGInjector

Credits

These definitions were written by Patrick Westerhoff.

0.0.30

8 months ago

0.0.31

7 months ago

0.0.32

6 months ago

0.0.33

6 months ago

0.0.29

3 years ago

0.0.28

4 years ago

0.0.27

8 years ago

0.0.26

8 years ago

0.0.25-alpha

8 years ago

0.0.24-alpha

8 years ago

0.0.23-alpha

8 years ago

0.0.22-alpha

8 years ago

0.0.21-alpha

8 years ago

0.0.20-alpha

8 years ago

0.0.19-alpha

8 years ago

0.0.14-alpha

8 years ago

0.0.13-alpha

8 years ago