Skip to content

Commit b9c2b60

Browse files
committed
ts updates
1 parent 3065a66 commit b9c2b60

File tree

2 files changed

+56
-65
lines changed

2 files changed

+56
-65
lines changed

index.d.ts

Lines changed: 55 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,56 @@
1-
declare module "promisesql";
2-
3-
export type DataObject = Object;
4-
export type DataArray = DataObject[];
5-
6-
export type QueryRetval = void | DataObject | DataArray;
7-
export type QueryPromise = Promise<QueryRetval>;
8-
9-
export interface BaseOptions {
10-
file?: string,
11-
table?: string
12-
}
13-
14-
export interface RunOptions extends BaseOptions {
15-
statement: string,
16-
args?: any[]
17-
}
18-
19-
export interface InsertOptions extends BaseOptions {
20-
into: string,
21-
columns?: string[],
22-
values: string[]
23-
}
24-
25-
export type SelectionRetval = DataObject | DataArray;
26-
export type SelectionPromise = Promise<SelectionRetval>;
27-
28-
export interface SelectionOptions extends BaseOptions {
29-
first?: boolean,
30-
all?: boolean,
31-
columns?: string[],
32-
from: string,
33-
where?: (string | BooleanExpression)[]
1+
declare module "promisesql" {
2+
export type DataObject = Object;
3+
export type DataArray = DataObject[];
4+
5+
export type QueryRetval = void | DataObject | DataArray;
6+
export type QueryPromise = Promise<QueryRetval>;
7+
8+
export interface BaseOptions {
9+
file?: string,
10+
table?: string
11+
}
12+
13+
export interface RunOptions extends BaseOptions {
14+
statement: string,
15+
args?: any[]
16+
}
17+
18+
export interface InsertOptions extends BaseOptions {
19+
into: string,
20+
columns?: string[],
21+
values: string[]
22+
}
23+
24+
export type SelectionRetval = DataObject | DataArray;
25+
export type SelectionPromise = Promise<SelectionRetval>;
26+
27+
export interface SelectionOptions extends BaseOptions {
28+
first?: boolean,
29+
all?: boolean,
30+
columns?: string[],
31+
from: string,
32+
where?: (string | BooleanExpression)[]
33+
}
34+
35+
export interface UpdateOptions extends BaseOptions {
36+
table: string,
37+
set: (string | BooleanExpression)[],
38+
where?: (string | BooleanExpression)[]
39+
}
40+
41+
export interface DeleteOptions extends BaseOptions {
42+
from: string,
43+
where?: (string | BooleanExpression)[]
44+
}
45+
46+
export interface UpsertOptions extends InsertOptions {
47+
set: (string | BooleanExpression)[],
48+
where?: (string | BooleanExpression)[]
49+
}
50+
51+
export interface BooleanExpression {
52+
lhs: string,
53+
operator: string,
54+
rhs: string
55+
}
3456
}
35-
36-
export interface UpdateOptions extends BaseOptions {
37-
table: string,
38-
set: (string | BooleanExpression)[],
39-
where?: (string | BooleanExpression)[]
40-
}
41-
42-
export interface DeleteOptions extends BaseOptions {
43-
from: string,
44-
where?: (string | BooleanExpression)[]
45-
}
46-
47-
export interface UpsertOptions extends InsertOptions {
48-
set: (string | BooleanExpression)[],
49-
where?: (string | BooleanExpression)[]
50-
}
51-
52-
export interface BooleanExpression {
53-
lhs: string,
54-
operator: string,
55-
rhs: string
56-
}
57-
58-
interface Datatype {
59-
name: string,
60-
notnull?: boolean,
61-
unique?: boolean,
62-
primaryKey?: boolean,
63-
check?: string,
64-
default?: string
65-
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
3838

3939
/* JavaScript Support */
40-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
40+
"allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */
4141
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
4242
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */
4343

0 commit comments

Comments
 (0)