state.d.ts 1.1 KB

12345678910111213141516171819202122
  1. import type { Fragment, Node, Schema } from '@milkdown/prose/model';
  2. import { Mark } from '@milkdown/prose/model';
  3. import type { JSONRecord, MarkdownNode, RemarkParser } from '../utility';
  4. import { Stack } from '../utility';
  5. import { SerializerStackElement } from './stack-element';
  6. import type { Serializer } from './types';
  7. export declare class SerializerState extends Stack<MarkdownNode, SerializerStackElement> {
  8. #private;
  9. readonly schema: Schema;
  10. static create: (schema: Schema, remark: RemarkParser) => Serializer;
  11. constructor(schema: Schema);
  12. openNode: (type: string, value?: string, props?: JSONRecord) => this;
  13. closeNode: () => this;
  14. addNode: (type: string, children?: MarkdownNode[], value?: string, props?: JSONRecord) => this;
  15. withMark: (mark: Mark, type: string, value?: string, props?: JSONRecord) => this;
  16. closeMark: (mark: Mark) => this;
  17. build: () => MarkdownNode;
  18. next: (nodes: Node | Fragment) => this;
  19. toString: (remark: RemarkParser) => string;
  20. run: (tree: Node) => this;
  21. }
  22. //# sourceMappingURL=state.d.ts.map