Skip to content

Commit

Permalink
Wrote TypeScript definitions for html-parse-stringify (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelMarks authored and frontmesh committed Oct 1, 2018
1 parent f683874 commit b55a8d9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions html-parse-stringify.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
declare var htmlParseStringify: htmlParseStringify.htmlParseStringify;

declare module htmlParseStringify {
export interface htmlParseStringify {
new (): htmlParseStringify;
parse_tag(tag: string): IDoc;
parse(html: string, options: IOptions): Array<any>;
stringify(doc: IDoc): string;
}

export interface IDoc {
type: string;
content?: string;
voidElement: boolean;
name: string;
attrs: {};
children: IDoc[];
}

export interface IOptions {
components: string[];
}
}

declare module "html-parse-stringify" {
export = htmlParseStringify;
}

0 comments on commit b55a8d9

Please sign in to comment.