1.1.0 • Published 3 months ago

@types/svg-injector v1.1.0

Weekly downloads
621
License
MIT
Repository
github
Last release
3 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.

1.1.0

3 months ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.29

3 years ago

0.0.28

5 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

9 years ago

0.0.19-alpha

9 years ago

0.0.14-alpha

9 years ago

0.0.13-alpha

9 years ago