/
SQLite.types.js.map
1 lines (1 loc) · 2.75 KB
/
SQLite.types.js.map
1
{"version":3,"file":"SQLite.types.js","sourceRoot":"","sources":["../src/SQLite.types.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,8CAA8C;AAC9C,gDAAgD;AAChD,2DAA2D;AAC3D,EAAE;AACF,0EAA0E","sourcesContent":["// Definitions copied from `@types/websql` as we want\n// to expose a custom version of the API that:\n// - uses primitive `string` instead of `String`\n// - excludes some methods that are not exposed by our API.\n//\n// Original definitions by: TeamworkGuy2 <https://github.com/TeamworkGuy2>\n\nexport interface Window {\n openDatabase?: (\n name: string,\n version: string,\n displayName: string,\n estimatedSize: number,\n creationCallback?: DatabaseCallback\n ) => Database;\n}\n\nexport interface DatabaseCallback {\n (database: Database): void;\n}\n\nexport interface Database {\n version: string;\n\n transaction(\n callback: SQLTransactionCallback,\n errorCallback?: SQLTransactionErrorCallback,\n successCallback?: SQLVoidCallback\n ): void;\n\n readTransaction(\n callback: SQLTransactionCallback,\n errorCallback?: SQLTransactionErrorCallback,\n successCallback?: SQLVoidCallback\n ): void;\n}\n\nexport interface SQLVoidCallback {\n (): void;\n}\n\nexport interface SQLTransactionCallback {\n (transaction: SQLTransaction): void;\n}\n\nexport interface SQLTransactionErrorCallback {\n (error: SQLError): void;\n}\n\nexport interface SQLTransaction {\n executeSql(\n sqlStatement: string,\n args?: any[],\n callback?: SQLStatementCallback,\n errorCallback?: SQLStatementErrorCallback\n ): void;\n}\n\nexport interface SQLStatementCallback {\n (transaction: SQLTransaction, resultSet: SQLResultSet): void;\n}\n\nexport interface SQLStatementErrorCallback {\n (transaction: SQLTransaction, error: SQLError): boolean;\n}\n\nexport interface SQLResultSet {\n insertId: number;\n rowsAffected: number;\n rows: SQLResultSetRowList;\n}\n\nexport interface SQLResultSetRowList {\n length: number;\n item(index: number): any;\n}\n\nexport declare class SQLError {\n static UNKNOWN_ERR: number;\n static DATABASE_ERR: number;\n static VERSION_ERR: number;\n static TOO_LARGE_ERR: number;\n static QUOTA_ERR: number;\n static SYNTAX_ERR: number;\n static CONSTRAINT_ERR: number;\n static TIMEOUT_ERR: number;\n\n code: number;\n message: string;\n}\n\nexport interface WebSQLDatabase extends Database {\n exec(queries: Query[], readOnly: boolean, callback: SQLiteCallback): void;\n}\n\nexport type Query = { sql: string; args: unknown[] };\n\nexport interface ResultSetError {\n error: Error;\n}\nexport interface ResultSet {\n insertId?: number;\n rowsAffected: number;\n rows: { [column: string]: any }[];\n}\n\nexport type SQLiteCallback = (\n error?: Error | null,\n resultSet?: (ResultSetError | ResultSet)[]\n) => void;\n"]}