import { type Knex } from "knex"; export declare namespace CanonicalType { export enum TypeKind { Base = "base", Composite = "composite", Domain = "domain", Enum = "enum", Range = "range", Pseudo = "pseudo", Unknown = "unknown" } interface Abstract { original_type: string; canonical_name: string; schema: string; name: string; kind: TypeKind; dimensions: number; modifiers?: string; } export interface Base extends Abstract { kind: TypeKind.Base; } export interface Enum extends Abstract { kind: TypeKind.Enum; enum_values: string[]; } export interface CompositeAttribute { name: string; index: number; type: CanonicalType; comment: string | null; defaultValue: any; isNullable: boolean; /** * Whether the attribute is an identity attribute. */ isIdentity: boolean; /** * Behavior of the generated attribute. "ALWAYS" if always generated, * "NEVER" if never generated, "BY DEFAULT" if generated when a value * is not provided. */ generated: "ALWAYS" | "NEVER" | "BY DEFAULT"; } export interface Composite extends Abstract { kind: TypeKind.Composite; attributes: CompositeAttribute[]; } export interface Domain extends Abstract { kind: TypeKind.Domain; domain_base_type: { canonical_name: string; schema: string; name: string; }; } export interface Range extends Abstract { kind: TypeKind.Range; range_subtype: string | null; } export interface Pseudo extends Abstract { kind: TypeKind.Pseudo; } export {}; } export type CanonicalType = CanonicalType.Base | CanonicalType.Enum | CanonicalType.Composite | CanonicalType.Domain | CanonicalType.Range | CanonicalType.Pseudo; export declare const canonicaliseTypes: (db: Knex, types: string[]) => Promise;