/** * Computed-property emission for the Convex projection. * * Strategy (see docs/internal/proposals/2026-07-14-convex-computed-properties.md): * - `helpers` (default): emit convex/computed.ts of pure functions per entity. * - `inline`: materialize self-only computeds into get/list returns. * * Unresolved expressions always emit CONVEX_UNRESOLVED_COMPUTED — never silent drop. * Multi-hop aggregates also emit an async hydrate helper that preloads every * relationship depth onto the document before the sync compute helper runs. */ import type { IR, IREntity, IRExpression } from '../../ir'; import type { ProjectionDiagnostic } from '../interface'; import type { NormalizedOptions } from './generator.js'; export interface ComputedResult { code: string; diagnostics: ProjectionDiagnostic[]; } /** * Emit a `convex/computed.ts` module of pure helper functions. * One export per entity that has at least one fully-resolved computed: * `export function computeOrder(doc: Record): Record` * When computeds need nested relation graphs, also emit: * `export async function hydrateComputedRelationsForOrder(ctx, doc): Promise` */ export declare function generateComputedHelpers(ir: IR, options: NormalizedOptions): ComputedResult; /** Hydration lines for an entity's computed expressions (empty when none need relations). */ export declare function renderEntityComputedHydration(ir: IR, entity: IREntity, options: NormalizedOptions, docExpr?: string, docIdExpr?: string, baseIndent?: string): { lines: string[]; exprs: IRExpression[]; diagnostics: ProjectionDiagnostic[]; }; /** * Inline computed field assignments for a single-doc return (get path). * Returns empty when strategy is not inline or no fields resolve. */ export declare function renderInlineComputedFields(entity: IREntity, docVar: string, options?: NormalizedOptions): { fields: { name: string; code: string; }[]; diagnostics: ProjectionDiagnostic[]; }; //# sourceMappingURL=computed.d.ts.map