UNPKG

hackmd-to-html-cli

Version:

A node.js CLI tool for converting HackMD markdown to HTML.

70 lines 2.08 kB
import { Token } from "markdown-it"; export declare class MyToken implements Token { /** * Type of the token (string, e.g. "paragraph_open") */ type: string; /** * html tag name, e.g. "p" */ tag: string; /** * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]` */ attrs: Array<[string, string]> | null; /** * Source map info. Format: `[ line_begin, line_end ]` */ map: [number, number] | null; /** * Level change (number in {-1, 0, 1} set), where: * - `1` means the tag is opening * - `0` means the tag is self-closing * - `-1` means the tag is closing */ nesting: 1 | 0 | -1; /** * Nesting level, the same as `state.level` */ level: number; /** * An array of child nodes (inline and img tokens) */ children: Token[] | null; /** * In a case of self-closing tag (code, html, fence, etc.), * it has contents of this tag. */ content: string; /** * '*' or '_' for emphasis, fence string for fence, etc. */ markup: string; /** * Additional information: * - Info string for "fence" tokens * - The value "auto" for autolink "link_open" and "link_close" tokens * - The string value of the item marker for ordered-list "list_item_open" tokens */ info: string; /** * A place for plugins to store arbitrary data */ meta: object | null; /** * True for block-level tokens, false for inline tokens. * Used in renderer to calculate line breaks. */ block: boolean; /** * If true, ignore this element when rendering. Used for tight lists to hide paragraphs. */ hidden: boolean; constructor(type: string, tag: string, nesting: 0 | 1 | -1); attrIndex(name: string): number; attrPush(attrData: [string, string]): void; attrSet(name: string, value: string): void; attrGet(name: string): string | null; attrJoin(name: string, value: string): void; } //# sourceMappingURL=token.d.ts.map