Something went wrong. Try again.
A local-first note taking app
Something went wrong. Try again.
TypeScript
123456789101112131415161718192021222324252627282930/** * Editor layer types. Sync-backend-specific payloads live beside each editor * under `editors/<kind>/`; only that editor reads `EditorBinding.payload`. */import type { ComponentType } from 'react';
/** Sync/editor backend id. */export type EditorKind = 'automerge';
export type EditorBinding = { kind: EditorKind; payload: unknown;};
/** Props passed from workspaces into every registered editor component. */export type EditorProps = { binding: EditorBinding; className?: string; placeholder?: string;};
/** * A registered editor: UI for one sync method, keyed by `kind`. * Implementations live under `editors/<kind>/` and are listed in `registry.ts`. */export type Editor = { readonly kind: EditorKind; readonly Component: ComponentType<EditorProps>;};