# @types/svg-parser

> TypeScript definitions for svg-parser

Latest version **2.0.6** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2.0.6 |
| Published | 2023-11-07 |
| First published | 2017-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51441 |
| Maintainers | types |

## Links

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

## Recent versions

- 2.0.6 (latest) — 2023-11-07
- 2.0.3 (ts3.6) — 2021-07-02
- 2.0.2 (ts3.5) — 2021-05-04
- 2.0.1 (ts2.1) — 2019-10-03
- 2.0.5 — 2023-10-18
- 2.0.4 — 2023-09-25
- 2.0.0 — 2019-09-25
- 1.0.0 — 2017-11-12

## README

# Installation
> `npm install --save @types/svg-parser`

# Summary
This package contains type definitions for svg-parser (https://github.com/Rich-Harris/svg-parser).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/svg-parser.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/svg-parser/index.d.ts)
````ts
export interface TextNode {
    type: "text";
    value?: string | boolean | number | undefined;
}

export interface ElementNode {
    type: "element";
    tagName?: string | undefined;
    properties?: Record<string, string | number> | undefined;
    children: Array<Node | string>;
    value?: string | undefined;
    metadata?: string | undefined;
}

export type Node = TextNode | ElementNode;

export interface RootNode {
    type: "root";
    children: [Node];
}

export function parse(source: string): RootNode;

export as namespace svgParser;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [mrmlnc](https://github.com/mrmlnc), [Joel Shinness](https://github.com/JoelCodes), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).

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