/** * The kernel-composed reads over archivable and trashable entities (#119), written once for * both adapters: the view predicate `ctx.page`/`ctx.search` add, and the two trashed readers. * * Kept apart from `entity-state.ts` because these need the list and search composers, and those * need the view predicate from there — one direction of import, not a cycle. */ import { type EntityStateName } from '@substrat-run/contracts'; import { type EntityStatePlan, type StateCheck } from './entity-state.js'; import { type ListIndexPlan } from './list-index.js'; import type { OperationContext, PageParams } from './scope-host.js'; import { type SearchIndexPlan } from './search-index.js'; /** * Refuse the bin on the UNCHECKED readers. `ctx.page` and `ctx.search` check no permission, so * the trashed view is not theirs to serve — it reaches them as a string from the wire as easily * as from code, and must be refused there rather than answered. */ export declare function uncheckedView(verb: string, entityType: string, view: string | undefined): EntityStateName | undefined; /** * The `src`-aliased predicate a search over `entityType` adds for `view`, or `undefined` when * the entity declares no state (every row is active). */ export declare function searchStateWhere(statePlans: ReadonlyMap, entityType: string, view: EntityStateName | undefined): string | undefined; /** What the trashed readers need from the adapter. */ export interface TrashedReadDeps { /** A read on the scope's own database, inside the operation. */ query: (sql: string, params: readonly unknown[]) => Record[]; listPlans: ReadonlyMap; searchPlans: ReadonlyMap; statePlans: ReadonlyMap; check: StateCheck; /** Test override; a sealed production walk chooses a private budget up to `TRASH_SCAN_BUDGET`. */ scanBudget?: number; continuation?: (entityType: string, params: PageParams) => ReturnType; } /** Maximum number of binned rows one `ctx.pageTrashed` call reads. */ export declare const TRASH_SCAN_BUDGET = 2000; export type TrashedReads = Pick; export declare function createTrashedReads(deps: TrashedReadDeps): TrashedReads; //# sourceMappingURL=entity-state-reads.d.ts.map