/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. * * A schedule's event kinds as a builder reads them (#1039): each kind placed on * a paged resource kind read a cell at a time, and every other kind counted * before one of its events is read. It is the shared reader the Plan reads its * kinds through (`plan/root/cells.ts`, its adapter), and the Calendar next. It * holds no builder's type: its host gives it, in the terms below, each event * kind ({@link ScheduleCellKind}), the resource kinds read whole and the paged * rows, the range it reads and its buckets, the drafts and the paged rows in * view, and hands what it read to its own seams. * * The paged rows are a Calendar's paged resource kind, or a Plan's own rows * read a page at a time (#1541): the resources a page draws — one an entry of * a kind, any number of a Plan's group rows — each with the slot its row lands * on, so one paged source serves every kind of resource its rows lay out. * * # Cells * * A kind placed on the paged resource kind, whose source of the slice lists a * series index of its record, reads the events of the resources in view — and * of no resource, its Unassigned row's — a level at a time, never every event * over the range. The series index files each event once, at the level its * length fits (#1433), so a cell is a block of {@link SCHEDULE_CELL_BLOCK} of * the paged kind's resources, in the kind's order, over one level's run of * tiles (`levelRuns`: from two tiles before the range read to one after it): * one range a resource (`levelCellQueries`), whatever the range's width. The * cells wanted are the blocks meeting the rows in view and * {@link SCHEDULE_CELL_MARGIN} resources either side, each a level, with the * cells of no resource. The reader keeps what it read by block, level and * tile — a range's entries split by the tile each names — so a pan or a zoom * asks, a block a level, one range a resource over the tiles it does not hold * (two, when a zoom out grows the run both ways): their searches in one * request, which counts their entries before one is read, beside the entries * of the tiles held; their entries in one more. Tiles are kept while their run * is wanted, at the revision they were read at: a pan or a scroll within the * tiles held reads nothing, and a commit reads the wanted runs again, the old * ones standing in until they land. An event past a year, filed under each * year it touches, is one event, kept by its key. A window of * the paged kind's resources whose read failed — the paging runtime throws a * `PagedReadError` for it — gives no block, its host saying so where its rows * would be, with Retry, until a Retry lands it; anything else a read of it * throws is thrown on ({@link scheduleWindowKeys}). * * A paged kind its source of the slice narrows is the narrowing's resources, in * the source's index's order (#1344): its blocks are the narrowing's, so only * the narrowed resources in view have their events read. The rows in view are * reported under the narrowing their windows are, and a choice's rows still to * land are reported by none: until they are, a span of the last narrowing's * reads no cell, and its cells stand in. * * # Counted first * * Every other kind is counted before one of its events is read: one read * through its source of the slice, over the range for every resource, through * the source's interval index — the count its window's read asks first, so * counting asks e3 nothing of its own; one read through a day index, by the * entries it files under the days of the range, the search its window's read * asks first — an event under each day it runs on, so an upper bound on the * events, never their number (`exact` false); and one held whole in memory. A * kind within {@link SCHEDULE_EVENT_CAP} in the range is left to its host, * which reads it over the range as it reads a kind no reader names; past it, * its events are never read or drawn, and the reader names it among the kinds * past the cap (`capped`): a host counts none of its events on a resource's * row, nor its hours anywhere, and says so. Its host's other readers, which * read it over the range or within it — a footer's counts, an inspector's — * read it only once the same count over the range says it is within the cap * ({@link scheduleWithinCap}), never by what the reader last decided, which a * new narrowing outruns; past it they wait for the reader, which gives it no * cells. * * # The cap * * While the wanted cells hold at most {@link SCHEDULE_EVENT_CAP} entries, their * events draw. Past it — or past one batch of searches — and for a counted * kind past the cap, the kind's summary index draws its shading instead: its * cells, at the largest of its tiles that divides the host's bucket and serves * the narrowing whole, folded into the buckets — the share of each booked for a * kind whose rows book their buckets (`booked`), how many events touch it for * one whose rows mark them. With none to shade, a kind read by cells is read * over the range while its count there is within the cap, and past it, as a * counted kind with no summary, the notice: its rows hatched, and the host's * banner naming how many events there are — or, where the count is no number * of them (a day index's), that they are not counted — and the resolution its * smallest summary shades at, or none. A hidden kind is read for nothing: * given no cells, it draws nothing, and a host leaves it out of every figure * of its own — the kinds past the cap name none. * * # The narrowing, the drafts and the link ends * * A series index led by the narrowed fields serves the narrowing exactly; the * fields it leaves are asked of the events read, in one read * (`recordSliceWithin`). The drafts are the host's sessions', and each draws * where it places its event, read or not — but a draft of an event the * narrowing does not hold, which a narrowed range leaves out too: the stored * rows of the drafted events the cells do not hold are read by their keys, in * one read, and asked of the narrowing in the same read as the cells' events. * An event whose row the host wants though no cell holds it — a link's end * ({@link ScheduleCellKind.wanted}) — is read by its key in that read. A kind * its host reads over the window's rows alone, every draft it is given drawing * where it places its event ({@link ScheduleCellKind.windowField}: the * Calendar's, whose backlog it pages itself, #1424), has its drafts asked of * the narrowing the same way — but the window's range — so a draft of an event * the narrowing does not hold draws nowhere, and a backlog event a gesture * scheduled draws where it is placed. * * # A window's rows * * A counted kind within the cap whose events are read a window at a time — * through its source's interval index, or a day index, one event by its key — * is given cells too (#1599): its window's own stored rows, which its host * hands the reader a read of ({@link ScheduleCellKind.stored}). The reader * keeps them as it keeps a kind's cells, at the revision they were read at, * while its record, its narrowing and the range hold — a draft's redraw asks * e3 nothing, nor the kind's own read — and they stand while they are read * again: after a Save, after another session's write, under new choices. Its * host's seams draw the kind from them, so a draft made meanwhile draws at * once, and a gesture finds its event's row among them: a Save never stops the * editing. A kind read whole has no such read to wait on, and is left to its * host as before. Which of its drafts draw is as its window's own read drew * them: for a kind whose window draws a draft only of an event it holds, or of * a new one ({@link ScheduleCellKind.isNew}, #1343) — or, while its session has * yet to judge its drafts where its record reads now, of one the reader last * drew ({@link ScheduleCellKind.carrying}, #1599) — the drafts of the other * events are left out, told by the rows held and the row each draft's session * began from — e3 asked nothing. * * # The view * * What the reader hands on is its last complete read, made for a view: its * host's period, and the choices each kind's source holds. How that stands to * what is asked now is the one rule every builder reads its rows by * (`../view-read.ts`): a read again of the same view leaves its host live, * other choices of the same period leave what stands retained, and a period * stepped to draws none of a windowed kind's rows of the last. * * # What a Save landed * * A Save's confirmation reads its events by their keys, never the cells, which * stand at the revision they were read at until the commit's are read again — * a round trip a deployed server makes long. A host that draws what Saves * landed hands the reader them as its editing keeps them * ({@link ScheduleCellsArgs.landed}): over a kind's cells read before them — * at another revision than the one its record reads at now, the rule every * host that draws what a Save landed reads its rows by (east-ui-components' * `readBeforeSaves`) — every event they landed draws as the Save left it, * laid under the drafts — a draft made since draws in its place, and one the * narrowing did not hold draws nowhere, as before the Save — and its row is * held as the Save left it, where a gesture and an inspector read it; one it * deleted draws nowhere, and is read by its key. Once a kind's cells are read * at the revision its record reads at now — or none of its cells is read, the * kind counted, past the cap or hidden — what landed of it is let go * ({@link ScheduleCellsArgs.shown}), so no frame draws both. Whichever * revision a Save was drafted at, cells read before the record's revision now * are from before it: two Saves before the cells are read again each keep * their events, and so does a Save drafted over another session's write the * cells have still to read. * * @packageDocumentation */ import { ArrayType, BlobType, DateTimeType, DictType, FloatType, OptionType, StringType, StructType, type EastTypeValue, type ValueTypeOf, type option } from "@elaraai/east"; import { type RecordSliceBindType, type RecordTile } from "@elaraai/east-ui/internal"; import type { TimeResolution } from "../time/scale.js"; import { type ViewState } from "../view-read.js"; import { DraftedStanding } from "./drafted-rows.js"; import type { ScheduleEventDraftsValue, ScheduleKindRows, ScheduleLanded, ScheduleLandedRows } from "./editing.js"; /** How many of a paged resource kind's resources a cell holds: a block of them, in the kind's order. */ export declare const SCHEDULE_CELL_BLOCK = 50; /** The resources either side of the rows in view whose blocks are read too. */ export declare const SCHEDULE_CELL_MARGIN = 25; /** A kind's source of the slice: a record Slice's controls — its reads, its counts and its cells go through it. */ export type ScheduleCellPart = ValueTypeOf; /** One bucket of a resource's shading, as the reader hands it to its host's seams: the bucket's start, and its value. */ declare const ShadeType: StructType<{ readonly at: DateTimeType; readonly value: OptionType; }>; /** The resources' shading, as the reader hands it to its host's seams: by the key of the rows it stands in for, then by the resource key's text. */ declare const ShadingType: DictType; }>>>>; /** One bucket of a resource's shading: its start, and the share of it booked, how many events touch it, or `none` — the hatch. */ export type ScheduleCellShade = ValueTypeOf; /** The resources' shading: by the key of the rows it stands in for, then by the resource key's text, each its buckets. */ export type ScheduleCellShading = ValueTypeOf; /** What the reader read of each kind it gives cells, by the kind's slot: one beast2 of the kind's `cellsType` each. */ export type ScheduleCellReads = ValueTypeOf>; /** One event kind, as the reader reads it (see the module docs). */ export interface ScheduleCellKind { /** Its slot: what its cells, its shading and its notice are named by. */ readonly key: string; /** Its name, as the notice names it: `Print job`. */ readonly name: string; /** The resource kinds its events are placed on, by their slots. */ readonly takes: readonly string[]; /** Whether its rows shade the share of each bucket its events book — bars and chips — rather than how many touch it. */ readonly booked: boolean; /** The key of the rows its shading stands in for on a resource kind's resources, by the resource kind's slot: its host's. */ readonly shadeKey: (resources: string) => string; /** What its cells are encoded in: an Array of `{ key, row }`, at its record's key and row types. */ readonly cellsType: EastTypeValue; /** * The `.east` text its series and summary indexes file a resource's events under, or no resource's: the key its * cells search for; `none` where its resource field cannot hold it. */ readonly seriesKey: (resource: option<{ readonly kind: string; readonly key: string; }>) => option; /** * How many of its stored events overlap `[from, to)`, counted before one is read; `none` while the count is in * flight. For a kind read through a day index, the entries it files under the days of `[from, to)`: an upper bound * on the events, never their number ({@link ScheduleCellKind.exact}). */ readonly count: (from: Date, to: Date) => option; /** Whether {@link ScheduleCellKind.count} counts its events themselves: `false` for a kind read through a day index. */ readonly exact: boolean; /** Its source of the slice, when it has one: what its cells, its summary and its narrowing are read through. */ readonly part: ScheduleCellPart | undefined; /** Whether the viewer hides it: nothing of it draws, so no cell of it is read, and it gives no notice or shading. */ readonly hidden: boolean; /** The keys' texts of its events whose rows its host wants though no cell holds them — a link's ends — read by their keys. */ readonly wanted: readonly string[]; /** * The field its host's window narrows — its events' start — for a kind narrowed through its source whose every draft * given draws where it places its event (#1424: the Calendar's kinds whose backlog it pages itself). The reader asks * the narrowing — but that field's range — of the stored rows of the kind's drafted events its window does not hold, * read by their keys in one read, and leaves out the drafts of those the narrowing does not hold either, as it does * for a kind read by its cells; a new event, which no stored row names, keeps its draft. `undefined` leaves the * drafts to the host's seams, or to {@link ScheduleCellKind.isNew}. */ readonly windowField?: string | undefined; /** * Whether an event is a new one — its editing session began from no stored row — for a kind narrowed through its * source whose window's read draws a draft only of an event it holds, or of a new one (#1343): a draft of an * existing event the narrowing does not hold, its window among it, never leaks into it. Given beside * {@link ScheduleCellKind.stored}, the reader leaves out the drafts of the events its window's rows do not hold that * are no new ones, asking e3 nothing. `undefined` for a kind every draft of which draws where it places its event, * and for one no source narrows. */ readonly isNew?: ((id: string) => boolean) | undefined; /** * Whether its editing session has yet to judge its drafts where its record reads now (the shared editing's * `carrying`, #1599), for a kind given {@link ScheduleCellKind.isNew}: what the session says of an event — that it * is no new one — is then of the record as it was, and a draft the reader last drew stays drawn though its window's * rows, read again, hold its event no more. Another session removed it: left out as one the narrowing does not * hold, it left its builder until the session's read of it landed. `undefined` for a kind whose session judges its * drafts as its record is read. */ readonly carrying?: (() => boolean) | undefined; /** * Its window's own stored rows over `[from, to)`, as one beast2 of {@link ScheduleCellKind.cellsType} — each row once * by its key, no draft in place — or `none` while their read is in flight: its host's, for a kind read a window at a * time whose events are read by their keys (through its source of the slice, or a day index). Within the cap the * reader keeps them as it keeps a kind's cells (see the module docs, "A window's rows"). `undefined` for a kind read * whole, which its host reads over the range itself. */ readonly stored?: ((from: Date, to: Date) => option) | undefined; /** * The revision its record reads at now, for a kind given {@link ScheduleCellKind.stored} that no source of the slice * narrows — one read through a day index: what its rows standing are told from, as from before a Save or holding * it. A kind with a source reads its source's. */ readonly revision?: (() => option) | undefined; } /** A resource kind read whole, as the reader hatches and shades its rows: its slot, and its resources' keys' texts in order. */ export interface ScheduleCellResources { /** Its slot. */ readonly key: string; /** Its resources' keys' texts, in order. */ readonly keys: readonly string[]; } /** One resource a paged window draws: the slot its row lands on, and its key's text. */ export interface ScheduleCellKey { /** The slot its row lands on: the paged resource kind's, or a Plan's resources series' (#1541). */ readonly slot: string; /** Its key's text. */ readonly key: string; } /** * A resource as the reader names it among those whose rows it has drawn * ({@link ScheduleCellsRead.drawn}): its slot and its key's text, as East prints * a `Schedule.Types.ResourceRef` — two slots' resources of one key are two * resources (#1541). * * @param slot - The slot its row lands on * @param key - Its key's text * @returns Its name among the resources drawn */ export declare function scheduleCellId(slot: string, key: string): string; /** The paged rows, as the reader reads the blocks of them in view (see the module docs). */ export interface ScheduleCellPaged { /** The slots its rows land on: the paged resource kind's, or each of a Plan's resources series and kinds cases (#1541). */ readonly kinds: readonly string[]; /** How many entries a window of it holds: what a row in view's window places it by. */ readonly window: number; /** Whether the viewer hides it: none of its rows draws, so no cell of it is read. */ readonly hidden: boolean; /** * The resources its entries `[offset, offset + limit)` draw, each by its slot and its key's text, in the order its * rows draw them — one an entry of a resource kind's, any number of a Plan's entry whose rows nest them (#1541); * `none` while that window is in flight. */ keys(offset: bigint, limit: bigint): option; /** How many entries it has — its narrowing holds, when its source narrows it — once known. */ total(): option; /** The narrowing its windows belong to, as its source names it (#1344); `undefined` for rows no source narrows. */ narrowing(): string | undefined; } /** * The paged kind's rows in view, as its host reports them: the first and the * last, each by its window and its key's text, and the narrowing they were * drawn under. */ export interface ScheduleCellSpan { /** The first row in view. */ readonly first: { readonly w: number; readonly key: string; }; /** The last row in view. */ readonly last: { readonly w: number; readonly key: string; }; /** * The narrowing the rows were drawn under, as the kind's source names it * (#1344): their windows are its. `undefined` for a kind its source does * not narrow. */ readonly narrowing: string | undefined; } /** One bucket of the host's, by its start and its end, in ms. */ export interface ScheduleCellBucket { /** Its start. */ readonly start: number; /** Its end, exclusive. */ readonly end: number; } /** A range the reader read over, in ms: its start and its end, exclusive. */ export interface ScheduleCellRange { /** Its start. */ readonly from: number; /** Its end, exclusive. */ readonly to: number; } /** What {@link useScheduleCells} reads over. */ export interface ScheduleCellsArgs { /** The host's name, which heads what the reader logs — `Plan`: a read that fails is said as the host's. */ readonly host: string; /** The event kinds. */ readonly kinds: readonly ScheduleCellKind[]; /** The resource kinds read whole: a counted kind past the cap shades, or is hatched, over their rows. */ readonly resources: readonly ScheduleCellResources[]; /** The paged resource kind, when one pages. */ readonly paged: ScheduleCellPaged | undefined; /** The range the host reads its events over. */ readonly range: { readonly from: Date; readonly to: Date; } | undefined; /** * The period the range is, as text, for a host whose rows are a period's — the Calendar's day, week or month: a read * for another is a step, and none of a windowed kind's rows of the last draws under it (`../view-read.ts`). Left out * by a host whose range is a window panned over its rows — the Plan's — where what the last range held stands. */ readonly period?: string | undefined; /** The range cut into the host's buckets, in order: what a summary's shading is folded into. */ readonly buckets: readonly ScheduleCellBucket[] | undefined; /** The host's resolution, which a summary's tile must divide; `undefined` on an axis of no time. */ readonly resolution: TimeResolution | undefined; /** Every kind's drafts — the same object while they hold. */ readonly drafts: ScheduleEventDraftsValue; /** The paged kind's rows in view, as the host last reported them; `undefined` before it has. */ readonly span: ScheduleCellSpan | undefined; /** * What confirmed Saves landed of the kinds read by their cells, as the host's editing hands them on (its `landed`): * drawn over a kind's cells read before the commit until they are read again (see the module docs); `undefined` for * a host that draws none. */ readonly landed?: ScheduleLanded | undefined; /** * Lets go of what Saves landed of a kind once its cells are read since them, or none of them is read (its editing's * `shown`). */ readonly shown?: ((kind: string, ids: Iterable) => void) | undefined; } /** A kind giving the notice in place of its events: too many of them in the range, and no summary that shades them here. */ export interface ScheduleCellNotice { /** The kind's slot. */ readonly kind: string; /** Its name. */ readonly name: string; /** How many of its events there are; `undefined` where its count is no number of them — a day index's — so they are not counted. */ readonly events: number | undefined; /** The resolution its smallest summary shades at; `undefined` when it has none. */ readonly resolution: RecordTile | undefined; } /** The rows a kind's cells hold, by the event's key's text, each its row's bytes. */ type HeldRows = ScheduleKindRows; /** A read of the event kinds that failed: why, and the kinds whose own read threw. */ export interface ScheduleCellsFailure { /** Why it failed, in the read's own words. */ readonly reason: string; /** The slots of the kinds whose own read threw, in the kinds' order; none where the failure was no one kind's. */ readonly kinds: readonly string[]; /** * Whether it was a kind's window that could not be read — its count over the range, its window's own rows, or what * its narrowing holds of its drafts: what its host says its period's read failed by, with Retry. `false` for a read * over the paged kind's blocks — a block's cells, the paged kind's own windows — which its host says where those * rows are. */ readonly window: boolean; } /** What the reader read: what its host's seams draw the kinds from, and what a gesture finds an event's row in. */ export interface ScheduleCellsRead { /** * What it read of each kind it gives cells, by the kind's slot: a kind read by its cells, their entries; one past * the cap, or hidden, none. A kind it names not is read over the range by its host — a counted kind only once its * count there is within the cap ({@link scheduleWithinCap}). */ readonly reads: ScheduleCellReads; /** The resources' shading. */ readonly shading: ScheduleCellShading; /** * Every kind's drafts as the seams take them: a kind read by its cells, or by its host over the window's rows alone * ({@link ScheduleCellKind.windowField}), those of events its narrowing does not hold left out; over a kind's cells * read before a Save of it, what the Save landed laid under them (see the module docs). */ readonly drafts: ScheduleEventDraftsValue; /** * Each kind it gives cells, by its slot: the rows they hold, by the event's key's text — where a gesture finds an * event's row, one it does not hold read by its key; none for a kind given none, whose range is never read. Over * cells read before a Save of the kind, each event it landed as the Save left it, one it deleted read by its key. */ readonly held: ReadonlyMap; /** The kinds giving the notice in place of their events. */ readonly notices: readonly ScheduleCellNotice[]; /** * The kinds past the cap the viewer shows, by their slots: none of their events is read or drawn, so a host counts * none of them on a resource's row, nor their hours anywhere — it says they are not counted, never 0. A count of them * over the window that counts the events themselves still counts them there. A hidden kind is in no host's figure, * and none of them. */ readonly capped: ReadonlySet; /** * Whether a read is in flight over a paged kind a kind is read by the cells of: the rows its cells have not landed * for wait on it ({@link ScheduleCellsRead.drawn}); `false` where no kind is read so, whose reads nothing waits on, * and while a read has thrown, which is in flight no more. */ readonly reading: boolean; /** * The paged rows' resources whose rows draw what is known of them (#1398, CL2), each by {@link scheduleCellId} — its * slot and its key, so two slots' resources of one key are apart (#1541): those whose cells the last read * landed for — while a read over another range is in flight, less those it reads again, whose cells there never * landed; a read over the same range — a commit, another narrowing — leaves its cells standing in. Any other * resource's rows are unread and draw the region wash under what they hold, never an empty row, and a host's * figures of such a resource — an inspector's row facts — are placeholders until its cells land, never 0. * `undefined` where no kind is read by its cells over a paged kind. */ readonly drawn: ReadonlySet | undefined; /** * The kinds whose cells are their window's own rows (see the module docs, "A window's rows"), by their slots: what * it holds of each is of the range it was read over alone, so a host whose range is a period draws none of it under * another ({@link ScheduleCellsRead.view}). */ readonly windowed: ReadonlySet; /** * How what it hands on stands to what its host asks now (`../view-read.ts`, the one rule every builder reads its * rows by): its last complete read's period and choices beside those asked, and whether a read is on its way. */ readonly view: ViewState; /** Why its latest read failed, and the kinds whose own read threw; `undefined` while it reads, or has read. */ readonly error: ScheduleCellsFailure | undefined; } /** * Whether a kind is within the cap over a range (see the module docs): its * count there at most {@link SCHEDULE_EVENT_CAP} — the rule the reader decides * a counted kind by, over the range it reads, and a host's other readers ask * over the same range before they read the kind over it or within it. * * @param count - The kind's count ({@link ScheduleCellKind.count}) — every kind has one; a day index's, an upper bound, is past the cap wherever it is * @param from - The range's start * @param to - Its end, exclusive * @returns `some(true)` within the cap; `some(false)` past it; `none` while the count is in flight */ export declare function scheduleWithinCap(count: ScheduleCellKind["count"], from: Date, to: Date): option; /** A window of the paged rows whose read failed: its host says so where its rows would be, with Retry. */ export declare const SCHEDULE_WINDOW_FAILED = "failed"; /** * One window of the paged rows, as the reader reads it (see the module docs): * the resources it draws, in order; `undefined` while it is in flight; * {@link SCHEDULE_WINDOW_FAILED} for a window whose read failed — the paging * runtime throws a `PagedReadError` for it (`isPagedReadError`). Anything else * a read of it throws is no read that failed, and is thrown on. * * @param paged - The paged rows * @param w - The window, by its place among theirs * @returns Its resources; `undefined` in flight; {@link SCHEDULE_WINDOW_FAILED} for a read that failed * @throws Whatever else reading the window throws */ export declare function scheduleWindowKeys(paged: ScheduleCellPaged, w: number): readonly ScheduleCellKey[] | undefined | typeof SCHEDULE_WINDOW_FAILED; /** The resources in view of a paged resource kind, by their place in its order: the first and the last. */ export interface ScheduleCellView { /** The first resource in view. */ readonly first: number; /** The last resource in view. */ readonly last: number; } /** * No row in view reported yet: the first resource, where a view opens — the * first block, and the next only once the rows in view reach within * {@link SCHEDULE_CELL_MARGIN} of it. */ export declare const SCHEDULE_CELL_OPENING: ScheduleCellView; /** * The blocks of a paged resource kind's resources a reader wants: those * meeting the resources in view and {@link SCHEDULE_CELL_MARGIN} either side. * * @param view - The resources in view * @param total - How many resources the kind has, once known * @returns The blocks, by their place, ascending */ export declare function wantedBlocks(view: ScheduleCellView, total: number | undefined): number[]; /** * The tiles a summary may shade a resolution's buckets by: those that divide * its bucket, the largest first — an ISO week divides no month. * * @param resolution - The host's resolution; `undefined` on an axis of no time * @returns The tiles */ export declare function dividingTiles(resolution: TimeResolution | undefined): readonly RecordTile[]; /** How many events touch a tile, and the milliseconds of it they cover: a summary's totals, as numbers. */ export interface ScheduleCellTotals { /** How many events touch it. */ readonly count: number; /** The milliseconds of it they cover. */ readonly ms: number; } /** * One resource's shading over the buckets (#1039): the totals of the summary * tiles inside each bucket added up — a tile that divides the bucket lies * wholly inside it — as the share of the bucket booked, at most all of it, * or how many events touch it. * * @param totals - The resource's totals, by tile start in ms * @param buckets - The buckets * @param booked - Whether its rows book their buckets: the share booked; else how many * @returns Its shading, a bucket each */ export declare function shadesOf(totals: ReadonlyMap | undefined, buckets: readonly ScheduleCellBucket[], booked: boolean): ScheduleCellShade[]; /** * The drafted events of a kind that its window's rows do not hold and that are no new ones (see * {@link ScheduleCellKind.isNew}): what its window's own read never drew a draft of. Which drafts draw is the rule every * builder that draws its drafts over the rows it reads asks (`drafted-rows.ts`' `DraftedStanding`): one its window * holds, a new one, and — while its session has yet to judge its drafts where its record reads now — one the reader last * drew, its window read again without its event. * * @param kind - The kind's slot * @param drafts - The kind's drafts, by the event's key's text * @param held - The rows its window holds * @param isNew - Whether an event's session began from no stored row * @param carrying - Whether the kind's session has yet to judge its drafts where its record reads now * @param standing - The rule, and the drafts last drawn, which the kind's drawn here replace * @returns Their keys' texts */ export declare function draftsNotHeld(kind: string, drafts: ReadonlyMap | undefined, held: Pick, isNew: (id: string) => boolean, carrying: boolean, standing: DraftedStanding): ReadonlySet; /** * What Saves landed of the kinds whose cells stand from before them (see the module docs): those read at another * revision than the one the kind's record reads at now, as east-ui-components' `readBeforeSaves` tells it. A kind none * of whose cells is read is laid nothing. * * @param landed - What Saves landed of the kinds read by their cells * @param revisions - The revision each kind's standing cells were read at * @param now - The revision each kind's record reads at now * @returns Those kinds' landed events, by their slots; the one empty map while none stands from before */ export declare function landedBefore(landed: ScheduleLanded | undefined, revisions: ReadonlyMap, now: ReadonlyMap): ReadonlyMap; /** * The kinds read by their cells (see the module docs): placed on the paged * resource kind, their sources listing a series index of their records. * * @param kinds - The event kinds * @param paged - The paged resource kind, when one pages * @returns Their slots, in order */ export declare function scheduleCellKinds(kinds: readonly ScheduleCellKind[], paged: ScheduleCellPaged | undefined): string[]; /** * The kinds' cells and counts (see the module docs), read in the component * that reads the event kinds' rows: what the host's seams draw the kinds from, * every kind's drafts as they take them, and what a gesture finds an event's * row in. Before the first read lands, every kind read by its cells draws * nothing yet, so no seam reads it over the range meanwhile; a read in flight * leaves the last standing, the drafts as they are now. Over a paged kind it * says which resources' rows draw what is known of them (`drawn`, #1398): every * other row's cells never landed, or are on their way over a range they were * not read over, and it draws the region wash — before the first read lands, * every row. A read again over the same range, a commit's or another * narrowing's, leaves the rows drawn as they were, their cells standing in. * It hands on the same object while what it hands on holds: where no kind is * read by its cells over a paged kind, a pan that leaves every kind within the * cap, or past it as it was, hands nothing on. Over a kind's cells read before * a Save of it, what the Save landed draws as the Save left it, and is let go * once they are read since (see the module docs). * * @param args - What it reads over * @returns What it read */ export declare function useScheduleCells(args: ScheduleCellsArgs): ScheduleCellsRead; export {}; //# sourceMappingURL=cells.d.ts.map