/** * Representation-proof normalization of type references and default * expressions, so a module authored with SQL spellings (`integer`, * `timestamp with time zone`, `DEFAULT 'a'`) compares equal to the catalog * rendering pg_dump produces (`int4`, `timestamptz`, `DEFAULT 'a'::app.status`, * `nextval('app.s'::regclass)`). */ interface StringNode { String?: { sval?: string; }; } interface TypeNameNode { names?: StringNode[]; [key: string]: unknown; } /** Canonical `names` for a TypeName: `pg_catalog` dropped, aliases resolved. */ export declare function canonicalTypeNames(names: StringNode[]): StringNode[]; /** Stable text for a canonical TypeName (for equality checks). */ export declare function typeKey(typeName: TypeNameNode | undefined): string; /** Whether a CREATE/ALTER SEQUENCE DefElem only restates the default. */ export declare function isDefaultSequenceOption(defElem: { defname?: string; arg?: unknown; }): boolean; /** * Deep-canonicalize a parse tree's representation: every TypeName (and * `pg_catalog.`-qualified function name) to its catalog spelling, string * constants without their implicit `::text`, sequence options without * restated defaults, `CREATE MATERIALIZED VIEW` without WITH [NO] DATA. * Returns a new tree; the input is not mutated. */ export declare function canonicalizeTypes(node: T): T; /** * Strip the casts the catalog adds to a column default: a constant cast to * the column's own type (`'a'::app.status` on an `app.status` column) and * `::regclass` on sequence names (`nextval('app.s'::regclass)`). */ export declare function stripDefaultCasts(expr: T, columnType: TypeNameNode | undefined): T; export {};