gitfoss-fork | 3ab29be17f5f1f9a1fead0ec8625f7bd3b1fa5be | types/himalaya.d.ts ∙ GitFOSS
.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;