/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * A further change to a record a builder edits, as a draft * (east-workspace#1624, rule 10): what a builder hands a function beside its * sessions' pending Save for a question about its drafts as they would be — a * derived plan's change, laid after the Save and committed nowhere. It is a * draft of the record's patch door, the mutation the builder's session saves * through (`SCHEDULE_PATCH_DOOR`), its patch the entries' own: an insert, a * delete carrying what the entry was, or an update, the entry's patch from * what it was — the operations a Save's patch holds, so the record checks the * change as it checks a Save. * * @packageDocumentation */ import { type EastType } from "@elaraai/east"; import type { FuncCallDraft } from "./use-func-call.js"; /** One entry's change: what it was under the drafts, and what the derived plan makes it; `undefined` where it is absent. */ export interface EntryChange { /** The entry's key, at the record's key type. */ readonly key: unknown; /** The entry's row under the drafts. */ readonly before: unknown; /** Its row in the derived plan. */ readonly after: unknown; } /** * Makes drafts of a record's patch door from its entries' changes. * * @param record - The record's name in the deployed package * @param keyType - The record's key type * @param rowType - Its row type * @returns From the changes, the draft; `undefined` where they change no entry */ export declare function recordPatchDrafts(record: string, keyType: EastType, rowType: EastType): (changes: readonly EntryChange[]) => FuncCallDraft | undefined; //# sourceMappingURL=patch-draft.d.ts.map