Skip to main content

EditorApi

interface
interface EditorApi

Import

import { EditorApi } from '@modular/sdk';

Members4

activeDocumentTarget
() => Promise<EditorOperationError | { kind: 'active-document'; selection: { kind: 'document-start' } | { kind: 'document-end' } | { blockId: string & $brand<'EditorDocumentBlockId'>; kind: 'after-block' }; target: { documentId: string & $brand<'EditorDocumentId'>; kind: 'document' } }>
document
(documentId: string) => EditorOperationError | { documentId: string & $brand<'EditorDocumentId'>; kind: 'document' }
insertNodeAtActiveSelection
(input: { props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>; type: string }) => Promise<EditorOperationError | { kind: 'inserted' }>
streamText
(input: EditorTextStreamInput) => EditorTextStream