import * as t from 'io-ts'; import { RelationshipData } from './DocumentEditor/component-blocks/api'; import { Mark } from './DocumentEditor/utils'; export type TextWithMarks = { type?: never; text: string; } & { [Key in Mark | 'insertMenu']: true | undefined; }; export type InlineFromValidation = TextWithMarks | Link | Relationship; type Link = { type: 'link'; href: string; children: Children; }; type Relationship = { type: 'relationship'; relationship: string; data: RelationshipData | null; children: Children; }; type Children = (BlockFromValidation | InlineFromValidation)[]; type Layout = { type: 'layout'; layout: number[]; children: Children; }; type OnlyChildrenElements = { type: 'blockquote' | 'layout-area' | 'divider' | 'list-item' | 'list-item-content' | 'ordered-list' | 'unordered-list'; children: Children; }; type CodeBlock = { type: 'code'; language: string | undefined; children: Children; }; type Heading = { type: 'heading'; level: 1 | 2 | 3 | 4 | 5 | 6; textAlign: 'center' | 'end' | undefined; children: Children; }; type Paragraph = { type: 'paragraph'; textAlign: 'center' | 'end' | undefined; children: Children; }; type ComponentBlock = { type: 'component-block'; component: string; props: Record; children: Children; }; type ComponentProp = { type: 'component-inline-prop' | 'component-block-prop'; propPath: (string | number)[] | undefined; children: Children; }; export type BlockFromValidation = Layout | OnlyChildrenElements | Heading | ComponentBlock | ComponentProp | Paragraph | CodeBlock; export type ElementFromValidation = BlockFromValidation | InlineFromValidation; export declare const editorCodec: t.ArrayC>; export declare function isRelationshipData(val: unknown): val is RelationshipData; export declare function validateDocumentStructure(val: unknown): asserts val is ElementFromValidation[]; export {};