JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 27266
  • Score
    100M100P100Q139212F
  • License MIT

TypeScript definitions for svg-parser

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@types/svg-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    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

    // Type definitions for svg-parser 2.0
    // Project: https://github.com/Rich-Harris/svg-parser
    // Definitions by: mrmlnc <https://github.com/mrmlnc>
    //                 Joel Shinness <https://github.com/JoelCodes>
    //                 Piotr Błażejewicz <https://github.com/peterblazejewicz>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    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: Mon, 25 Sep 2023 13:39:06 GMT
    • Dependencies: none
    • Global values: svgParser

    Credits

    These definitions were written by mrmlnc, Joel Shinness, and Piotr Błażejewicz.