import { ReactNode } from 'react'; import { Editor, Node, Element, Descendant } from 'slate'; import { ReactEditor } from 'slate-react'; import { EditableProps } from 'slate-react/dist/components/editable'; import { DocumentFeatures } from './document-features'; import { ComponentBlock } from './component-blocks/api'; import { Relationships } from './relationship'; export { Editor } from 'slate'; export declare function createDocumentEditor(documentFeatures: DocumentFeatures, componentBlocks: Record, relationships: Relationships): { type?: undefined; } & import("slate").BaseEditor & ReactEditor & import("slate-history").HistoryEditor; export declare function DocumentEditor({ onChange, value, componentBlocks, relationships, documentFeatures, ...props }: { onChange: undefined | ((value: Descendant[]) => void); value: Descendant[]; componentBlocks: Record; relationships: Relationships; documentFeatures: DocumentFeatures; } & Omit): JSX.Element; export declare function useIsInDocumentEditor(): boolean; export declare function DocumentEditorProvider({ children, editor, onChange, value, componentBlocks, documentFeatures, relationships, }: { children: ReactNode; value: Descendant[]; onChange: (value: Descendant[]) => void; editor: Editor; componentBlocks: Record; relationships: Relationships; documentFeatures: DocumentFeatures; }): JSX.Element; export declare function DocumentEditorEditable(props: EditableProps): JSX.Element; export type Block = Exclude; type BlockContainerSchema = { kind: 'blocks'; allowedChildren: ReadonlySet; blockToWrapInlinesIn: TypesWhichHaveNoExtraRequiredProps; invalidPositionHandleMode: 'unwrap' | 'move'; }; type InlineContainerSchema = { kind: 'inlines'; invalidPositionHandleMode: 'unwrap' | 'move'; }; type TypesWhichHaveNoExtraRequiredProps = { [Type in Block['type']]: { type: Type; children: Descendant[]; } extends Block & { type: Type; } ? Type : never; }[Block['type']]; type EditorSchema = typeof editorSchema; export declare const editorSchema: { editor: BlockContainerSchema; layout: BlockContainerSchema; 'layout-area': BlockContainerSchema; blockquote: BlockContainerSchema; paragraph: InlineContainerSchema; code: InlineContainerSchema; divider: InlineContainerSchema; heading: InlineContainerSchema; 'component-block': BlockContainerSchema; 'component-inline-prop': InlineContainerSchema; 'component-block-prop': BlockContainerSchema; 'ordered-list': BlockContainerSchema; 'unordered-list': BlockContainerSchema; 'list-item': BlockContainerSchema; 'list-item-content': InlineContainerSchema; }; type InlineContainingType = { [Key in keyof EditorSchema]: { inlines: Key; blocks: never; }[EditorSchema[Key]['kind']]; }[keyof EditorSchema]; export declare function isInlineContainer(node: Node): node is Block & { type: InlineContainingType; }; export declare function isBlock(node: Descendant): node is Block;