/
Dante
/
node-core
Обзор
Документация
Войти
/
Dante
/
node-core
Код
Запросы
0
Задачи
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
node_modules/node-html-markdown/dist/visitor.d.ts
51 строка
2 KB
Александр Данилюк
add
24 сен 2024, 12:59
24 сен 2024, 12:59
9eaeea8
Код
Авторство
О чём код?
import { NodeHtmlMarkdown } from './main'; import { ElementNode, HtmlNode } from './nodes'; import { TranslatorConfigObject } from './translator'; export interface NodeMetadata { indentLevel?: number; listKind?: 'OL' | 'UL'; listItemNumber?: number; noEscape?: boolean; preserveWhitespace?: boolean; translators?: TranslatorConfigObject; tableMeta?: { node: ElementNode; caption?: string; }; } export declare type NodeMetadataMap = Map<ElementNode, NodeMetadata>; declare type VisitorResult = { text: string; trailingNewlineStats: { whitespace: number; newLines: number; }; }; /** * Properties & methods marked public are designated as such due to the fact that we may add middleware / transformer * support in the future */ export declare class Visitor { instance: NodeHtmlMarkdown; rootNode: HtmlNode; fileName?: string | undefined; result: VisitorResult; nodeMetadata: NodeMetadataMap; urlDefinitions: string[]; private options; constructor(instance: NodeHtmlMarkdown, rootNode: HtmlNode, fileName?: string | undefined); addOrGetUrlDefinition(url: string): number; appendResult(s: string, startPos?: number, spaceIfRepeatingChar?: boolean): void; appendNewlines(count: number): void; /** * Optimize tree, flagging nodes that have usable content */ private optimizeTree; /** * Apply escaping and custom replacement rules */ private processText; visitNode(node: HtmlNode, textOnly?: boolean, metadata?: NodeMetadata): void; } export declare function getMarkdownForHtmlNodes(instance: NodeHtmlMarkdown, rootNode: HtmlNode, fileName?: string): string; export {};