import type { MaterializedViewStrategy, MaterializedViewStrategyHandle } from './types.js'; /** * Register a materialized view: a declared query whose result is * persisted as a queryable collection and kept fresh as sources * change. Writes go through the standard `Collection.put` pipeline; * refresh-driven deletes route through `Collection._internalDelete` so * user `onDelete` guards on the output collection aren't tripped by * housekeeping. * * Two registration modes: * - **single-source** — declare `query: (db) => Query`; the * dependency analyzer derives source collections from the plan. * - **UNION** — declare `unionSources: [{ collection, map }, ...]` * plus optional `groupBy` + `aggregate`; the executor reads each * arm, maps to the unified row shape, concatenates, then groups * and aggregates. * * The two modes are mutually exclusive — exactly one of `query` / * `unionSources` must be set at registration time. * * See docs/superpowers/specs/2026-05-20-dim14-mv-v2-design.md (single-source v2) * and docs/superpowers/specs/2026-05-21-dim14-mv-multikey-and-union.md (UNION). */ export declare function withMaterializedView>(spec: MaterializedViewStrategy): MaterializedViewStrategyHandle;