Something went wrong. Try again.
A local-first note taking app
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334/** * Document lifecycle API — open, title, release, and editor bindings. * Rendering and sync-backend UI live under `src/editors/`. */import type { EditorBinding } from '../editors/types';
export interface DocumentProvider { /** Same id as the paired FileSystemProvider (e.g. `habitat-docs`). */ readonly id: string; openDocument(entryId: string): Promise<DocumentHandle>; /** Create a new in-memory document with no backing store yet. */ createDocument(options?: { id?: string }): Promise<DocumentHandle>;}
export type DocumentHandle = { /** Stable document id (uri, path, etc.). */ id: string; /** * Resolves when the initial load completes; rejects on transport errors. * The editor may mount before this resolves; use for error UI only. */ loadPromise: Promise<void>; getTitle(): string; /** Called when the title may have changed. */ subscribeTitle(listener: () => void): () => void; /** Release resources. Idempotent. */ release(): void; /** * Opaque editing surface for the editor layer. DocumentProviders supply * document state and sync; they do not render UI. */ getEditorBinding(): EditorBinding;};