/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type EditSession, type EditingWords } from "@elaraai/east-ui-components"; import type { ScheduleEditing } from "../schedule/editing.js"; import type { OptimiseSessions } from "./use-optimise.js"; /** One of a builder's sessions, and the record it edits. */ export interface OptimiseSession { /** The record's name in the deployed package: what the function lists in `drafts`. */ readonly record: string; /** The session over it. */ readonly session: Pick, "toDraft" | "carrying" | "status" | "unsettled">; /** * Whether the session has yet to judge its drafts where its record reads now, as its builder knows it: a session * told its record moved only after the render the record moves in is carrying from that render on * (`ScheduleEditing.carrying`). The session's own `carrying` unless given. */ readonly carrying?: (() => boolean) | undefined; /** * Whether the session takes a gesture now, as its builder knows it: its record read, the session writable * (`ScheduleEditing.available`). An answer lands as a gesture does, so it waits for one that does not. Always, * unless given. */ readonly available?: (() => boolean) | undefined; } /** The words a run says a conflict to choose in: the refused Save's. */ export type OptimiseSessionWords = Pick & { readonly m: Pick; }; /** * A builder's sessions as a run asks them. * * @param held - Each session over a record the builder edits, read as the run asks: the builder's sessions as they stand * @param words - The builder's editing words: a conflict to choose is said in the refused Save's, as the banner's sentence * @returns The sessions' drafts, whether they can hand them over and whether they stand on what the page has read, and the * conflicts they hold */ export declare function optimiseSessions(held: () => readonly OptimiseSession[], words: OptimiseSessionWords): OptimiseSessions; /** * A Schedule builder's sessions as a run asks them: each kind's and each record's beside them, named by the record * its session edits — the name its binding carries, its editing's `sourceId` on the wire. * * @param editing - The builder's editing, read as the run asks; `undefined` while it has none, and there are no drafts * @param recordOf - The record a kind's session, or a record's beside the kinds, edits, by the kind's slot or the * record's key; `undefined` for one that edits no record * @param words - The builder's editing words * @returns The sessions, as a run asks them */ export declare function scheduleOptimiseSessions(editing: () => Pick | undefined, recordOf: (kind: string) => string | undefined, words: OptimiseSessionWords): OptimiseSessions; //# sourceMappingURL=optimise-sessions.d.ts.map