/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The shared keyed read (#1323): one entry of a record read a page at a time * (`Data.bindPaged`), found by its key's text through the record's key search, * its page read, and the entry taken from it — the Roster's week, and the * Allocation's day; and a run of entries, a span of keys found by one search * and read as one page — the Allocation picker's month. A read in flight is * told from an entry the record is confirmed not to hold, so an unresolved * read is never drawn as an empty period. * * @packageDocumentation */ import { type option, type ValueTypeOf } from "@elaraai/east"; import type { SeekQueryType, SeekRangeType } from "@elaraai/east-ui"; /** A record read a page at a time: its key search, and its pages. */ export interface KeyedWindow
{
/** The record's key search; `none` for a source with nothing to search. */
seek: option<(query: ValueTypeOf ;
}
/**
* Reads one entry by its key.
*
* @typeParam P - A page as the window serves it
* @typeParam V - The entry
* @param window - The record, read a page at a time
* @param key - The entry's key, as East prints it
* @param entryOf - The entry the page holds for the key, or `undefined` when it holds none
* @param what - What the record holds, for the refusal (`Roster history`)
* @returns `none` while the search or the page is in flight; `some(none)` when the record holds no such entry; else `some(some(entry))`
* @throws {Error} When the window has no key search
*/
export declare function readKeyedEntry (window: KeyedWindow , key: string, entryOf: (page: P) => V | undefined, what: string): option