.ts
TypeScript
(application/typescript)
declare module "himalaya";

export interface TextNode {
  type: "text";
  content: string;
}

export interface RealNode {
  type: "element";
  tagName: keyof HTMLElementTagNameMap;
  attributes: Array<{
    key: string;
    value: string;
  }>;
  children: Array<RealNode | TextNode>;
}

export declare type ParseResult = (TextNode | RealNode)[];

export declare function parse<T = ParseResult>(html: string): T;

export default parse;