Skip to content

Commit 96cb6d9

Browse files
committed
Revert formatting
1 parent 9113d9c commit 96cb6d9

File tree

2 files changed

+59
-79
lines changed

2 files changed

+59
-79
lines changed

demo/demo-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const BUILDS = new Map([
88
['asyncify', '../dist/wa-sqlite-async.mjs'],
99
['mc-asyncify', '../dist/mc-wa-sqlite-async.mjs'],
1010
['jspi', '../dist/wa-sqlite-jspi.mjs'],
11-
['mc-jspi', '../dist/mcwa-sqlite-jspi.mjs'],
11+
['mc-jspi', '../dist/mc-wa-sqlite-jspi.mjs'],
1212
// ['default', '../debug/wa-sqlite.mjs'],
1313
// ['asyncify', '../debug/wa-sqlite-async.mjs'],
1414
// ['jspi', '../debug/wa-sqlite-jspi.mjs'],

src/types/index.d.ts

Lines changed: 58 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ declare interface SQLiteVFS {
4343
/** Maximum length of a file path in UTF-8 bytes (default 64) */
4444
mxPathName?: number;
4545

46-
close(): void | Promise<void>;
47-
isReady(): boolean | Promise<boolean>;
46+
close(): void|Promise<void>;
47+
isReady(): boolean|Promise<boolean>;
4848

4949
/** @see https://sqlite.org/c3ref/io_methods.html */
50-
xClose(fileId: number): number | Promise<number>;
50+
xClose(fileId: number): number|Promise<number>;
5151

5252
/** @see https://sqlite.org/c3ref/io_methods.html */
5353
xRead(
@@ -56,7 +56,7 @@ declare interface SQLiteVFS {
5656
iAmt: number,
5757
iOffsetLo: number,
5858
iOffsetHi: number
59-
): number | Promise<number>;
59+
): number|Promise<number>;
6060

6161
/** @see https://sqlite.org/c3ref/io_methods.html */
6262
xWrite(
@@ -65,35 +65,41 @@ declare interface SQLiteVFS {
6565
iAmt: number,
6666
iOffsetLo: number,
6767
iOffsetHi: number
68-
): number | Promise<number>;
68+
): number|Promise<number>;
6969

7070
/** @see https://sqlite.org/c3ref/io_methods.html */
71-
xTruncate(fileId: number, iSizeLo: number, iSizeHi): number | Promise<number>;
71+
xTruncate(fileId: number, iSizeLo: number, iSizeHi): number|Promise<number>;
7272

7373
/** @see https://sqlite.org/c3ref/io_methods.html */
74-
xSync(fileId: number, flags: number): number | Promise<number>;
74+
xSync(fileId: number, flags: number): number|Promise<number>;
7575

7676
/** @see https://sqlite.org/c3ref/io_methods.html */
77-
xFileSize(fileId: number, pSize64: number): number | Promise<number>;
77+
xFileSize(
78+
fileId: number,
79+
pSize64: number
80+
): number|Promise<number>;
7881

7982
/** @see https://sqlite.org/c3ref/io_methods.html */
80-
xLock(fileId: number, flags: number): number | Promise<number>;
83+
xLock(fileId: number, flags: number): number|Promise<number>;
8184

8285
/** @see https://sqlite.org/c3ref/io_methods.html */
83-
xUnlock(fileId: number, flags: number): number | Promise<number>;
86+
xUnlock(fileId: number, flags: number): number|Promise<number>;
8487

8588
/** @see https://sqlite.org/c3ref/io_methods.html */
86-
xCheckReservedLock(fileId: number, pResOut: number): number | Promise<number>;
89+
xCheckReservedLock(
90+
fileId: number,
91+
pResOut: number
92+
): number|Promise<number>;
8793

8894
/** @see https://sqlite.org/c3ref/io_methods.html */
8995
xFileControl(
9096
fileId: number,
9197
flags: number,
9298
pOut: number
93-
): number | Promise<number>;
99+
): number|Promise<number>;
94100

95101
/** @see https://sqlite.org/c3ref/io_methods.html */
96-
xDeviceCharacteristics(fileId: number): number | Promise<number>;
102+
xDeviceCharacteristics(fileId: number): number|Promise<number>;
97103

98104
/** @see https://sqlite.org/c3ref/vfs.html */
99105
xOpen(
@@ -102,22 +108,18 @@ declare interface SQLiteVFS {
102108
pFile: number,
103109
flags: number,
104110
pOutFlags: number
105-
): number | Promise<number>;
111+
): number|Promise<number>;
106112

107113
/** @see https://sqlite.org/c3ref/vfs.html */
108-
xDelete(
109-
pVfs: number,
110-
zName: number,
111-
syncDir: number
112-
): number | Promise<number>;
114+
xDelete(pVfs: number, zName: number, syncDir: number): number|Promise<number>;
113115

114116
/** @see https://sqlite.org/c3ref/vfs.html */
115117
xAccess(
116118
pVfs: number,
117119
zName: number,
118120
flags: number,
119121
pResOut: number
120-
): number | Promise<number>;
122+
): number|Promise<number>;
121123
}
122124

123125
/**
@@ -474,20 +476,22 @@ declare interface SQLiteAPI {
474476

475477
/**
476478
* Register a commit hook
477-
*
479+
*
478480
* @see https://www.sqlite.org/c3ref/commit_hook.html
479481
*
480482
* @param db database pointer
481483
* @param callback If a non-zero value is returned, commit is converted into
482484
* a rollback; disables callback when null
483485
*/
484-
commit_hook(db: number, callback: (() => number) | null): void;
486+
commit_hook(
487+
db: number,
488+
callback: (() => number) | null): void;
485489

486490
/**
487491
* Create or redefine SQL functions
488-
*
492+
*
489493
* The application data passed is ignored. Use closures instead.
490-
*
494+
*
491495
* If any callback function returns a Promise, that function must
492496
* be declared `async`, i.e. it must allow use of `await`.
493497
* @see https://sqlite.org/c3ref/create_function.html
@@ -496,9 +500,9 @@ declare interface SQLiteAPI {
496500
* @param nArg number of function arguments
497501
* @param eTextRep text encoding (and other flags)
498502
* @param pApp application data (ignored)
499-
* @param xFunc
500-
* @param xStep
501-
* @param xFinal
503+
* @param xFunc
504+
* @param xStep
505+
* @param xFinal
502506
* @returns `SQLITE_OK` (throws exception on error)
503507
*/
504508
create_function(
@@ -507,10 +511,9 @@ declare interface SQLiteAPI {
507511
nArg: number,
508512
eTextRep: number,
509513
pApp: number,
510-
xFunc?: (context: number, values: Uint32Array) => void | Promise<void>,
511-
xStep?: (context: number, values: Uint32Array) => void | Promise<void>,
512-
xFinal?: (context: number) => void | Promise<void>
513-
): number;
514+
xFunc?: (context: number, values: Uint32Array) => void|Promise<void>,
515+
xStep?: (context: number, values: Uint32Array) => void|Promise<void>,
516+
xFinal?: (context: number) => void|Promise<void>): number;
514517

515518
/**
516519
* Get number of columns in current row of a prepared statement
@@ -544,7 +547,7 @@ declare interface SQLiteAPI {
544547
/**
545548
* Destroy a prepared statement object compiled by {@link statements}
546549
* with the `unscoped` option set to `true`
547-
*
550+
*
548551
* This function does *not* throw on error.
549552
* @see https://www.sqlite.org/c3ref/finalize.html
550553
* @param stmt prepared statement pointer
@@ -600,22 +603,17 @@ declare interface SQLiteAPI {
600603

601604
/**
602605
* Specify callback to be invoked between long-running queries
603-
*
606+
*
604607
* The application data passed is ignored. Use closures instead.
605-
*
608+
*
606609
* If any callback function returns a Promise, that function must
607610
* be declared `async`, i.e. it must allow use of `await`.
608611
* @param db database pointer
609612
* @param nProgressOps target number of database operations between handler invocations
610613
* @param handler
611614
* @param userData
612615
*/
613-
progress_handler(
614-
db: number,
615-
nProgressOps: number,
616-
handler: (userData: any) => number | Promise<number>,
617-
userData
618-
);
616+
progress_handler(db: number, nProgressOps: number, handler: (userData: any) => number|Promise<number>, userData);
619617

620618
/**
621619
* Reset a prepared statement object
@@ -703,17 +701,9 @@ declare interface SQLiteAPI {
703701
*/
704702
set_authorizer(
705703
db: number,
706-
authFunction: (
707-
userData: any,
708-
iActionCode: number,
709-
param3: string | null,
710-
param4: string | null,
711-
param5: string | null,
712-
param6: string | null
713-
) => number | Promise<number>,
714-
userData: any
715-
): number;
716-
704+
authFunction: (userData: any, iActionCode: number, param3: string|null, param4: string|null, param5: string|null, param6: string|null) => number|Promise<number>,
705+
userData: any): number;
706+
717707
/**
718708
* Get statement SQL
719709
* @see https://www.sqlite.org/c3ref/expanded_sql.html
@@ -724,7 +714,7 @@ declare interface SQLiteAPI {
724714

725715
/**
726716
* SQL statement iterator
727-
*
717+
*
728718
* This function manages statement compilation by creating an async
729719
* iterator that yields a prepared statement handle on each iteration.
730720
* It is typically used with a `for await` loop (in an async function),
@@ -742,29 +732,25 @@ declare interface SQLiteAPI {
742732
* // Change bindings, reset, and execute again if desired.
743733
* }
744734
* ```
745-
*
735+
*
746736
* By default, the lifetime of a yielded prepared statement is managed
747737
* automatically by the iterator, ending at the end of each iteration.
748738
* {@link finalize} should *not* be called on a statement provided by
749739
* the iterator unless the `unscoped` option is set to `true` (that
750740
* option is provided for applications that wish to manage statement
751741
* lifetimes manually).
752-
*
742+
*
753743
* If using the iterator manually, i.e. by calling its `next`
754744
* method, be sure to call the `return` method if iteration
755745
* is abandoned before completion (`for await` and other implicit
756746
* traversals provided by Javascript do this automatically)
757747
* to ensure that all allocated resources are released.
758748
* @see https://www.sqlite.org/c3ref/prepare.html
759749
* @param db database pointer
760-
* @param sql
750+
* @param sql
761751
* @param options
762752
*/
763-
statements(
764-
db: number,
765-
sql: string,
766-
options?: SQLitePrepareOptions
767-
): AsyncIterable<number>;
753+
statements(db: number, sql: string, options?: SQLitePrepareOptions): AsyncIterable<number>;
768754

769755
/**
770756
* Evaluate an SQL statement
@@ -775,9 +761,9 @@ declare interface SQLiteAPI {
775761
*/
776762
step(stmt: number): Promise<number>;
777763

778-
/**
764+
/**
779765
* Register an update hook
780-
*
766+
*
781767
* The callback is invoked whenever a row is updated, inserted, or deleted
782768
* in a rowid table on this connection.
783769
* @see https://www.sqlite.org/c3ref/update_hook.html
@@ -787,19 +773,13 @@ declare interface SQLiteAPI {
787773
* - SQLITE_INSERT: 18
788774
* - SQLITE_UPDATE: 23
789775
* @see https://www.sqlite.org/c3ref/c_alter_table.html
790-
*
776+
*
791777
* @param db database pointer
792778
* @param callback
793779
*/
794-
update_hook(
780+
update_hook(
795781
db: number,
796-
callback: (
797-
updateType: number,
798-
dbName: string | null,
799-
tblName: string | null,
800-
rowid: bigint
801-
) => void
802-
): void;
782+
callback: (updateType: number, dbName: string|null, tblName: string|null, rowid: bigint) => void): void;
803783

804784
/**
805785
* Extract a value from `sqlite3_value`
@@ -1122,8 +1102,8 @@ declare module "@journeyapps/wa-sqlite/src/sqlite-constants.js" {
11221102
export const SQLITE_PREPARE_NO_VTAB: 0x04;
11231103
}
11241104

1125-
declare module "@journeyapps/wa-sqlite" {
1126-
export * from "@journeyapps/wa-sqlite/src/sqlite-constants.js";
1105+
declare module '@journeyapps/wa-sqlite' {
1106+
export * from '@journeyapps/wa-sqlite/src/sqlite-constants.js';
11271107

11281108
/**
11291109
* @ignore
@@ -1154,13 +1134,13 @@ declare module "@journeyapps/wa-sqlite/dist/wa-sqlite-async.mjs" {
11541134
}
11551135

11561136
/** @ignore */
1157-
declare module "@journeyapps/wa-sqlite/dist/mc-wa-sqlite-async.mjs" {
1137+
declare module "@journeyapps/wa-sqlite/dist/mc-wa-sqlite.mjs" {
11581138
function ModuleFactory(config?: object): Promise<any>;
11591139
export = ModuleFactory;
11601140
}
11611141

11621142
/** @ignore */
1163-
declare module "@journeyapps/wa-sqlite/dist/mc-wa-sqlite.mjs" {
1143+
declare module "@journeyapps/wa-sqlite/dist/mc-wa-sqlite-async.mjs" {
11641144
function ModuleFactory(config?: object): Promise<any>;
11651145
export = ModuleFactory;
11661146
}
@@ -1281,7 +1261,7 @@ declare module "@journeyapps/wa-sqlite/src/VFS.js" {
12811261
}
12821262

12831263
/** @ignore */
1284-
declare module "@journeyapps/wa-sqlite/src/examples/IndexedDbVFS.js" {
1264+
declare module '@journeyapps/wa-sqlite/src/examples/IndexedDbVFS.js' {
12851265
import * as VFS from "@journeyapps/wa-sqlite/src/VFS.js";
12861266
export class IndexedDbVFS extends VFS.Base {
12871267
/**
@@ -1334,7 +1314,7 @@ declare module "@journeyapps/wa-sqlite/src/examples/IndexedDbVFS.js" {
13341314
}
13351315

13361316
/** @ignore */
1337-
declare module "@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js" {
1317+
declare module '@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js' {
13381318
import * as VFS from "@journeyapps/wa-sqlite/src/VFS.js";
13391319
export class IDBBatchAtomicVFS extends VFS.Base {
13401320
/**
@@ -1387,7 +1367,7 @@ declare module "@journeyapps/wa-sqlite/src/examples/IDBBatchAtomicVFS.js" {
13871367
}
13881368

13891369
/** @ignore */
1390-
declare module "@journeyapps/wa-sqlite/src/examples/MemoryVFS.js" {
1370+
declare module '@journeyapps/wa-sqlite/src/examples/MemoryVFS.js' {
13911371
import * as VFS from "@journeyapps/wa-sqlite/src/VFS.js";
13921372
/** @ignore */
13931373
export class MemoryVFS extends VFS.Base {

0 commit comments

Comments
 (0)