import { Block as FieldBlock, Blockquote as FieldBlockquote, BlockquoteType, BlockType, Code as FieldCode, CodeType, DefaultMark, Heading as FieldHeading, HeadingType, InlineItem as FieldInlineItem, InlineItemType, InlineBlock as FieldInlineBlock, InlineBlockType, ItemLink as FieldItemLink, ItemLinkType, Link as FieldLink, LinkType, List as FieldList, ListItem as FieldListItem, ListItemType, ListType, Paragraph as FieldParagraph, ParagraphType, Root, Span, ThematicBreak as FieldThematicBreak, ThematicBreakType } from 'datocms-structured-text-utils'; import { BaseEditor, BaseRange } from 'slate'; import { ReactEditor } from 'slate-react'; type TextMarks = { [key in `customMark_${string}` | DefaultMark]?: boolean; }; export type Text = { text: string; emoji?: string; codeToken?: string; } & TextMarks; export type Block = { type: BlockType; blockModelId: string; id?: string; key?: string; children: [{ text: ''; }]; [fieldApiKey: string]: unknown; }; export type InlineBlock = { type: InlineBlockType; blockModelId: string; id?: string; key?: string; children: [{ text: ''; }]; [fieldApiKey: string]: unknown; }; type ChildType; }> = T['children'] extends (infer U)[] ? U : never; export type Heading = Omit & { children: Array>>; }; export type Paragraph = Omit & { children: Array>>; }; export type Link = Omit & { children: Array>>; }; export type ItemLink = Omit & { itemTypeId: string; children: Array>>; }; export type InlineItem = FieldInlineItem & { itemTypeId: string; children: [{ text: ''; }]; }; export type ThematicBreak = FieldThematicBreak & { children: [{ text: ''; }]; }; export type Code = Omit & { highlight?: number[]; children: [{ text: string; }]; }; export type Blockquote = Omit & { author?: string; children: Array> | BlockquoteSource>; }; export type BlockquoteSource = { type: 'blockquoteSource'; children: [{ text: string; }]; }; export type ListItem = Omit & { children: Array>>; }; export type List = Omit & { children: Array>>; }; export type TopLevelElement = ReplaceSlateWithFieldTypes>; type ReplaceType = T extends O ? Exclude | N : T; type ReplaceSlateWithFieldTypes = ReplaceType, FieldHeading, Heading>, FieldParagraph, Paragraph>, FieldLink, Link>, FieldInlineItem, InlineItem>, FieldItemLink, ItemLink>, FieldBlockquote, Blockquote>, FieldList, List>, FieldListItem, ListItem>, FieldCode, Code>, Span, Text>, FieldBlock, Block>, FieldInlineBlock, InlineBlock>; export type Definition = { type: NodeType; accepts: Array; }; export declare const paragraphDef: Definition; export declare const headingDef: Definition; export declare const thematicBreakDef: Definition; export declare const linkDef: Definition; export declare const itemLinkDef: Definition; export declare const inlineItemDef: Definition; export declare const blockDef: Definition; export declare const inlineBlockDef: Definition; export declare const listDef: Definition; export declare const listItemDef: Definition; export declare const blockquoteDef: Definition; export declare const blockquoteSourceDef: Definition; export declare const codeDef: Definition; type BlockquoteSourceType = 'blockquoteSource'; export declare const topLevelElements: readonly [Definition, Definition, Definition, Definition, Definition, Definition, Definition]; export type NonTextNode = Paragraph | Heading | Link | ItemLink | InlineItem | Block | InlineBlock | List | ListItem | Blockquote | BlockquoteSource | Code | ThematicBreak; export type NodeType = ParagraphType | HeadingType | LinkType | ItemLinkType | InlineItemType | BlockType | InlineBlockType | ListType | ListItemType | BlockquoteType | BlockquoteSourceType | CodeType | ThematicBreakType; export type InlineNode = Link | ItemLink | InlineItem | InlineBlock; export declare const inlineNodes: Definition[]; export type VoidNode = Block | InlineBlock | InlineItem | ThematicBreak; export declare const voidNodes: Definition[]; export type Node = NonTextNode | Text; export type BlockNodeWithCustomStyle = Paragraph | Heading; declare module 'slate' { interface CustomTypes { Editor: BaseEditor & ReactEditor; Element: NonTextNode; Text: Text; Range: BaseRange & { emoji?: string; codeToken?: string; }; } } export declare const nonTextNodeDefs: Record; export declare const allNodeTypes: NodeType[]; export {};