-
Notifications
You must be signed in to change notification settings - Fork 168
/
generalTypes.ts
43 lines (32 loc) · 951 Bytes
/
generalTypes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import type PgLiteral from './PgLiteral';
/**
* Type that provides auto-suggestions but also any string.
*
* @see https://github.com/microsoft/TypeScript/issues/29729#issuecomment-471566609
*/
export type LiteralUnion<TSuggested extends TBase, TBase = string> =
| TSuggested
| (TBase & { zz_IGNORE_ME?: never });
export type PublicPart<T> = { [K in keyof T]: T[K] };
export type Nullable<T> = { [P in keyof T]: T[P] | null };
export type PgLiteralValue = PublicPart<PgLiteral>;
export type Value =
| null
| boolean
| string
| number
| PgLiteral
| PgLiteralValue
| Value[];
export type Type = string | { type: string };
export type Name = string | { schema?: string; name: string };
export interface IfNotExistsOption {
ifNotExists?: boolean;
}
export interface IfExistsOption {
ifExists?: boolean;
}
export interface CascadeOption {
cascade?: boolean;
}
export type DropOptions = IfExistsOption & CascadeOption;