Skip to content

Commit 4f57ada

Browse files
author
Snowflake107
committed
fix typings
1 parent 5e2fd90 commit 4f57ada

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devsnowflake/jsql",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "Use JSON as SQL.",
55
"main": "index.js",
66
"types": "typings/index.d.ts",

typings/index.d.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { AST } from 'node-sql-parser';
22

33
declare module 'jsql' {
44
export interface Handlers {
5-
create: (q: AST) => void;
6-
select: (q: AST) => any[];
7-
insert: (q: AST) => void;
8-
drop: (q: AST) => boolean;
5+
create: (q: AST, db: Database) => void;
6+
select: (q: AST, db: Database) => any[];
7+
insert: (q: AST, db: Database) => void;
8+
drop: (q: AST, db: Database) => boolean;
9+
update: (q: AST, db: Database) => void;
10+
delete: (q: AST, db: Database) => void;
911
}
1012

1113
export interface DatabasePrepare {
@@ -16,10 +18,10 @@ declare module 'jsql' {
1618

1719
export type Statement = string | AST | AST[];
1820

19-
export class SQLParser {
20-
static parse(statement: string): AST | AST[];
21-
static stringify(statement: AST | AST[]): string;
22-
static validate(statement: string): boolean;
21+
export interface SQLParser {
22+
parse: (statement: string) => AST | AST[];
23+
stringify: (statement: AST | AST[]) => string;
24+
validate: (statement: string) => boolean;
2325
}
2426

2527
export class Database {

0 commit comments

Comments
 (0)