diff --git a/types/promise.d.ts b/types/promise.d.ts new file mode 100644 index 0000000..0012cdf --- /dev/null +++ b/types/promise.d.ts @@ -0,0 +1,58 @@ +export = Database; +/** + * Database represents a connection that can prepare and execute SQL statements. + */ +declare class Database { + /** + * Creates a new database connection. If the database file pointed to by `path` does not exists, it will be created. + * + * @constructor + * @param {string} path - Path to the database file. + */ + constructor(path: string, opts: any); + db: any; + memory: boolean; + readonly: boolean; + name: string; + open: boolean; + sync(): void; + /** + * Prepares a SQL statement for execution. + * + * @param {string} sql - The SQL statement string to prepare. + */ + prepare(sql: string): any; + /** + * Returns a function that executes the given function in a transaction. + * + * @param {function} fn - The function to wrap in a transaction. + */ + transaction(fn: Function): (...bindParameters: any[]) => Promise; + pragma(source: any, options: any): any; + backup(filename: any, options: any): void; + serialize(options: any): void; + function(name: any, options: any, fn: any): void; + aggregate(name: any, options: any): void; + table(name: any, factory: any): void; + loadExtension(...args: any[]): void; + /** + * Executes a SQL statement. + * + * @param {string} sql - The SQL statement string to execute. + */ + exec(sql: string): any; + /** + * Closes the database connection. + */ + close(): void; + /** + * Toggle 64-bit integer support. + */ + defaultSafeIntegers(toggle: any): this; + unsafeMode(...args: any[]): void; +} +declare namespace Database { + export { SqliteError }; +} +import SqliteError = require("./sqlite-error"); +//# sourceMappingURL=promise.d.ts.map \ No newline at end of file diff --git a/types/promise.d.ts.map b/types/promise.d.ts.map new file mode 100644 index 0000000..f20d24f --- /dev/null +++ b/types/promise.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../promise.js"],"names":[],"mappings":";AAyDA;;GAEG;AACH;IACE;;;;;OAKG;IACH,kBAFW,MAAM,aAkChB;IApBG,QAA6G;IAO/G,gBAAiC;IACjC,kBAAqB;IACrB,aAAc;IACd,cAAgB;IAYlB,aAEC;IAED;;;;OAIG;IACH,aAFW,MAAM,OAQhB;IAED;;;;OAIG;IACH,sEA8BC;IAED,uCAQC;IAED,0CAEC;IAED,8BAEC;IAED,iDAqBC;IAED,yCAYC;IAED,qCAUC;IAED,oCAEC;IAED;;;;OAIG;IACH,UAFW,MAAM,OAMhB;IAED;;OAEG;IACH,cAEC;IAED;;OAEG;IACH,uCAGC;IAED,iCAEC;CACF"} \ No newline at end of file diff --git a/types/sqlite-error.d.ts b/types/sqlite-error.d.ts new file mode 100644 index 0000000..8d7bda0 --- /dev/null +++ b/types/sqlite-error.d.ts @@ -0,0 +1,9 @@ +export = SqliteError; +declare function SqliteError(message: any, code: any, rawCode: any): SqliteError; +declare class SqliteError { + constructor(message: any, code: any, rawCode: any); + code: string; + rawCode: any; + name: string; +} +//# sourceMappingURL=sqlite-error.d.ts.map \ No newline at end of file diff --git a/types/sqlite-error.d.ts.map b/types/sqlite-error.d.ts.map new file mode 100644 index 0000000..becc5e6 --- /dev/null +++ b/types/sqlite-error.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sqlite-error.d.ts","sourceRoot":"","sources":["../sqlite-error.js"],"names":[],"mappings":";AAGA,iFAaC;;IAbD,mDAaC;IAFO,aAAgB;IAChB,aAAsB"} \ No newline at end of file