Skip to content

Commit

Permalink
Add Database interface to type definitions fo fix #1180
Browse files Browse the repository at this point in the history
From PR #1865
  • Loading branch information
rendall authored Jan 26, 2024
1 parent 674b927 commit d78fb1b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions types/alasql.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,22 @@ declare module 'alasql' {
[tableName: string]: table;
}

interface Database {
databaseid: string;
dbversion: number;
tables: {[key: string]: any};
views: {[key: string]: any};
triggers: {[key: string]: any};
indices: {[key: string]: any};
objects: {[key: string]: any};
counter: number;
sqlCache: {[key: string]: any};
sqlCacheSize: number;
astCache: {[key: string]: any};
resetSqlCache: () => void;
exec: (sql: string, params?: object, cb?: Function) => any;
autoval: (tablename: string, colname: string, getNext: boolean) => any;
}
interface AlaSQL {
options: AlaSQLOptions;
error: Error;
Expand All @@ -150,6 +166,7 @@ declare module 'alasql' {
autoval(tablename: string, colname: string, getNext?: boolean): number;
yy: {};
setXLSX(xlsxlib: typeof xlsx): void;
Database: Database;

/**
* Array of databases in the AlaSQL object.
Expand Down

0 comments on commit d78fb1b

Please sign in to comment.