import type { SerializedEditorState, SerializedLexicalNode } from 'lexical';
/**
 * A base64 encoded string representing a complete Yjs document state.
 * This is created using `Y.encodeStateAsUpdate()` and is used for
 * persistence and versioning.
 */
type YjsSnapshot = string;
export interface ScriptDomainRecords {
    ":script": ScriptRecord;
    ":script?": ScriptEditorStateRecord;
    ":script.revisions?": ScriptRevisionsRecord;
    ":script.revision": ScriptRevisionRecord;
    ":script.revision?": ScriptEditorStateRevisionRecord;
    ":script.content?": ScriptContentRecord;
    ":script.text?": ScriptTextRecord;
    ":script.children": ScriptChildrenRecord;
}
export interface ScriptRecord {
    value: YjsSnapshot;
    refs?: {
        mixin: string;
        asset?: string;
    }[];
}
export interface ScriptEditorStateRecord {
    value: SerializedEditorState;
}
interface ScriptRevision {
    id: string;
    userId: string;
}
export interface ScriptRevisionsRecord {
    value: ScriptRevision[];
}
export interface ScriptRevisionRecord {
    $parent: string;
    scriptId: string;
    userId: string;
    value: YjsSnapshot;
}
export interface ScriptEditorStateRevisionRecord {
    $parent: string;
    scriptId: string;
    userId: string;
    value: SerializedEditorState;
}
export interface EventNodeContent {
    type: "event";
    id: string;
    mixin: string;
    children?: EventNodeContent[];
}
export interface FormattedTextNodeContent {
    type: "text";
    text: string;
    style?: string;
    format?: number;
}
export interface LinkNodeContent {
    type: "link" | "autolink";
    children: FormattedTextNodeContent[];
}
export type TextNodeContent = FormattedTextNodeContent | LinkNodeContent;
export interface ElementNodeContent {
    type: SerializedLexicalNode["type"];
    children: TextNodeContent[];
}
export interface ListItemNodeContent {
    type: "listitem";
    value: number;
    checked?: boolean;
    children: TextNodeContent[];
}
export interface ListNodeContent {
    type: "list";
    listType: "bullet" | "number" | "check";
    tag: "ul" | "ol";
    children: ListItemNodeContent[];
}
export interface ParagraphNodeContent extends ElementNodeContent {
    type: "paragraph";
}
export interface CommentNodeContent extends ElementNodeContent {
    type: "comment";
}
export interface HeadingNodeContent extends ElementNodeContent {
    type: "heading";
    tag: "h1" | "h2" | "h3";
}
export interface QuoteNodeContent extends ElementNodeContent {
    type: "quote";
}
export interface HorizontalRuleContent {
    type: "horizontalrule";
}
export type NodeContent = EventNodeContent | TextNodeContent | ParagraphNodeContent | CommentNodeContent | ListNodeContent | ListItemNodeContent | HeadingNodeContent | HorizontalRuleContent | QuoteNodeContent;
export interface ScriptContentRecord {
    nodes: NodeContent[];
}
export interface ScriptTextRecord {
    content: string;
    graphics: string;
}
/**
 * A record for non-script automation assets that can have child events.
 */
export interface ScriptChildrenRecord {
    value?: string[];
}
export {};
