From d78fb1b5125e45c3bfa239a0eb61ef5d13a03fc8 Mon Sep 17 00:00:00 2001 From: Rendall Date: Fri, 26 Jan 2024 22:34:20 +0200 Subject: [PATCH] Add Database interface to type definitions fo fix #1180 From PR #1865 --- types/alasql.d.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/types/alasql.d.ts b/types/alasql.d.ts index c93392d9c7..cc2c7822c1 100644 --- a/types/alasql.d.ts +++ b/types/alasql.d.ts @@ -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; @@ -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.