import type { NodeDefinition, RelationshipDefinition, SchemaMetadata } from './types'; /** * Clear the module-level resolve cache. * Useful in tests to prevent cross-test state pollution. */ export declare function clearResolveTargetDefCache(): void; /** * Resolve a target type name to a NodeDefinition, handling union targets * by merging all member nodes' properties and relationships. * * Results are memoized per (schema identity + target) to avoid repeated * O(members × properties) merges for the same union type. */ export declare function resolveTargetDef(target: string, schema: SchemaMetadata): NodeDefinition | null; /** * Compute the validated label string for a NodeDefinition. * Deduplicates labels, validates each, and joins with ':'. * * Callers that need caching should maintain their own cache (e.g., per MutationCompiler instance) * to avoid cross-test pollution from module-level state. */ export declare function getTargetLabelString(nodeDef: NodeDefinition): string; /** * Options for building a Cypher relationship pattern. */ export interface BuildRelPatternOptions { /** Cypher variable for the source node (e.g. `'n'`) */ sourceVar: string; /** Relationship definition from the schema */ relDef: RelationshipDefinition; /** Cypher variable for the target node (e.g. `'n0'`). Empty string omits the var. */ targetVar: string; /** Optional edge variable to bind the relationship (e.g. `'e0'`). Omit for anonymous `[:TYPE]`. */ edgeVar?: string; /** * Target label strategy: * - `'auto'` — use `relDef.target` escaped as a label * - a string — validated and escaped via assertSafeLabel * - `undefined` / omit — no label on the target node */ targetLabel?: string | 'auto'; /** * Pre-escaped target label string (e.g. from `getTargetLabelString`). * Bypasses validation — used when the caller already composed a multi-label * string like `` `Type`:`Label` ``. Takes precedence over `targetLabel`. */ targetLabelRaw?: string; /** * When true, checks if `relDef.target` is an abstract type (union/interface) * and omits the target label. Requires `schema` to be passed. */ schema?: SchemaMetadata; } /** * Build a Cypher relationship pattern string from a RelationshipDefinition. * Shared across SelectionCompiler, WhereCompiler, and MutationCompiler. * * Examples: * `(n)-[:HAS]->(n0:Book)` * `(n)<-[e0:WRITTEN_BY]-(n0)` */ export declare function buildRelPattern(opts: BuildRelPatternOptions): string; /** * Check if a target type name is a union or interface (not a concrete node). */ export declare function isAbstractTarget(target: string, schema: SchemaMetadata): boolean; //# sourceMappingURL=utils.d.ts.map