-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
main.d.ts
54 lines (54 loc) · 1.75 KB
/
main.d.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
44
45
46
47
48
49
50
51
52
53
54
/// <reference types="node" />
import { Knex } from "knex";
import type { Writable } from "stream";
export type Options = {
/**
* Filename or output stream where the type definitions needs to be written.
*/
output: Writable | string;
/**
* Name overrides for enums, classes, and fields.
*
* @example
* overrides: {
* "identity_provider.linkedin": "LinkedIn"
* }
*/
overrides?: Record<string, string>;
prefix?: string;
suffix?: string;
/**
* Schemas that should be included/excluded when generating types.
*
* By default if this is null/not specified, "public" will be the only schema added, but if this property
* is specified, public will be excluded by default and has to be included in the list to be added to the output.
* If a schema is added by its name, i.e. 'log' all tables from that schema will be added.
* If a schema name is added with an exclamation mark it will be ignored, i.e. "!log".
*
* The table-type will be prefixed by its schema name, the table log.message will become LogMessage.
*
* @example
* // This will include "public" and "log", but exclude the "auth" schema.
* schema: ["public", "log", "!auth"]
* @default
* "public"
*/
schema?: string[] | string;
/**
* A comma separated list or an array of tables that should be excluded when
* generating types.
*
* @example
* exclude: ["migration", "migration_lock"]
*/
exclude?: string[] | string;
};
/**
* Generates TypeScript definitions (types) from a PostgreSQL database schema.
*/
export declare function updateTypes(db: Knex, options: Options): Promise<void>;
export declare function getType(
udt: string,
customTypes: Map<string, string>,
defaultValue: string | null
): string;