/// import { Condition, Expression, Table } from '..'; import { AnyExpression } from '../expressions/any'; import { ConstraintConfig, IndexParametersConfig, ReferenceConfig } from '../functions'; import { Template } from '../template'; import { PostgresInterval } from './datetime/interval'; export * from './other/boolean'; export * from './other/string'; export * from './other/binary'; export * from './other/bytea'; export * from './other/unknown'; export * from './other/uuid'; export * from './search/tsquery'; export * from './search/tsvector'; export * from './complex/array'; export * from './complex/json'; export * from './complex/jsonb'; export * from './datetime/date'; export * from './datetime/interval'; export * from './datetime/time'; export * from './datetime/timestamp'; export * from './math'; export declare const type: (strings: TemplateStringsArray, ...literals: any[]) => Type, boolean, any>; export interface DefaultOutputMapping { UNKNOWN: Exclude extends never ? null : string; INTERVAL: PostgresInterval; ARRAY: Array; TSVECTOR: string; TSQUERY: string; UUID: string; JSON: T; JSONB: T; CHAR: string; VARCHAR: string; TEXT: string; BYTEA: Buffer; BOOLEAN: boolean; BIT: string; VARBIT: string; SMALLINT: number; INTEGER: number; BIGINT: bigint; NUMERIC: number; REAL: number; DOUBLE: number; TIMESTAMP: Date; TIMESTAMPTZ: Date; TIME: string; TIMETZ: string; DATE: Date; NULL: null; } export interface DefaultInputMapping { UNKNOWN: any; INTERVAL: string; ARRAY: Array | string; TSVECTOR: string; TSQUERY: string; UUID: string; JSON: T | string; JSONB: T | string; CHAR: string; VARCHAR: string; TEXT: string; BYTEA: Buffer | string; BOOLEAN: boolean; BIT: string; VARBIT: string; SMALLINT: number | string | bigint; INTEGER: number | string | bigint; BIGINT: number | string | bigint; NUMERIC: number | string | bigint; REAL: number | string | bigint; DOUBLE: number | string | bigint; TIMESTAMP: Date | string; TIMESTAMPTZ: Date | string; TIME: string; TIMETZ: string; DATE: Date | string; NULL: null; } export interface OverrideOutputMapping { [key: string]: unknown; } export interface OverrideInputMapping { [key: string]: unknown; } export declare type OutputMapping = { [K in keyof DefaultOutputMapping]: unknown extends OverrideOutputMapping[K] ? DefaultOutputMapping[K] : OverrideOutputMapping[K]; }; export declare type InputMapping = { [K in keyof DefaultInputMapping]: unknown extends OverrideInputMapping[K] ? DefaultInputMapping[K] : OverrideInputMapping[K]; }; export declare class Type extends Template { primitive: this['nullable'] extends false ? this['output'] : this['output'] | null; constraints: Template[]; output: OutputMapping[N]; expression: AnyExpression; nullable: R; input: InputMapping[N]; argument: any; type: T; required(conf?: ConstraintConfig): Type; default(value: any, conf?: ConstraintConfig): this; check(expression: Condition, conf?: ConstraintConfig & { noInherit?: boolean; }): this; generated(type: 'ALWAYS' | 'BY DEFAULT', conf?: ConstraintConfig & { expression?: Expression; identity?: any; }): this; unique(params?: IndexParametersConfig & ConstraintConfig): this; primary(params?: IndexParametersConfig & ConstraintConfig): this; references(table: string | Table, conf?: ReferenceConfig & ConstraintConfig): this; }