# @types/svg-injector

> TypeScript definitions for svg-injector

Latest version **1.1.0** (published 2024-09-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/svg-injector
pnpm add @types/svg-injector
yarn add @types/svg-injector
bun add @types/svg-injector
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2024-09-28 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51442 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/svg-injector
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/svg-injector
- npm.io page: https://npm.io/package/@types/svg-injector

## Recent versions

- 1.1.0 (latest) — 2024-09-28
- 0.0.33 (ts4.5) — 2023-11-21
- 0.0.29 (ts3.6) — 2021-07-02
- 0.0.28 (ts3.1) — 2020-05-15
- 0.0.27 (ts2.0) — 2016-09-19
- 0.0.32 — 2023-11-07
- 0.0.31 — 2023-10-18
- 0.0.30 — 2023-09-25
- 0.0.26 — 2016-07-14
- 0.0.25-alpha — 2016-07-08
- 0.0.24-alpha — 2016-07-04
- 0.0.23-alpha — 2016-07-02
- 0.0.22-alpha — 2016-07-02
- 0.0.21-alpha — 2016-07-01
- 0.0.20-alpha — 2016-05-25
- … 3 more at https://npm.io/package/@types/svg-injector/versions

## README

# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/svg-injector/index.d.ts)
````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?: "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;

````

### Additional Details
 * Last updated: Sat, 28 Sep 2024 17:07:16 GMT
 * Dependencies: none

# Credits
These definitions were written by [Patrick Westerhoff](https://github.com/poke).

---
_Source: https://npm.io/package/@types/svg-injector · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
