import { Document, EdgeBehaviour, JSONObject, Annotation } from "./internals"; type Range = `${"[" | "("}${number}..${number}${"]" | ")"}`; export type Mark = { id: string; type: string; range: Range; attributes: T extends Annotation ? Attributes : JSONObject; }; export type Block = { id: string; type: string; range?: Range; parents: string[]; selfClosing?: boolean; attributes: T extends Annotation ? Attributes : JSONObject; }; export declare enum TokenType { BLOCK_START = 0, BLOCK_END = 1, MARK_START = 2, MARK_END = 3, PARSE_START = 4, PARSE_END = 5, MARK_COLLAPSED = 6 } export type Token = { type: TokenType; index: number; annotation: Annotation; shared: { start: number; }; selfClosing: boolean; edgeBehaviour: { leading: EdgeBehaviour; trailing: EdgeBehaviour; }; }; export type SortableToken = { index: number; type: TokenType; annotation: { id: string; type: string; start: number; end: number; rank: number; }; }; export declare function sortTokens(lhs: SortableToken, rhs: SortableToken): number; export declare function serialize(doc: Document, options?: { withStableIds?: boolean; includeBlockRanges?: boolean; onUnknown?: "warn" | "throw" | "ignore"; includeParseTokens?: boolean; }): { text: string; blocks: Block[]; marks: Mark[]; }; export declare function deserialize(json: { text: string; blocks?: Block[]; marks?: Mark[]; }, DocumentClass: typeof Document): Document; export {}; //# sourceMappingURL=serialize.d.ts.map