|
1 | 1 | declare module "promisesql"; |
2 | 2 |
|
3 | | -type DataObject = Object; |
4 | | -type DataArray = DataObject[]; |
| 3 | +export type DataObject = Object; |
| 4 | +export type DataArray = DataObject[]; |
5 | 5 |
|
6 | | -type QueryRetval = void | DataObject | DataArray; |
7 | | -type QueryPromise = Promise<QueryRetval>; |
| 6 | +export type QueryRetval = void | DataObject | DataArray; |
| 7 | +export type QueryPromise = Promise<QueryRetval>; |
8 | 8 |
|
9 | | -interface BaseOptions { |
| 9 | +export interface BaseOptions { |
10 | 10 | file?: string, |
11 | 11 | table?: string |
12 | 12 | } |
13 | 13 |
|
14 | | -interface RunOptions extends BaseOptions { |
| 14 | +export interface RunOptions extends BaseOptions { |
15 | 15 | statement: string, |
16 | 16 | args?: any[] |
17 | 17 | } |
18 | 18 |
|
19 | | -interface InsertOptions extends BaseOptions { |
| 19 | +export interface InsertOptions extends BaseOptions { |
20 | 20 | into: string, |
21 | 21 | columns?: string[], |
22 | 22 | values: string[] |
23 | 23 | } |
24 | 24 |
|
25 | | -type SelectionRetval = DataObject | DataArray; |
26 | | -type SelectionPromise = Promise<SelectionRetval>; |
| 25 | +export type SelectionRetval = DataObject | DataArray; |
| 26 | +export type SelectionPromise = Promise<SelectionRetval>; |
27 | 27 |
|
28 | | -interface SelectionOptions extends BaseOptions { |
| 28 | +export interface SelectionOptions extends BaseOptions { |
29 | 29 | first?: boolean, |
30 | 30 | all?: boolean, |
31 | 31 | columns?: string[], |
32 | 32 | from: string, |
33 | 33 | where?: (string | BooleanExpression)[] |
34 | 34 | } |
35 | 35 |
|
36 | | -interface UpdateOptions extends BaseOptions { |
| 36 | +export interface UpdateOptions extends BaseOptions { |
37 | 37 | table: string, |
38 | 38 | set: (string | BooleanExpression)[], |
39 | 39 | where?: (string | BooleanExpression)[] |
40 | 40 | } |
41 | 41 |
|
42 | | -interface DeleteOptions extends BaseOptions { |
| 42 | +export interface DeleteOptions extends BaseOptions { |
43 | 43 | from: string, |
44 | 44 | where?: (string | BooleanExpression)[] |
45 | 45 | } |
46 | 46 |
|
47 | | -interface UpsertOptions extends InsertOptions { |
| 47 | +export interface UpsertOptions extends InsertOptions { |
48 | 48 | set: (string | BooleanExpression)[], |
49 | 49 | where?: (string | BooleanExpression)[] |
50 | 50 | } |
51 | 51 |
|
52 | | -interface BooleanExpression { |
| 52 | +export interface BooleanExpression { |
53 | 53 | lhs: string, |
54 | 54 | operator: string, |
55 | 55 | rhs: string |
|
0 commit comments