time.d.cts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
  2. import type { ColumnBaseConfig } from "../../column.cjs";
  3. import { entityKind } from "../../entity.cjs";
  4. import type { AnyPgTable } from "../table.cjs";
  5. import { PgColumn } from "./common.cjs";
  6. import { PgDateColumnBaseBuilder } from "./date.common.cjs";
  7. import type { Precision } from "./timestamp.cjs";
  8. export type PgTimeBuilderInitial<TName extends string> = PgTimeBuilder<{
  9. name: TName;
  10. dataType: 'string';
  11. columnType: 'PgTime';
  12. data: string;
  13. driverParam: string;
  14. enumValues: undefined;
  15. }>;
  16. export declare class PgTimeBuilder<T extends ColumnBuilderBaseConfig<'string', 'PgTime'>> extends PgDateColumnBaseBuilder<T, {
  17. withTimezone: boolean;
  18. precision: number | undefined;
  19. }> {
  20. readonly withTimezone: boolean;
  21. readonly precision: number | undefined;
  22. static readonly [entityKind]: string;
  23. constructor(name: T['name'], withTimezone: boolean, precision: number | undefined);
  24. }
  25. export declare class PgTime<T extends ColumnBaseConfig<'string', 'PgTime'>> extends PgColumn<T> {
  26. static readonly [entityKind]: string;
  27. readonly withTimezone: boolean;
  28. readonly precision: number | undefined;
  29. constructor(table: AnyPgTable<{
  30. name: T['tableName'];
  31. }>, config: PgTimeBuilder<T>['config']);
  32. getSQLType(): string;
  33. }
  34. export interface TimeConfig {
  35. precision?: Precision;
  36. withTimezone?: boolean;
  37. }
  38. export declare function time(): PgTimeBuilderInitial<''>;
  39. export declare function time(config?: TimeConfig): PgTimeBuilderInitial<''>;
  40. export declare function time<TName extends string>(name: TName, config?: TimeConfig): PgTimeBuilderInitial<TName>;