UNPKG

935 BTypeScriptView Raw
1export type Geometry = {
2 x: number;
3 y: number;
4};
5
6export type Type = {
7 type:
8 | 'DECIMAL'
9 | 'TINY'
10 | 'SHORT'
11 | 'LONG'
12 | 'FLOAT'
13 | 'DOUBLE'
14 | 'NULL'
15 | 'TIMESTAMP'
16 | 'TIMESTAMP2'
17 | 'LONGLONG'
18 | 'INT24'
19 | 'DATE'
20 | 'TIME'
21 | 'TIME2'
22 | 'DATETIME'
23 | 'DATETIME2'
24 | 'YEAR'
25 | 'NEWDATE'
26 | 'VARCHAR'
27 | 'BIT'
28 | 'VECTOR'
29 | 'JSON'
30 | 'NEWDECIMAL'
31 | 'ENUM'
32 | 'SET'
33 | 'TINY_BLOB'
34 | 'MEDIUM_BLOB'
35 | 'LONG_BLOB'
36 | 'BLOB'
37 | 'VAR_STRING'
38 | 'STRING'
39 | 'GEOMETRY';
40};
41
42export type Field = Type & {
43 length: number;
44 db: string;
45 table: string;
46 name: string;
47 string: (encoding?: BufferEncoding | string | undefined) => string | null;
48 buffer: () => Buffer | null;
49 geometry: () => Geometry | Geometry[] | null;
50};
51
52export type Next = () => void;
53
54export type TypeCast = ((field: Field, next: Next) => any) | boolean;
55
\No newline at end of file