import type { AntiJoinDef, JoinDef, Row, ViewDef } from '../types.ts'; export type PlannedLink = { kind: 'field'; fromAlias: string | undefined; from: string; to: string; } | { kind: 'value'; to: string; value: unknown; }; export interface PlannedJoin { def: JoinDef; table: string; alias: string | undefined; fromAlias: string; links: PlannedLink[]; inner: boolean; backwardsJoin: boolean; alwaysMatched: boolean; } export interface PlannedAntiJoin { def: AntiJoinDef; table: string; links: PlannedLink[]; } export interface ViewPlan { baseAlias: string; joins: PlannedJoin[]; antiJoins: PlannedAntiJoin[]; } export declare function planView(viewName: string, view: ViewDef): ViewPlan; export interface ViewRowSource { base: Row[]; rowsOf: (entry: PlannedJoin | PlannedAntiJoin) => Row[]; } export interface ViewEntry { row: Row; matches: Array; } export declare function materializeEntries(viewName: string, view: ViewDef, source: ViewRowSource): ViewEntry[]; export declare function entriesReading(plan: ViewPlan, tableName: string): Array;