Skip to content

Commit

Permalink
fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
Snowflake107 committed May 6, 2021
1 parent 5e2fd90 commit 4f57ada
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devsnowflake/jsql",
"version": "1.0.2",
"version": "1.0.3",
"description": "Use JSON as SQL.",
"main": "index.js",
"types": "typings/index.d.ts",
Expand Down
18 changes: 10 additions & 8 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { AST } from 'node-sql-parser';

declare module 'jsql' {
export interface Handlers {
create: (q: AST) => void;
select: (q: AST) => any[];
insert: (q: AST) => void;
drop: (q: AST) => boolean;
create: (q: AST, db: Database) => void;
select: (q: AST, db: Database) => any[];
insert: (q: AST, db: Database) => void;
drop: (q: AST, db: Database) => boolean;
update: (q: AST, db: Database) => void;
delete: (q: AST, db: Database) => void;
}

export interface DatabasePrepare {
Expand All @@ -16,10 +18,10 @@ declare module 'jsql' {

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

export class SQLParser {
static parse(statement: string): AST | AST[];
static stringify(statement: AST | AST[]): string;
static validate(statement: string): boolean;
export interface SQLParser {
parse: (statement: string) => AST | AST[];
stringify: (statement: AST | AST[]) => string;
validate: (statement: string) => boolean;
}

export class Database {
Expand Down

0 comments on commit 4f57ada

Please sign in to comment.