Files
bitbaum-fleet b167b55c1c @bitbaum/writingkit 0.1.0: its own repo
Moved from bitbaum/orangecat packages/writingkit at 0e410b309710e7c558ada4c5903b3b5bb10e24a4; the history before this commit is there. Created by bitbaum/fleet scripts/packages/create-package-repos.mjs from registers/package-repos.json.
2026-11-05 09:54:55 +00:00

25 lines
804 B
TypeScript

import { WritingSession, type WritingOutcome } from '@bitbaum/writingkit';
/** Compile the installed public surface as an adapter would use it. */
export async function publicContract(): Promise<WritingOutcome> {
const session = new WritingSession({ documentId: 'owned-draft', revision: 'etag-1' });
const result = await session.run(
async ({ signal, base }) => {
signal.throwIfAborted();
// @ts-expect-error A captured revision is immutable.
base.revision = 'changed';
return { text: 'Proposed text' };
},
proposal => {
const text: string = proposal.text;
void text;
}
);
void session.run(
async () => 'draft',
// @ts-expect-error Async application leaves an await after the revision check.
async () => {}
);
return result;
}