UNPKG

@awesome-fe/translate

Version:
27 lines (26 loc) 1.41 kB
import { Node, Parent } from 'unist'; import { Heading, Link, LinkReference, ListItem, Literal, Paragraph, Table, TableCell, TableRow, YAML } from 'mdast'; import { VFileCompatible } from 'unified'; import { Visitor } from '../../visitor/visitor'; export declare namespace markdown { function isLiteral(node: Node): node is Literal; function isParent(node: Node): node is Parent; function isTranslatableUnit(node: Node): node is Paragraph | Heading; function isLinkReference(node: Node): node is LinkReference; function isLink(node: Node): node is Link; function isTableRow(node: Node): node is TableRow; function isTableCell(node: Node): node is TableCell; function isTable(node: Node): node is Table; function isTableFamily(node: Node): node is Table | TableRow | TableCell; function isYaml(node: Node): node is YAML; function isListItem(node: Parent): node is ListItem; function parse(markdown: VFileCompatible): Parent; function stringify(tree: Node): string; function toHtml(textOrAst: Node | string): string; function fromHtml(html: string): Node; function mdToHtml(md: string): string; function mdFromHtml(html: string): string; function normalize(text: string): string; function nodeContainsChinese(node: Node): boolean; function visit(node: Node, parent: Parent | undefined, visitor: Visitor<Node>): Promise<Node>; }