Files
CatoandClaude Sonnet 5.5 99fe5ae1c0 feat(react): ArticleComposer — the shared place to write (#1)
* feat(react): ArticleComposer — the shared place to write; assist, drafts and text-edit move into the core

Owner, 2026-11-06: the experience belongs to the package. The composer built in
BiasLens (title, text, Speak/Photo/Chart, preview, drafts, publish bar) becomes
@bitbaum/writingkit/react on chatkit's DictationField, so every product gets a
microphone and writing help in the title and the text without building them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvpWNTLxXNfwUHS7MD

* build: rebuild dist against published chatkit 0.23.0; lockfile

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvpWNTLxXNfwUHS7MD

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-06 09:29:50 +01:00

23 lines
1.0 KiB
TypeScript

/**
* A draft lives on the device until it is published, and signing in never
* loses it: what was typed under the anonymous key moves to the account's.
* Storage is passed in, so a test (or a server render) needs no browser.
*/
export interface DraftStorage {
getItem(key: string): string | null;
setItem(key: string, value: string): void;
removeItem(key: string): void;
}
export interface StoredDraft {
title: string;
body: string;
savedAt: string;
/** Anything the app wants kept with it (the headline being answered). */
extra?: unknown;
}
export declare function readDraft(storage: DraftStorage, key: string): StoredDraft | null;
/** False when storage is full or blocked: the text is still on screen. */
export declare function writeDraft(storage: DraftStorage, key: string, draft: StoredDraft): boolean;
/** The draft to offer: this key's, or else the anonymous one, moved to this key. */
export declare function restoreDraft(storage: DraftStorage, key: string, anonymousKey?: string): StoredDraft | null;