export interface NodeAttributes { [attribute: string]: string; } export type NodeContent = Array; // T - Tag name // A - Attributes export interface Node { tag?: T; attrs?: A; content?: NodeContent; } type Matcher = string | RegExp | object; type Expression = Matcher | Matcher[]; type CallbackNode = (node: Node) => Node | Node[]; export interface PostHTMLTree { walk: (cb: CallbackNode) => PostHTMLTree; match: (expression: Expression, cb: CallbackNode) => CallbackNode; } export interface PostHTMLOptions { sync?: boolean; parser?: Function; render?: Function; skipParse?: boolean; } type Plugin = (tree: PostHTMLTree) => void | PostHTMLTree | ThisType; interface Result { html: string; tree: PostHTMLTree; messages: M[]; } declare class PostHTML { version: string; name: 'posthtml'; plugins: Plugin[]; messages: M[]; use(plugins: Plugin | Plugin[]): this; process(html: string, options?: PostHTMLOptions): Promise>; } declare function posthtml(plugins?: Plugin[]): PostHTML; export default posthtml;