bigint.d.cts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
  2. import type { ColumnBaseConfig } from "../../column.cjs";
  3. import { entityKind } from "../../entity.cjs";
  4. import { PgColumn } from "./common.cjs";
  5. import { PgIntColumnBaseBuilder } from "./int.common.cjs";
  6. export type PgBigInt53BuilderInitial<TName extends string> = PgBigInt53Builder<{
  7. name: TName;
  8. dataType: 'number';
  9. columnType: 'PgBigInt53';
  10. data: number;
  11. driverParam: number | string;
  12. enumValues: undefined;
  13. }>;
  14. export declare class PgBigInt53Builder<T extends ColumnBuilderBaseConfig<'number', 'PgBigInt53'>> extends PgIntColumnBaseBuilder<T> {
  15. static readonly [entityKind]: string;
  16. constructor(name: T['name']);
  17. }
  18. export declare class PgBigInt53<T extends ColumnBaseConfig<'number', 'PgBigInt53'>> extends PgColumn<T> {
  19. static readonly [entityKind]: string;
  20. getSQLType(): string;
  21. mapFromDriverValue(value: number | string): number;
  22. }
  23. export type PgBigInt64BuilderInitial<TName extends string> = PgBigInt64Builder<{
  24. name: TName;
  25. dataType: 'bigint';
  26. columnType: 'PgBigInt64';
  27. data: bigint;
  28. driverParam: string;
  29. enumValues: undefined;
  30. }>;
  31. export declare class PgBigInt64Builder<T extends ColumnBuilderBaseConfig<'bigint', 'PgBigInt64'>> extends PgIntColumnBaseBuilder<T> {
  32. static readonly [entityKind]: string;
  33. constructor(name: T['name']);
  34. }
  35. export declare class PgBigInt64<T extends ColumnBaseConfig<'bigint', 'PgBigInt64'>> extends PgColumn<T> {
  36. static readonly [entityKind]: string;
  37. getSQLType(): string;
  38. mapFromDriverValue(value: string): bigint;
  39. }
  40. export interface PgBigIntConfig<T extends 'number' | 'bigint' = 'number' | 'bigint'> {
  41. mode: T;
  42. }
  43. export declare function bigint<TMode extends PgBigIntConfig['mode']>(config: PgBigIntConfig<TMode>): TMode extends 'number' ? PgBigInt53BuilderInitial<''> : PgBigInt64BuilderInitial<''>;
  44. export declare function bigint<TName extends string, TMode extends PgBigIntConfig['mode']>(name: TName, config: PgBigIntConfig<TMode>): TMode extends 'number' ? PgBigInt53BuilderInitial<TName> : PgBigInt64BuilderInitial<TName>;