/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. * * The Plan's effects (#815) — what a state transition asks of the world: the * window and the resolution written into the sources of its slice (#1344), * and the author's callbacks. The controller runs them INSIDE the action that * produced them, right after the transition. * * # One window across the sources * * Every source of the Plan's `Slice.bindRecords` whose range field speaks the * axis's arm holds the window (`root/window.ts`) — but the canvas's rows', the * `rows` source's and each resource kind's, which the dates on screen never * narrow. A pan, the now rung, the brush and the time navigator write the * window into each of them at once — the reader's own gesture, so a choice of * a source's that no index takes beside a window gives way, as the range * editor says it would. A canvas whose slice has no source holding the window * holds its own (`PlanWindowHold`), and the same gestures move it; a canvas * with no slice keeps the axis's stated window, and an ordinal axis's list is * its window. * * # Every window write reads the CURRENT window * * A pan, the now rung and the resolution zoom are all arithmetic on the window * shown — the one the sources hold, or the canvas's own. They resolve the * scale from a fresh read rather than from the one the last render drew with, * so two effectful actions in one handler compose: two `]` presses pan two * periods, where the second one used to be computed from the window the first * had already moved. * * # A resolution only re-buckets * * A record's resolution is presentation: switching WEEK → DAY re-buckets the * window shown, and fetches nothing — it is no part of a source's narrowing. * It is written to each source holding the window, else to every source — a * slice with no window holds it there. * * @packageDocumentation */ import type { PlanScale } from "../scale.js"; import { type PlanRootValue } from "../model.js"; import type { PlanEffect } from "../plan-state.js"; import { type PlanWindowHold, type PlanWindowPart } from "../root/window.js"; /** * The scale as the window is held NOW — the same resolution the canvas * renders with (`resolveScale` over the leading source's window and the * resolution, else the window last shown — the canvas's own, while no source * holds one — and the axis's stated window). * * @param value - The latest root * @param hold - The canvas's window hold: the window last shown, and the sources whose ranges never hold it * @returns The scale, or `undefined` when no window resolves */ export declare function currentScale(value: PlanRootValue, hold?: PlanWindowHold): PlanScale | undefined; /** * Write a window `[min, max)` — the reader's own gesture, a pan, the brush, * the time navigator: into every source holding the window, else into the * canvas's own (#1344), which its render follows. * * @param parts - The sources holding the window * @param min - The window's start, on the axis's domain * @param max - Its end, exclusive * @param hold - The canvas's window hold: what holds the window while no source does */ export declare function writePlanWindow(parts: readonly PlanWindowPart[], min: number, max: number, hold: PlanWindowHold | undefined): void; /** * Run one transition's effects, in order. * * @param effects - The effects the transition returned * @param value - The latest root (its slice and callbacks) * @param hold - The canvas's window hold: the window last shown, the canvas's own while no source holds one, and the * sources whose ranges never hold it */ export declare function runPlanEffects(effects: readonly PlanEffect[], value: PlanRootValue, hold?: PlanWindowHold): void; //# sourceMappingURL=effects.d.ts.map