UNPKG

@types/svg-parser

Version:
44 lines (33 loc) 1.26 kB
# 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).