indexeddbshim 18.0.0 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/DOMException.d.ts +3 -7
  2. package/dist/DOMException.d.ts.map +1 -1
  3. package/dist/DOMStringList.d.ts +1 -2
  4. package/dist/DOMStringList.d.ts.map +1 -1
  5. package/dist/IDBCursor.d.ts +100 -52
  6. package/dist/IDBCursor.d.ts.map +1 -1
  7. package/dist/IDBFactory.d.ts.map +1 -1
  8. package/dist/IDBIndex.d.ts +8 -7
  9. package/dist/IDBIndex.d.ts.map +1 -1
  10. package/dist/IDBKeyRange.d.ts +3 -3
  11. package/dist/IDBKeyRange.d.ts.map +1 -1
  12. package/dist/IDBObjectStore.d.ts +12 -12
  13. package/dist/IDBObjectStore.d.ts.map +1 -1
  14. package/dist/IDBRequest.d.ts +2 -2
  15. package/dist/IDBRequest.d.ts.map +1 -1
  16. package/dist/IDBTransaction.d.ts +13 -13
  17. package/dist/IDBTransaction.d.ts.map +1 -1
  18. package/dist/Key.d.ts +14 -15
  19. package/dist/Key.d.ts.map +1 -1
  20. package/dist/Sca.d.ts +2 -2
  21. package/dist/Sca.d.ts.map +1 -1
  22. package/dist/cmp.d.ts +3 -3
  23. package/dist/cmp.d.ts.map +1 -1
  24. package/dist/indexeddbshim-Key.js +36 -45
  25. package/dist/indexeddbshim-Key.js.map +1 -1
  26. package/dist/indexeddbshim-Key.min.js +2 -2
  27. package/dist/indexeddbshim-Key.min.js.map +1 -1
  28. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +224 -208
  29. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
  30. package/dist/indexeddbshim-UnicodeIdentifiers.js +221 -235
  31. package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
  32. package/dist/indexeddbshim-UnicodeIdentifiers.min.js +3 -3
  33. package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
  34. package/dist/indexeddbshim-node.cjs +224 -208
  35. package/dist/indexeddbshim-node.cjs.map +1 -1
  36. package/dist/indexeddbshim-noninvasive.js +221 -235
  37. package/dist/indexeddbshim-noninvasive.js.map +1 -1
  38. package/dist/indexeddbshim-noninvasive.min.js +3 -3
  39. package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
  40. package/dist/indexeddbshim.js +221 -235
  41. package/dist/indexeddbshim.js.map +1 -1
  42. package/dist/indexeddbshim.min.js +3 -3
  43. package/dist/indexeddbshim.min.js.map +1 -1
  44. package/dist/nodeWebSQL.d.ts +2 -2
  45. package/dist/nodeWebSQL.d.ts.map +1 -1
  46. package/dist/setGlobalVars.d.ts +1 -2
  47. package/dist/setGlobalVars.d.ts.map +1 -1
  48. package/dist/util.d.ts +20 -22
  49. package/dist/util.d.ts.map +1 -1
  50. package/package.json +1 -1
  51. package/src/CFG.js +1 -1
  52. package/src/DOMException.js +8 -10
  53. package/src/DOMStringList.js +6 -11
  54. package/src/Event.js +1 -4
  55. package/src/IDBCursor.js +95 -47
  56. package/src/IDBFactory.js +8 -5
  57. package/src/IDBIndex.js +10 -12
  58. package/src/IDBKeyRange.js +6 -5
  59. package/src/IDBObjectStore.js +32 -27
  60. package/src/IDBRequest.js +1 -1
  61. package/src/IDBTransaction.js +11 -11
  62. package/src/IDBVersionChangeEvent.js +1 -4
  63. package/src/Key.js +32 -31
  64. package/src/Sca.js +1 -1
  65. package/src/cmp.js +2 -2
  66. package/src/nodeWebSQL.js +5 -2
  67. package/src/setGlobalVars.js +8 -19
  68. package/src/util.js +19 -16
@@ -1,6 +1,6 @@
1
1
  export default nodeWebSQL;
2
2
  export type SQLiteDatabaseInstance = {
3
- _db: any;
3
+ _db: unknown;
4
4
  exec: (typeof SQLiteDatabase)["prototype"]["exec"];
5
5
  };
6
6
  /**
@@ -13,7 +13,7 @@ export type SQLiteDatabaseInstance = {
13
13
  * the default "return `this`" behavior), not something TypeScript can
14
14
  * verify structurally.
15
15
  */
16
- export type SQLiteDatabaseConstructor = new (name: string, opts?: any) => SQLiteDatabaseInstance;
16
+ export type SQLiteDatabaseConstructor = new (name: string, opts?: import("websql-configurable/lib/sqlite/SQLiteDatabase.js").SQLiteDatabaseOptions) => SQLiteDatabaseInstance;
17
17
  declare const nodeWebSQL: (...args: unknown[]) => import("websql-configurable/lib/websql/WebSQLDatabase.js").default;
18
18
  import SQLiteDatabase from 'websql-configurable/lib/sqlite/SQLiteDatabase.js';
19
19
  //# sourceMappingURL=nodeWebSQL.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodeWebSQL.d.ts","sourceRoot":"","sources":["../src/nodeWebSQL.js"],"names":[],"mappings":";qCAKa;IACR,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,EAAE,CAAA,OAAO,cAAc,EAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;CACjD;;;;;;;;;;;wCAYS,KAAK,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,sBAAsB;AAgCrE,qHAAsK;2BAnD3I,kDAAkD"}
1
+ {"version":3,"file":"nodeWebSQL.d.ts","sourceRoot":"","sources":["../src/nodeWebSQL.js"],"names":[],"mappings":";qCAKa;IACR,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,CAAA,OAAO,cAAc,EAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;CACjD;;;;;;;;;;;wCAYS,KACR,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,OAAO,kDAAkD,EAAE,qBAAqB,KACpF,sBAAsB;AAgC9B,qHAAsK;2BAtD3I,kDAAkD"}
@@ -1,7 +1,6 @@
1
1
  export { createDOMException };
2
2
  export default setGlobalVars;
3
- export type AnyValue = any;
4
- export type SetConfig = (prop: import("./CFG.js").KeyofConfigValues | Partial<import("./CFG.js").ConfigValues>, val?: AnyValue) => any;
3
+ export type SetConfig = (prop: import("./CFG.js").KeyofConfigValues | Partial<import("./CFG.js").ConfigValues>, val?: import("./CFG.js").ConfigValue | undefined) => any;
5
4
  export type GetConfig = (prop: import("./CFG.js").KeyofConfigValues) => import("./CFG.js").ConfigValue;
6
5
  export type SetUnicodeIdentifiers = (cfg: {
7
6
  UnicodeIDStart: string;
@@ -1 +1 @@
1
- {"version":3,"file":"setGlobalVars.d.ts","sourceRoot":"","sources":["../src/setGlobalVars.js"],"names":[],"mappings":";;uBAkBa,GAAG;+BAKL,OAAO,UAAU,EAAE,iBAAiB,GAC1C,OAAO,CAAC,OAAO,UAAU,EAAE,YAAY,CAAC,QAClC,QAAQ;wBAoCN,CACR,IAAI,EAAE,OAAO,UAAU,EAAE,iBAAiB,KACvC,OAAO,UAAU,EAAE,WAAW;oCAIzB,CAAC,GAAG,EAAE;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,KAAK,IAAI;4BAIA,CAAC,UAAU,GAAC,MAAM,CAAC,GAAG;IAC5B,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAChC,WAAW,EAAE,SAAS,CAAC;IACvB,WAAW,EAAE,SAAS,CAAC;IACvB,uBAAuB,EAAE,qBAAqB,CAAC;IAC/C,0BAA0B,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CACtD;sBAIO,MAAM;4BAIN,CAAC,OAAO,UAAU,GAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG;IACtD,SAAS,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAChC,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,WAAW,EAAE,OAAO,WAAW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U,EAAE,OAAO,UAAU,CAAC;IAC9B,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;mCA5F+C,mBAAmB;AAoDtE;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;;;;;;;GASG;AAEH;;GAEG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;;GAKG;AACH,qCAJW,OAAO,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,kBAC3C,OAAO,CAAC,OAAO,UAAU,EAAE,YAAY,CAAC,GACtC,aAAa,CA0SzB;2BA5Y8C,iBAAiB"}
package/dist/util.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export type Integer = number;
2
- export type AnyClass = Function;
3
- export type AnyValue = any;
2
+ export type AnyClass = {
3
+ [Symbol.hasInstance]: (value: unknown) => boolean;
4
+ };
5
+ export type AnyValue = unknown;
4
6
  /**
5
7
  * The escaping of unmatched surrogates was needed by Chrome but not Node.
6
8
  * @param {string} arg
@@ -66,7 +68,7 @@ export function sqlQuote(arg: string): string;
66
68
  */
67
69
  export function joinPath(base: string, name: string): string;
68
70
  /**
69
- * @typedef {Function} AnyClass
71
+ * @typedef {{[Symbol.hasInstance]: (value: unknown) => boolean}} AnyClass
70
72
  */
71
73
  /**
72
74
  *
@@ -83,28 +85,28 @@ export function instanceOf(obj: AnyValue, Clss: AnyClass): boolean;
83
85
  export function isObj(obj: AnyValue): obj is object;
84
86
  /**
85
87
  *
86
- * @param {object} obj
88
+ * @param {AnyValue} obj
87
89
  * @returns {boolean}
88
90
  */
89
- export function isDate(obj: object): boolean;
91
+ export function isDate(obj: AnyValue): boolean;
90
92
  /**
91
93
  *
92
- * @param {object} obj
94
+ * @param {AnyValue} obj
93
95
  * @returns {boolean}
94
96
  */
95
- export function isBlob(obj: object): boolean;
97
+ export function isBlob(obj: AnyValue): boolean;
96
98
  /**
97
99
  *
98
- * @param {object} obj
100
+ * @param {AnyValue} obj
99
101
  * @returns {boolean}
100
102
  */
101
- export function isRegExp(obj: object): boolean;
103
+ export function isRegExp(obj: AnyValue): boolean;
102
104
  /**
103
105
  *
104
- * @param {object} obj
106
+ * @param {AnyValue} obj
105
107
  * @returns {boolean}
106
108
  */
107
- export function isFile(obj: object): boolean;
109
+ export function isFile(obj: AnyValue): boolean;
108
110
  /**
109
111
  *
110
112
  * @param {AnyValue} obj
@@ -114,9 +116,9 @@ export function isBinary(obj: AnyValue): boolean;
114
116
  /**
115
117
  *
116
118
  * @param {AnyValue} obj
117
- * @returns {boolean}
119
+ * @returns {obj is Iterable<unknown>}
118
120
  */
119
- export function isIterable(obj: AnyValue): boolean;
121
+ export function isIterable(obj: AnyValue): obj is Iterable<unknown>;
120
122
  /**
121
123
  *
122
124
  * @param {object} obj
@@ -133,26 +135,22 @@ export function defineOuterInterface(obj: object, props: string[]): void;
133
135
  export function defineReadonlyOuterInterface(obj: object, props: string[]): void;
134
136
  /**
135
137
  *
136
- * @param {object & {
137
- * [key: string]: any
138
- * }} obj
138
+ * @param {object} obj
139
139
  * @param {string[]} listeners
140
140
  * @returns {void}
141
141
  */
142
- export function defineListenerProperties(obj: object & {
143
- [key: string]: any;
144
- }, listeners: string[]): void;
142
+ export function defineListenerProperties(obj: object, listeners: string[]): void;
145
143
  /**
146
144
  *
147
145
  * @param {object} obj
148
146
  * @param {string|string[]} props
149
147
  * @param {null|{
150
- * [key: string]: any
148
+ * [key: string]: unknown
151
149
  * }} getter
152
150
  * @returns {void}
153
151
  */
154
152
  export function defineReadonlyProperties(obj: object, props: string | string[], getter?: null | {
155
- [key: string]: any;
153
+ [key: string]: unknown;
156
154
  }): void;
157
155
  /**
158
156
  * `X.prototype.method = function (...) {}` (an assignment to a
@@ -183,7 +181,7 @@ export function isValidKeyPath(keyPath: string | string[]): boolean;
183
181
  */
184
182
  export function enforceRange(number: number, type: "unsigned long long" | "unsigned long"): number;
185
183
  /**
186
- * @typedef {any} AnyValue
184
+ * @typedef {unknown} AnyValue
187
185
  */
188
186
  /**
189
187
  * @param {AnyValue} v
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.js"],"names":[],"mappings":"sBAKa,MAAM;;uBA8iBN,GAAG;AApgBhB;;;;GAIG;AACH,2CAHW,MAAM,GACJ,MAAM,CASlB;AAED;;;GAGG;AACH,4CAHW,MAAM,GACJ,MAAM,CAclB;AAuBD;;;;GAIG;AACH,qDAJW,MAAM,GAEJ,MAAM,CAoClB;AAmBD;;;;GAIG;AACH,uDAHW,MAAM,GACJ,MAAM,CAkClB;AAED;;;GAGG;AACH,6CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;GAGG;AACH,6CAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;GAGG;AACH,sDAHW,MAAM,GACJ,MAAM,CAIlB;AAED;;;;GAIG;AACH,mCAHW,MAAM,GACJ,MAAM,CAKlB;AAzID;;;GAGG;AACH,8BAHW,MAAM,GACJ,MAAM,CAIlB;AAqID;;;;;;;;;;;;;GAaG;AACH,+BAJW,MAAM,QACN,MAAM,GACJ,MAAM,CAQlB;AAED;;GAEG;AAGH;;;;;GAKG;AACH,gCAJW,QAAQ,QACR,QAAQ,GACN,OAAO,CAInB;AAED;;;;GAIG;AACH,2BAHW,QAAQ,GACN,GAAG,IAAI,MAAM,CAIzB;AAED;;;;GAIG;AACH,4BAHW,MAAM,GACJ,OAAO,CAInB;AAED;;;;GAIG;AACH,4BAHW,MAAM,GACJ,OAAO,CAKnB;AAED;;;;GAIG;AACH,8BAHW,MAAM,GACJ,OAAO,CAKnB;AAED;;;;GAIG;AACH,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AAI,CA0BhB;AAED;;;;;;;;GAQG;AACH,8CAPW,MAAM,SACN,MAAM,GAAC,MAAM,EAAE,WACf,IAAI,GAAC;IACf,CAAK,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB,GACS,IAAI,CA8BhB;AAED;;;;;;;;;;;;;GAaG;AACH,uCAHW,MAAM,GACJ,IAAI,CAchB;AAgCD;;;;GAIG;AACH,wCAHW,MAAM,GAAC,MAAM,EAAE,GACb,OAAO,CAWnB;AAED;;;;;GAKG;AACH,qCALW,MAAM,QACN,oBAAoB,GAAC,eAAe,GAElC,MAAM,CAyBlB;AAED;;GAEG;AAEH;;;;GAIG;AACH,sCAJW,QAAQ,gBACR,OAAO,GACL,MAAM,CAIlB;AAcD;;;;GAIG;AACH,gDAHW,QAAQ,GACN,MAAM,GAAC,MAAM,EAAE,CAW3B;AAED;;;GAGG;AACH,6BAHW,QAAQ,GACN,CAAC,IAAI,IAAI,GAAC,SAAS,CAI/B;AA6BD;;;GAGG;AACH,0CAHW,MAAM,IAAI,GACR,IAAI,CAmBhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "indexeddbshim",
3
- "version": "18.0.0",
3
+ "version": "19.0.0",
4
4
  "type": "module",
5
5
  "author": "Parashuram <code@nparashuram.com>",
6
6
  "contributors": [
package/src/CFG.js CHANGED
@@ -224,7 +224,7 @@ const CFG = /** @type {ConfigValues} */ ({});
224
224
  'sqlMemoryQuota',
225
225
  'createIndexes'
226
226
  ]).forEach((prop) => {
227
- /** @type {(val: any) => void} */
227
+ /** @type {(val: ConfigValue) => void} */
228
228
  let validator;
229
229
  if (Array.isArray(prop)) {
230
230
  [prop, validator] = prop;
@@ -286,24 +286,21 @@ function logError (name, message, error) {
286
286
  }
287
287
 
288
288
  /**
289
- * @typedef {any} ArbitraryValue
290
- */
291
-
292
- /**
293
- * @param {ArbitraryValue} obj
289
+ * @param {unknown} obj
294
290
  * @returns {boolean}
295
291
  */
296
292
  function isErrorOrDOMErrorOrDOMException (obj) {
297
- return obj && typeof obj === 'object' && // We don't use util.isObj here as mutual dependency causing problems in Babel with browser
298
- typeof obj.name === 'string';
293
+ // We don't use util.isObj here as mutual dependency causing problems in Babel with browser
294
+ return typeof obj === 'object' && obj !== null &&
295
+ 'name' in obj && typeof obj.name === 'string';
299
296
  }
300
297
 
301
298
  /**
302
299
  * Finds the error argument. This is useful because some WebSQL callbacks
303
300
  * pass the error as the first argument, and some pass it as the second
304
301
  * argument.
305
- * @param {(Error|{message?: string, name?: string}|any)[]} args
306
- * @returns {Error|DOMException|undefined}
302
+ * @param {unknown[]} args
303
+ * @returns {unknown}
307
304
  */
308
305
  function findError (args) {
309
306
  let err;
@@ -315,7 +312,8 @@ function findError (args) {
315
312
  if (isErrorOrDOMErrorOrDOMException(arg)) {
316
313
  return arg;
317
314
  }
318
- if (arg && typeof arg.message === 'string') {
315
+ if (typeof arg === 'object' && arg !== null &&
316
+ 'message' in arg && typeof arg.message === 'string') {
319
317
  err = arg;
320
318
  }
321
319
  }
@@ -13,7 +13,7 @@
13
13
  * clone: () => DOMStringListFull,
14
14
  * contains: (str: string) => boolean,
15
15
  * indexOf: (str: string) => Integer,
16
- * splice: (index: Integer, howmany: Integer, ...args: any) => void
16
+ * splice: (index: Integer, howmany: Integer, ...args: string[]) => void
17
17
  * length: Integer
18
18
  * }} DOMStringListFull
19
19
  */
@@ -129,9 +129,10 @@ DOMStringList.prototype = {
129
129
  },
130
130
  /**
131
131
  * @this {DOMStringListFull}
132
- * @param {(value: string, i: Integer, arr: string[]) => any[]} cb
132
+ * @template T
133
+ * @param {(value: string, i: Integer, arr: string[]) => T} cb
133
134
  * @param {object} thisArg
134
- * @returns {any[]}
135
+ * @returns {T[]}
135
136
  */
136
137
  map (cb, thisArg) {
137
138
  // eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument -- Convenient
@@ -156,10 +157,7 @@ DOMStringList.prototype = {
156
157
  this.sortList();
157
158
  },
158
159
  /**
159
- * @typedef {any} AnyArgs
160
- */
161
- /**
162
- * @param {[index: Integer, howmany: Integer, ...args: any]} args
160
+ * @param {[index: Integer, howmany: Integer, ...args: string[]]} args
163
161
  * @this {DOMStringListFull}
164
162
  * @returns {void}
165
163
  */
@@ -193,12 +191,9 @@ DOMStringList.prototype = {
193
191
  };
194
192
 
195
193
  /* eslint-disable unicorn/no-top-level-side-effects -- Would be good */
196
- /**
197
- * @typedef {any} AnyValue
198
- */
199
194
  Object.defineProperty(DOMStringList, Symbol.hasInstance, {
200
195
  /**
201
- * @param {AnyValue} obj
196
+ * @param {unknown} obj
202
197
  * @returns {boolean}
203
198
  */
204
199
  value (obj) {
package/src/Event.js CHANGED
@@ -30,12 +30,9 @@ function createEvent (type, debug, evInit) {
30
30
  // We don't add within polyfill repo as might not always be the desired implementation
31
31
  Object.defineProperty(ShimEvent, Symbol.hasInstance, {
32
32
  /* eslint-enable unicorn/no-top-level-side-effects -- Would be good */
33
- /**
34
- * @typedef {any} AnyValue
35
- */
36
33
  value:
37
34
  /**
38
- * @param {AnyValue} obj
35
+ * @param {unknown} obj
39
36
  * @returns {boolean}
40
37
  */
41
38
  (obj) => util.isObj(obj) && 'target' in obj && 'bubbles' in obj && typeof obj.bubbles === 'boolean'
package/src/IDBCursor.js CHANGED
@@ -23,16 +23,16 @@ const cursorDirections = ['next', 'prev', 'nextunique', 'prevunique'];
23
23
 
24
24
  /**
25
25
  * @typedef {IDBCursor & {
26
- * primaryKey: import('./Key.js').Key,
27
- * key: import('./Key.js').Key,
26
+ * primaryKey: import('./Key.js').Key|null|undefined,
27
+ * key: import('./Key.js').Key|null|undefined,
28
28
  * direction: string,
29
29
  * source: import('./IDBObjectStore.js').IDBObjectStoreFull|
30
30
  * import('./IDBIndex.js').IDBIndexFull,
31
31
  * __request: import('./IDBRequest.js').IDBRequestFull,
32
32
  * __advanceCount: Integer|undefined,
33
33
  * __indexSource: boolean,
34
- * __key: import('./Key.js').Key,
35
- * __primaryKey: import('./Key.js').Key,
34
+ * __key: import('./Key.js').Key|null|undefined,
35
+ * __primaryKey: import('./Key.js').Key|null|undefined,
36
36
  * __value: import('./Key.js').Value,
37
37
  * __store: import('./IDBObjectStore.js').IDBObjectStoreFull,
38
38
  * __range: import('./IDBKeyRange.js').IDBKeyRangeFull|undefined,
@@ -40,13 +40,13 @@ const cursorDirections = ['next', 'prev', 'nextunique', 'prevunique'];
40
40
  * __valueColumnName: string,
41
41
  * __keyOnly: boolean,
42
42
  * __valueDecoder: {
43
- * decode: (str: string) => any,
43
+ * decode: (str: string) => import('./Key.js').Value,
44
44
  * },
45
45
  * __count: boolean,
46
46
  * __prefetchedIndex: Integer,
47
47
  * __prefetchedData: null|{
48
48
  * length: number;
49
- * item(index: number): any;
49
+ * item(index: number): unknown;
50
50
  * }|{
51
51
  * data: RowItemNonNull[],
52
52
  * length: Integer,
@@ -61,7 +61,14 @@ const cursorDirections = ['next', 'prev', 'nextunique', 'prevunique'];
61
61
  * __multiEntryExhausted: boolean,
62
62
  * __invalidateCache: () => void,
63
63
  * __gotValue: boolean,
64
- * __find: (...args: any[]) => void,
64
+ * __find: (
65
+ * key: import('./Key.js').Key|undefined,
66
+ * primaryKey: import('./Key.js').Key|undefined,
67
+ * tx: WebSQLTransaction,
68
+ * success: KeySuccess,
69
+ * error: FindError,
70
+ * recordsToLoad?: Integer
71
+ * ) => void,
65
72
  * __findBasic: (
66
73
  * key: import('./Key.js').Key|undefined,
67
74
  * primaryKey: import('./Key.js').Key|undefined,
@@ -82,17 +89,17 @@ const cursorDirections = ['next', 'prev', 'nextunique', 'prevunique'];
82
89
  * __decode: (
83
90
  * rowItem: RowItemNonNull,
84
91
  * callback: (
85
- * key: import('./Key.js').Key,
92
+ * key: import('./Key.js').Key|undefined,
86
93
  * val: import('./Key.js').Value,
87
- * primaryKey: import('./Key.js').Key,
94
+ * primaryKey: import('./Key.js').Key|undefined,
88
95
  * encKey?: string
89
96
  * ) => void
90
97
  * ) => void,
91
98
  * __sourceOrEffectiveObjStoreDeleted: () => void,
92
99
  * __continue: (key?: import('./Key.js').Key, advanceContinue?: boolean) => void,
93
100
  * __continueFinish: (
94
- * key: import('./Key.js').Key,
95
- * primaryKey: import('./Key.js').Key,
101
+ * key: import('./Key.js').Key|undefined,
102
+ * primaryKey: import('./Key.js').Key|undefined,
96
103
  * advanceState: boolean
97
104
  * ) => void
98
105
  * }} IDBCursorFull
@@ -125,7 +132,7 @@ const IDBCursorAlias = IDBCursor;
125
132
  * import('./IDBIndex.js').IDBIndexFull} source
126
133
  * @param {string} keyColumnName
127
134
  * @param {string} valueColumnName
128
- * @param {boolean} count
135
+ * @param {boolean} [count]
129
136
  * @this {IDBCursorFull}
130
137
  * @returns {void}
131
138
  */
@@ -164,7 +171,7 @@ IDBCursor.__super = function IDBCursor (query, direction, store, source, keyColu
164
171
  this.__valueColumnName = valueColumnName;
165
172
  this.__keyOnly = valueColumnName === 'key';
166
173
  this.__valueDecoder = this.__keyOnly ? Key : Sca;
167
- this.__count = count;
174
+ this.__count = Boolean(count);
168
175
  this.__prefetchedIndex = -1;
169
176
  this.__continuationKey = undefined;
170
177
  this.__continuationPrimaryKey = undefined;
@@ -186,25 +193,38 @@ IDBCursor.__super = function IDBCursor (query, direction, store, source, keyColu
186
193
 
187
194
  /**
188
195
  *
189
- * @param {...any} args
196
+ * @param {IDBKeyRange} query
197
+ * @param {string} direction
198
+ * @param {import('./IDBObjectStore.js').IDBObjectStoreFull} store
199
+ * @param {import('./IDBObjectStore.js').IDBObjectStoreFull|
200
+ * import('./IDBIndex.js').IDBIndexFull} source
201
+ * @param {string} keyColumnName
202
+ * @param {string} valueColumnName
203
+ * @param {boolean} [count]
190
204
  * @returns {IDBCursorFull}
191
205
  */
192
- IDBCursor.__createInstance = function (...args) {
206
+ IDBCursor.__createInstance = function (query, direction, store, source, keyColumnName, valueColumnName, count) {
193
207
  const IDBCursor = IDBCursorAlias.__super;
194
208
  IDBCursor.prototype = IDBCursorAlias.prototype;
195
209
 
196
210
  // @ts-expect-error It's ok
197
- return new IDBCursor(...args);
211
+ return new IDBCursor(
212
+ query, direction, store, source, keyColumnName, valueColumnName, count
213
+ );
198
214
  };
199
215
 
200
216
  /**
201
217
  *
202
- * @param {...any} args
218
+ * @param {import('./Key.js').Key|undefined} key
219
+ * @param {import('./Key.js').Key|undefined} primaryKey
220
+ * @param {WebSQLTransaction} tx
221
+ * @param {KeySuccess} success
222
+ * @param {FindError} error
223
+ * @param {Integer} [recordsToLoad]
203
224
  * @this {IDBCursorFull}
204
225
  * @returns {void}
205
226
  */
206
- IDBCursor.prototype.__find = function (...args /* key, tx, success, error, recordsToLoad */) {
207
- const [key, primaryKey, tx, success, error, recordsToLoad] = args;
227
+ IDBCursor.prototype.__find = function (key, primaryKey, tx, success, error, recordsToLoad) {
208
228
  if (this.__multiEntryIndex) {
209
229
  this.__findMultiEntry(key, primaryKey, tx, success, error, recordsToLoad);
210
230
  } else {
@@ -214,9 +234,9 @@ IDBCursor.prototype.__find = function (...args /* key, tx, success, error, recor
214
234
 
215
235
  /**
216
236
  * @typedef {(
217
- * k: import('./Key.js').Key,
237
+ * k: import('./Key.js').Key|undefined,
218
238
  * val: import('./Key.js').Value,
219
- * primKey: import('./Key.js').Key
239
+ * primKey: import('./Key.js').Key|undefined
220
240
  * ) => void} KeySuccess
221
241
  */
222
242
 
@@ -322,7 +342,7 @@ IDBCursor.prototype.__findBasic = function (key, primaryKey, tx, success, error,
322
342
  } else if (data.rows.length > 1) {
323
343
  me.__prefetchedIndex = 0;
324
344
  me.__prefetchedData = data.rows;
325
- if (CFG.DEBUG) { console.log('Preloaded ' + me.__prefetchedData.length + ' records for cursor'); }
345
+ if (CFG.DEBUG) { console.log('Preloaded ' + data.rows.length + ' records for cursor'); }
326
346
  me.__decode(/** @type {RowItemNonNull} */ (data.rows.item(0)), success);
327
347
  } else if (data.rows.length === 1) {
328
348
  me.__decode(/** @type {RowItemNonNull} */ (data.rows.item(0)), success);
@@ -452,7 +472,9 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
452
472
  for (let i = 0; i < data.rows.length; i++) {
453
473
  const rowItem = /** @type {RowItemNonNull} */ (data.rows.item(i));
454
474
  const rowKey = Key.decode(rowItem[me.__keyColumnName], true);
455
- const matches = Key.findMultiEntryMatches(rowKey, me.__range);
475
+ const matches = Key.findMultiEntryMatches(
476
+ /** @type {import('./Key.js').Key} */ (rowKey), me.__range
477
+ );
456
478
  ct += matches.length;
457
479
  }
458
480
  success(undefined, ct, undefined);
@@ -473,7 +495,9 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
473
495
  for (let i = 0; i < data.rows.length; i++) {
474
496
  const rowItem = /** @type {RowItemNonNull} */ (data.rows.item(i));
475
497
  const rowKey = Key.decode(rowItem[me.__keyColumnName], true);
476
- const matches = Key.findMultiEntryMatches(rowKey, me.__range);
498
+ const matches = Key.findMultiEntryMatches(
499
+ /** @type {import('./Key.js').Key} */ (rowKey), me.__range
500
+ );
477
501
 
478
502
  for (const matchingKey of matches) {
479
503
  /**
@@ -545,11 +569,11 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
545
569
  };
546
570
 
547
571
  /**
548
- * @typedef {any} StructuredCloneValue
572
+ * @typedef {import('./Key.js').Value} StructuredCloneValue
549
573
  */
550
574
 
551
575
  /**
552
- * @typedef {any} IndexedDBKey
576
+ * @typedef {import('./Key.js').Key} IndexedDBKey
553
577
  */
554
578
 
555
579
  /**
@@ -561,9 +585,9 @@ IDBCursor.prototype.__findMultiEntry = function (key, primaryKey, tx, success, e
561
585
 
562
586
  /**
563
587
  * @callback SuccessCallback
564
- * @param {IndexedDBKey} key
588
+ * @param {IndexedDBKey|undefined} key
565
589
  * @param {StructuredCloneValue} value
566
- * @param {IndexedDBKey} primaryKey
590
+ * @param {IndexedDBKey|undefined} primaryKey
567
591
  * @returns {void}
568
592
  */
569
593
 
@@ -603,9 +627,9 @@ IDBCursor.prototype.__onsuccess = function (success) {
603
627
  *
604
628
  * @param {RowItemNonNull} rowItem
605
629
  * @param {(
606
- * key: import('./Key.js').Key,
630
+ * key: import('./Key.js').Key|undefined,
607
631
  * val: import('./Key.js').Value,
608
- * primaryKey: import('./Key.js').Key,
632
+ * primaryKey: import('./Key.js').Key|undefined,
609
633
  * encKey?: string
610
634
  * ) => void} callback
611
635
  * @this {IDBCursorFull}
@@ -694,8 +718,8 @@ IDBCursor.prototype.__continue = function (key, advanceContinue) {
694
718
 
695
719
  /**
696
720
  *
697
- * @param {import('./Key.js').Key} key
698
- * @param {import('./Key.js').Key} primaryKey
721
+ * @param {import('./Key.js').Key|undefined} key
722
+ * @param {import('./Key.js').Key|undefined} primaryKey
699
723
  * @param {boolean} advanceState
700
724
  * @this {IDBCursorFull}
701
725
  * @returns {void}
@@ -710,9 +734,9 @@ IDBCursor.prototype.__continueFinish = function (key, primaryKey, advanceState)
710
734
  me.__store.transaction
711
735
  ).__pushToQueue(me.__request, function cursorContinue (tx, args, success, error, executeNextRequest) {
712
736
  /**
713
- * @param {import('./Key.js').Key} k
737
+ * @param {import('./Key.js').Key|undefined} k
714
738
  * @param {import('./Key.js').Value} val
715
- * @param {import('./Key.js').Key} primKey
739
+ * @param {import('./Key.js').Key|undefined} primKey
716
740
  * @returns {void}
717
741
  */
718
742
  function triggerSuccess (k, val, primKey) {
@@ -755,7 +779,7 @@ IDBCursor.prototype.__continueFinish = function (key, primaryKey, advanceState)
755
779
  // We have pre-loaded data for the cursor
756
780
  me.__prefetchedIndex++;
757
781
  if (me.__prefetchedIndex < me.__prefetchedData.length) {
758
- me.__decode(me.__prefetchedData.item(me.__prefetchedIndex), function (k, val, primKey, encKey) {
782
+ me.__decode(/** @type {RowItemNonNull} */ (me.__prefetchedData.item(me.__prefetchedIndex)), function (k, val, primKey, encKey) {
759
783
  /**
760
784
  * @returns {void}
761
785
  */
@@ -904,12 +928,18 @@ IDBCursor.prototype.advance = function (count) {
904
928
  };
905
929
 
906
930
  /**
907
- * @typedef {any} AnyValue
931
+ * The `{query, count, direction}` options shape shared by
932
+ * `getAll`/`getAllKeys`/`getAllRecords`.
933
+ * @typedef {{
934
+ * query?: import('./Key.js').Value,
935
+ * count?: Integer,
936
+ * direction?: string
937
+ * }} GetAllOptions
908
938
  */
909
939
 
910
940
  /**
911
941
  *
912
- * @param {AnyValue} valueToUpdate
942
+ * @param {import('./Key.js').Value} valueToUpdate
913
943
  * @this {IDBCursorFull}
914
944
  * @returns {IDBRequest}
915
945
  */
@@ -1048,16 +1078,22 @@ Object.defineProperty(IDBCursorWithValue.prototype, 'constructor', {
1048
1078
  const IDBCursorWithValueAlias = IDBCursorWithValue;
1049
1079
  /**
1050
1080
  *
1051
- * @param {...any} args
1081
+ * @param {IDBKeyRange} query
1082
+ * @param {string} direction
1083
+ * @param {import('./IDBObjectStore.js').IDBObjectStoreFull} store
1084
+ * @param {import('./IDBObjectStore.js').IDBObjectStoreFull|
1085
+ * import('./IDBIndex.js').IDBIndexFull} source
1086
+ * @param {string} keyColumnName
1087
+ * @param {string} valueColumnName
1088
+ * @param {boolean} [count]
1052
1089
  * @returns {IDBCursorWithValueFull}
1053
1090
  */
1054
- IDBCursorWithValue.__createInstance = function (...args) {
1091
+ IDBCursorWithValue.__createInstance = function (query, direction, store, source, keyColumnName, valueColumnName, count) {
1055
1092
  /**
1056
1093
  * @class
1057
1094
  * @this {IDBCursorWithValueFull}
1058
1095
  */
1059
1096
  function IDBCursorWithValue () {
1060
- const [query, direction, store, source, keyColumnName, valueColumnName, count] = args;
1061
1097
  IDBCursor.__super.call(this, query, direction, store, source, keyColumnName, valueColumnName, count);
1062
1098
  // @ts-expect-error It's ok
1063
1099
  this[Symbol.toStringTag] = 'IDBCursorWithValue';
@@ -1081,12 +1117,16 @@ Object.defineProperty(IDBCursorWithValue, 'prototype', {
1081
1117
  /**
1082
1118
  * Validates `direction` and fills in defaults for the `{query, count,
1083
1119
  * direction}` shape shared by `getAll`/`getAllKeys`/`getAllRecords`.
1084
- * @param {AnyValue} options
1120
+ * @param {unknown} options
1085
1121
  * @throws {TypeError}
1086
- * @returns {{query: AnyValue, count: Integer|undefined, direction: string}}
1122
+ * @returns {{
1123
+ * query: import('./Key.js').Value|undefined,
1124
+ * count: Integer|undefined,
1125
+ * direction: string
1126
+ * }}
1087
1127
  */
1088
1128
  function normalizeGetAllOptions (options) {
1089
- const {query, count, direction = 'next'} = /** @type {AnyValue} */ (options ?? {});
1129
+ const {query, count, direction = 'next'} = /** @type {GetAllOptions} */ (options ?? {});
1090
1130
  if (!cursorDirections.includes(direction)) {
1091
1131
  throw new TypeError('`' + direction + '` is not a valid direction');
1092
1132
  }
@@ -1107,7 +1147,11 @@ function normalizeGetAllOptions (options) {
1107
1147
  * first argument wins regardless of how many arguments were actually passed.
1108
1148
  * @param {IArguments} args
1109
1149
  * @throws {TypeError}
1110
- * @returns {{query: AnyValue, count: Integer|undefined, direction: string}}
1150
+ * @returns {{
1151
+ * query: import('./Key.js').Value|undefined,
1152
+ * count: Integer|undefined,
1153
+ * direction: string
1154
+ * }}
1111
1155
  */
1112
1156
  function parseGetAllArgs (args) {
1113
1157
  const arg0 = args[0];
@@ -1127,7 +1171,11 @@ function parseGetAllArgs (args) {
1127
1171
  * form to disambiguate against.
1128
1172
  * @param {IArguments} args
1129
1173
  * @throws {TypeError}
1130
- * @returns {{query: AnyValue, count: Integer|undefined, direction: string}}
1174
+ * @returns {{
1175
+ * query: import('./Key.js').Value|undefined,
1176
+ * count: Integer|undefined,
1177
+ * direction: string
1178
+ * }}
1131
1179
  */
1132
1180
  function parseGetAllRecordsArgs (args) {
1133
1181
  return normalizeGetAllOptions(args[0]);
@@ -1234,7 +1282,7 @@ function collectAll (source, query, count, direction, mode) {
1234
1282
  Object.defineProperty(state, 'direction', {writable: false, value: direction});
1235
1283
 
1236
1284
  return tx.__addToTransactionQueue(function collectAllOp (sqlTx, args, success, error) {
1237
- /** @type {AnyValue[]} */
1285
+ /** @type {unknown[]} */
1238
1286
  const results = [];
1239
1287
  const recordsToLoad = count || CFG.cursorPreloadPackSize || 100;
1240
1288
 
@@ -1275,7 +1323,7 @@ function collectAll (source, query, count, direction, mode) {
1275
1323
  state.__prefetchedIndex++;
1276
1324
  if (state.__prefetchedIndex < state.__prefetchedData.length) {
1277
1325
  IDBCursor.prototype.__decode.call(
1278
- state, state.__prefetchedData.item(state.__prefetchedIndex),
1326
+ state, /** @type {RowItemNonNull} */ (state.__prefetchedData.item(state.__prefetchedIndex)),
1279
1327
  /**
1280
1328
  * @param {import('./Key.js').Key} k
1281
1329
  * @param {import('./Key.js').Value} val