import type { NodeDefinition, SchemaMetadata } from '../schema/types'; import type { SelectionNode } from './selection.compiler'; /** * Converts a `select` object (used in the programmatic API) into the internal * SelectionNode[] AST that the SelectionCompiler operates on. * * Normalization rules: * - `{ field: true }` for a scalar → SelectionNode with isScalar: true * - `{ field: true }` for a relationship → all scalar properties of the target node * - `{ field: { select: { ... } } }` for a relationship → nested selection * - `{ fieldConnection: { where: {...}, select: { edges: { node: { select: {...} }, properties: { select: {...} } } } } }` → connection node * - `{ field: false }` or missing → omitted */ export declare class SelectNormalizer { private schema; /** * Cache of all-scalar-fields selections per type name. * Bounded by the number of node types in the schema (~50-100 entries). */ private scalarFieldsCache; constructor(schema: SchemaMetadata); /** Clear the scalar fields cache. Useful in tests to prevent cross-test pollution. */ clearCache(): void; /** * Normalize a select object into SelectionNode[]. * * @param select - Object like \{ id: true, name: true, drugs: \{ select: \{ id: true \} \} \} * @param nodeDef - Node definition from schema metadata * @returns Normalized SelectionNode array */ normalize(select: Record, nodeDef: NodeDefinition): SelectionNode[]; /** * Normalize a relationship field value into a SelectionNode. */ private normalizeRelationship; /** * Normalize and validate an orderBy input into the internal format. * Accepts a single object `{ field: 'ASC' }` or an array `[{ field: 'ASC' }, ...]`. */ private normalizeOrderBy; /** * Normalize a connection field value into a SelectionNode. */ private normalizeConnection; /** * Normalize and validate a connection orderBy input. * Each entry must be an object with exactly one key: `node` or `edge`. * The inner value is a `{ field: 'ASC' | 'DESC' }` map, which may contain * multiple fields (preserving insertion order as sort priority). */ private normalizeConnectionOrderBy; /** * Normalize edge property selections into SelectionNode[]. * Edge properties are always scalars. */ private normalizeEdgeProperties; /** * Generate SelectionNode[] for all scalar (non-cypher) properties of a node. */ private allScalarFields; } //# sourceMappingURL=select-normalizer.d.ts.map