Skip to content

TypeScript typesΒ #56

@drachehavoc

Description

@drachehavoc

I greatly appreciate this library, but I miss types for TypeScript, so I wrote a d.ts for my use, but I'd like to share it with you developers

Below is the d.ts I created:

html-parse-stringify.d.ts

type AstElement = {
    tag: 'tag' | 'text' | 'component'
    name: string
    attrs?: { [attributeName: string]: string }
    voidElement?: boolean
    children?: AstElement[]
}

declare type Htmlparsestringify = {
    parse(htmlString: string, options?: any): AstElement[]
    stringify(AST: AstElement[]): string
}

declare module "html-parse-stringify" {
    export default null as Htmlparsestringify
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions