import { CallbackFunction, ChangeDetector, DcuplListOptions, ListItem, RawItem } from '@dcupl/common'; import { Catalog } from '../catalog/index.js'; import { DcuplApi } from '../dcupl/dcupl-api.js'; export declare class DcuplList { private dcuplApi; private cdRef; private options; key: string; modelKey: string; catalog: Catalog; /** * The key set of a scoped list: its `listItemKeys`, or the keys its seed * `query` selected when the item set was last derived (creation or * {@link update}). Undefined for a list over the whole model. A scoped list * owns a private IndicesController built from its items rather than sharing * the model's, and serves the model's current item for each of these keys * (#366). */ private scopeKeys; constructor(dcuplApi: DcuplApi, cdRef: ChangeDetector); private setup; private initIndicesController; private getListItemKeys; private getRelevantData; protected init(_initialOptions: DcuplListOptions): void; private initFromItemKeys; destroy(): void; protected _destroy(): void; update(options?: { reprocessData?: boolean; }): void; /** * Drops the list's query/result caches; the filtered data is recomputed * lazily on the next read from the list's current data, without * re-deriving a scoped list's item set (that is what {@link update} does). * dcupl.update() calls this for affected lists that do not auto-update, so * a query executed before the update can never keep serving its pre-update * cached result — while lists nobody reads pay no eager recompute. * * A scoped list (listItemKeys / seed query) keeps its key set but serves the * model's current items: each key is looked up again in the model's data, * and a key whose item was removed drops out. The full and the partial * update path behave the same (#366). */ invalidate(): void; /** * The models other than this list's own that its cached results were read * through (dotted paths in its query, facets, aggregates, …). dcupl.update() * treats the list as affected when any of them changes (#284). * @internal */ getDependencyModels(): ReadonlySet; /** * Emits `result_updated` for this list. dcupl.update() calls it once per * affected list, after every affected list has been refreshed, so a * subscriber re-querying any list in its handler sees post-update results * (#278). * @internal */ emitResultUpdated(): void; on(cb: CallbackFunction): () => void; /** * Subscribes to changes of this list's result: `list.on` filtered to * `result_updated`. Fires when a query change recomputes the result and * once per `dcupl.update()` that can have changed it — never for reads * (`execute`, `fn.facets`, `fn.aggregate`, …). * @returns a function that removes the subscription */ onResultChange(cb: CallbackFunction): () => void; }