state.d.ts 1.1 KB

1234567891011121314151617181920212223
  1. import type { Attrs, MarkType, Node, NodeType, Schema } from '@milkdown/prose/model';
  2. import type { MarkdownNode, RemarkParser } from '../utility';
  3. import { Stack } from '../utility';
  4. import { ParserStackElement } from './stack-element';
  5. import type { Parser } from './types';
  6. export declare class ParserState extends Stack<Node, ParserStackElement> {
  7. #private;
  8. readonly schema: Schema;
  9. static create: (schema: Schema, remark: RemarkParser) => Parser;
  10. protected constructor(schema: Schema);
  11. injectRoot: (node: MarkdownNode, nodeType: NodeType, attrs?: Attrs) => this;
  12. openNode: (nodeType: NodeType, attrs?: Attrs) => this;
  13. closeNode: () => this;
  14. addNode: (nodeType: NodeType, attrs?: Attrs, content?: Node[]) => this;
  15. openMark: (markType: MarkType, attrs?: Attrs) => this;
  16. closeMark: (markType: MarkType) => this;
  17. addText: (text: string) => this;
  18. build: () => Node;
  19. next: (nodes?: MarkdownNode | MarkdownNode[]) => this;
  20. toDoc: () => Node;
  21. run: (remark: RemarkParser, markdown: string) => this;
  22. }
  23. //# sourceMappingURL=state.d.ts.map