indexeddbshim 12.0.0 → 13.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 (101) hide show
  1. package/README.md +1 -1
  2. package/badges/licenses-badge-dev.svg +1 -1
  3. package/dist/CFG.d.ts +80 -0
  4. package/dist/CFG.d.ts.map +1 -0
  5. package/dist/DOMException.d.ts +71 -0
  6. package/dist/DOMException.d.ts.map +1 -0
  7. package/dist/DOMStringList.d.ts +20 -0
  8. package/dist/DOMStringList.d.ts.map +1 -0
  9. package/dist/Event.d.ts +21 -0
  10. package/dist/Event.d.ts.map +1 -0
  11. package/dist/IDBCursor.d.ts +288 -0
  12. package/dist/IDBCursor.d.ts.map +1 -0
  13. package/dist/IDBDatabase.d.ts +143 -0
  14. package/dist/IDBDatabase.d.ts.map +1 -0
  15. package/dist/IDBFactory.d.ts +96 -0
  16. package/dist/IDBFactory.d.ts.map +1 -0
  17. package/dist/IDBIndex.d.ts +243 -0
  18. package/dist/IDBIndex.d.ts.map +1 -0
  19. package/dist/IDBKeyRange.d.ts +79 -0
  20. package/dist/IDBKeyRange.d.ts.map +1 -0
  21. package/dist/IDBObjectStore.d.ts +273 -0
  22. package/dist/IDBObjectStore.d.ts.map +1 -0
  23. package/dist/IDBRequest.d.ts +88 -0
  24. package/dist/IDBRequest.d.ts.map +1 -0
  25. package/dist/IDBTransaction.d.ts +270 -0
  26. package/dist/IDBTransaction.d.ts.map +1 -0
  27. package/dist/IDBVersionChangeEvent.d.ts +22 -0
  28. package/dist/IDBVersionChangeEvent.d.ts.map +1 -0
  29. package/dist/Key.d.ts +214 -0
  30. package/dist/Key.d.ts.map +1 -0
  31. package/dist/Sca.d.ts +31 -0
  32. package/dist/Sca.d.ts.map +1 -0
  33. package/dist/UnicodeIdentifiers.d.ts +3 -0
  34. package/dist/UnicodeIdentifiers.d.ts.map +1 -0
  35. package/dist/browser-UnicodeIdentifiers.d.ts +2 -0
  36. package/dist/browser-UnicodeIdentifiers.d.ts.map +1 -0
  37. package/dist/browser-noninvasive.d.ts +3 -0
  38. package/dist/browser-noninvasive.d.ts.map +1 -0
  39. package/dist/browser.d.ts +2 -0
  40. package/dist/browser.d.ts.map +1 -0
  41. package/dist/cmp.d.ts +9 -0
  42. package/dist/cmp.d.ts.map +1 -0
  43. package/dist/indexeddbshim-Key.js +553 -252
  44. package/dist/indexeddbshim-Key.js.map +1 -1
  45. package/dist/indexeddbshim-Key.min.js +2 -2
  46. package/dist/indexeddbshim-Key.min.js.map +1 -1
  47. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +17560 -1302
  48. package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
  49. package/dist/indexeddbshim-UnicodeIdentifiers.js +4367 -1604
  50. package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
  51. package/dist/indexeddbshim-UnicodeIdentifiers.min.js +2 -2
  52. package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
  53. package/dist/indexeddbshim-node.cjs +17556 -1302
  54. package/dist/indexeddbshim-node.cjs.map +1 -1
  55. package/dist/indexeddbshim-noninvasive.js +4362 -1604
  56. package/dist/indexeddbshim-noninvasive.js.map +1 -1
  57. package/dist/indexeddbshim-noninvasive.min.js +2 -2
  58. package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
  59. package/dist/indexeddbshim.js +4362 -1604
  60. package/dist/indexeddbshim.js.map +1 -1
  61. package/dist/indexeddbshim.min.js +2 -2
  62. package/dist/indexeddbshim.min.js.map +1 -1
  63. package/dist/node-UnicodeIdentifiers.d.ts +8 -0
  64. package/dist/node-UnicodeIdentifiers.d.ts.map +1 -0
  65. package/dist/node.d.ts +8 -0
  66. package/dist/node.d.ts.map +1 -0
  67. package/dist/nodeWebSQL.d.ts +3 -0
  68. package/dist/nodeWebSQL.d.ts.map +1 -0
  69. package/dist/setGlobalVars.d.ts +79 -0
  70. package/dist/setGlobalVars.d.ts.map +1 -0
  71. package/dist/unicode-regex.d.ts +3 -0
  72. package/dist/unicode-regex.d.ts.map +1 -0
  73. package/dist/util.d.ts +174 -0
  74. package/dist/util.d.ts.map +1 -0
  75. package/index.html +1 -1
  76. package/package.json +51 -37
  77. package/src/CFG.js +89 -11
  78. package/src/DOMException.js +117 -31
  79. package/src/DOMStringList.js +93 -3
  80. package/src/Event.js +19 -4
  81. package/src/IDBCursor.js +350 -76
  82. package/src/IDBDatabase.js +88 -10
  83. package/src/IDBFactory.js +331 -61
  84. package/src/IDBIndex.js +393 -110
  85. package/src/IDBKeyRange.js +90 -17
  86. package/src/IDBObjectStore.js +347 -86
  87. package/src/IDBRequest.js +59 -1
  88. package/src/IDBTransaction.js +254 -46
  89. package/src/IDBVersionChangeEvent.js +28 -3
  90. package/src/Key.d.ts +1 -0
  91. package/src/Key.js +272 -162
  92. package/src/Sca.js +29 -4
  93. package/src/browser-UnicodeIdentifiers.js +5 -1
  94. package/src/cmp.js +5 -5
  95. package/src/node-UnicodeIdentifiers.js +9 -0
  96. package/src/node.js +5 -0
  97. package/src/nodeWebSQL.js +11 -5
  98. package/src/setGlobalVars.js +159 -22
  99. package/src/unicode-regex.js +2 -0
  100. package/src/util.js +229 -40
  101. package/typings/shimIndexedDB.d.ts +9 -0
@@ -0,0 +1,143 @@
1
+ export default IDBDatabase;
2
+ export type IDBObjectStoreProperties = {
3
+ name: string;
4
+ keyPath: import('./Key.js').KeyPath;
5
+ autoInc: boolean;
6
+ indexList: {
7
+ [key: string]: import("./IDBIndex.js").IDBIndexProperties;
8
+ };
9
+ idbdb: IDBDatabaseFull;
10
+ cursors?: (import("./IDBCursor.js").IDBCursorFull | import("./IDBCursor.js").IDBCursorWithValueFull)[] | undefined;
11
+ };
12
+ export type Integer = number;
13
+ export type IDBDatabaseFull = IDBDatabase & EventTarget & {
14
+ createObjectStore: (storeName: string) => IDBObjectStore;
15
+ deleteObjectStore: (storeName: string) => void;
16
+ close: () => void;
17
+ transaction: (storeNames: string | string[], mode: string) => IDBTransaction;
18
+ throwIfUpgradeTransactionNull: () => void;
19
+ objectStoreNames: import('./DOMStringList.js').DOMStringListFull;
20
+ name: string;
21
+ __forceClose: (msg: string) => void;
22
+ __db: import('websql-configurable/lib/websql/WebSQLDatabase.js').default;
23
+ __oldVersion: Integer;
24
+ __version: Integer;
25
+ __name: string;
26
+ __upgradeTransaction: null | import('./IDBTransaction.js').IDBTransactionFull;
27
+ __versionTransaction: import('./IDBTransaction.js').IDBTransactionFull;
28
+ __transactions: import('./IDBTransaction.js').IDBTransactionFull[];
29
+ __objectStores: {
30
+ [key: string]: IDBObjectStore;
31
+ };
32
+ __objectStoreNames: import('./DOMStringList.js').DOMStringListFull;
33
+ __oldObjectStoreNames: import('./DOMStringList.js').DOMStringListFull;
34
+ __unblocking: {
35
+ check: () => void;
36
+ };
37
+ };
38
+ /**
39
+ * @typedef {{
40
+ * name: string,
41
+ * keyPath: import('./Key.js').KeyPath,
42
+ * autoInc: boolean,
43
+ * indexList: {[key: string]: import('./IDBIndex.js').IDBIndexProperties},
44
+ * idbdb: IDBDatabaseFull,
45
+ * cursors?: (import('./IDBCursor.js').IDBCursorFull|
46
+ * import('./IDBCursor.js').IDBCursorWithValueFull)[],
47
+ * }} IDBObjectStoreProperties
48
+ */
49
+ /**
50
+ * IDB Database Object.
51
+ * @see http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#database-interface
52
+ * @class
53
+ */
54
+ declare function IDBDatabase(): void;
55
+ declare class IDBDatabase {
56
+ __versionTransaction: any;
57
+ __objectStores: any;
58
+ /**
59
+ * Creates a new object store.
60
+ * @param {string} storeName
61
+ * @this {IDBDatabaseFull}
62
+ * @returns {IDBObjectStore}
63
+ */
64
+ createObjectStore(this: IDBDatabaseFull, storeName: string, ...args: any[]): IDBObjectStore;
65
+ /**
66
+ * Deletes an object store.
67
+ * @param {string} storeName
68
+ * @throws {TypeError|DOMException}
69
+ * @this {IDBDatabaseFull}
70
+ * @returns {void}
71
+ */
72
+ deleteObjectStore(this: IDBDatabaseFull, storeName: string, ...args: any[]): void;
73
+ /**
74
+ * @throws {TypeError}
75
+ * @this {IDBDatabaseFull}
76
+ * @returns {void}
77
+ */
78
+ close(this: IDBDatabaseFull): void;
79
+ __closePending: boolean | undefined;
80
+ /**
81
+ * Starts a new transaction.
82
+ * @param {string|string[]} storeNames
83
+ * @this {IDBDatabaseFull}
84
+ * @returns {import('./IDBTransaction.js').IDBTransactionFull}
85
+ */
86
+ transaction(this: IDBDatabaseFull, storeNames: string | string[], ...args: any[]): import('./IDBTransaction.js').IDBTransactionFull;
87
+ /**
88
+ * @see https://github.com/w3c/IndexedDB/issues/192
89
+ * @throws {DOMException}
90
+ * @this {IDBDatabaseFull}
91
+ * @returns {void}
92
+ */
93
+ throwIfUpgradeTransactionNull(this: IDBDatabaseFull): void;
94
+ /**
95
+ *
96
+ * @param {string} msg
97
+ * @this {IDBDatabaseFull}
98
+ * @returns {void}
99
+ */
100
+ __forceClose(this: IDBDatabaseFull, msg: string): void;
101
+ }
102
+ declare namespace IDBDatabase {
103
+ /**
104
+ * @typedef {number} Integer
105
+ */
106
+ /**
107
+ * @typedef {IDBDatabase & EventTarget & {
108
+ * createObjectStore: (storeName: string) => IDBObjectStore,
109
+ * deleteObjectStore: (storeName: string) => void,
110
+ * close: () => void,
111
+ * transaction: (storeNames: string|string[], mode: string) => IDBTransaction,
112
+ * throwIfUpgradeTransactionNull: () => void,
113
+ * objectStoreNames: import('./DOMStringList.js').DOMStringListFull,
114
+ * name: string,
115
+ * __forceClose: (msg: string) => void,
116
+ * __db: import('websql-configurable/lib/websql/WebSQLDatabase.js').default,
117
+ * __oldVersion: Integer,
118
+ * __version: Integer,
119
+ * __name: string,
120
+ * __upgradeTransaction: null|import('./IDBTransaction.js').IDBTransactionFull,
121
+ * __versionTransaction: import('./IDBTransaction.js').IDBTransactionFull,
122
+ * __transactions: import('./IDBTransaction.js').IDBTransactionFull[],
123
+ * __objectStores: {[key: string]: IDBObjectStore},
124
+ * __objectStoreNames: import('./DOMStringList.js').DOMStringListFull,
125
+ * __oldObjectStoreNames: import('./DOMStringList.js').DOMStringListFull,
126
+ * __unblocking: {
127
+ * check: () => void
128
+ * }
129
+ * }} IDBDatabaseFull
130
+ */
131
+ /**
132
+ * @param {import('websql-configurable').default} db
133
+ * @param {string} name
134
+ * @param {Integer} oldVersion
135
+ * @param {Integer} version
136
+ * @param {SQLResultSet} storeProperties
137
+ * @returns {IDBDatabaseFull}
138
+ */
139
+ function __createInstance(db: any, name: string, oldVersion: number, version: number, storeProperties: SQLResultSet): IDBDatabaseFull;
140
+ }
141
+ import IDBObjectStore from './IDBObjectStore.js';
142
+ import IDBTransaction from './IDBTransaction.js';
143
+ //# sourceMappingURL=IDBDatabase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDBDatabase.d.ts","sourceRoot":"","sources":["../src/IDBDatabase.js"],"names":[],"mappings":";;UAaW,MAAM;aACH,OAAO,UAAU,EAAE,OAAO;aAC1B,OAAO;;;;WAET,eAAe;;;sBAmBd,MAAM;;mCAKiB,MAAM,KAAK,cAAc;mCACzB,MAAM,KAAK,IAAI;WACvC,MAAM,IAAI;8BACS,MAAM,GAAC,MAAM,EAAE,QAAQ,MAAM,KAAK,cAAc;mCAC3C,MAAM,IAAI;sBACvB,OAAO,oBAAoB,EAAE,iBAAiB;UAC1D,MAAM;wBACQ,MAAM,KAAK,IAAI;UAC7B,OAAO,kDAAkD,EAAE,OAAO;kBAC1D,OAAO;eACV,OAAO;YACV,MAAM;0BACQ,IAAI,GAAC,OAAO,qBAAqB,EAAE,kBAAkB;0BACrD,OAAO,qBAAqB,EAAE,kBAAkB;oBACtD,OAAO,qBAAqB,EAAE,kBAAkB,EAAE;;;;wBAE9C,OAAO,oBAAoB,EAAE,iBAAiB;2BAC3C,OAAO,oBAAoB,EAAE,iBAAiB;kBACvD;QAClB,KAAW,EAAE,MAAM,IAAI,CAAA;KAClB;;AAlDN;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,qCAIC;;IAHG,0BAAgC;IAChC,oBAA0B;IA2G9B;;;;;OAKG;IACH,oDAJW,MAAM,mBAEJ,cAAc,CA0C1B;IAED;;;;;;OAMG;IACH,oDALW,MAAM,mBAGJ,IAAI,CAmBhB;IAED;;;;OAIG;IACH,8BAFa,IAAI,CAUhB;IAJG,oCAA0B;IAM9B;;;;;OAKG;IACH,+CAJW,MAAM,GAAC,MAAM,EAAE,mBAEb,OAAO,qBAAqB,EAAE,kBAAkB,CAuD5D;IAED;;;;;OAKG;IACH,sDAFa,IAAI,CAMhB;IAGD;;;;;OAKG;IACH,yCAJW,MAAM,GAEJ,IAAI,CAsBhB;;;IAnSD;;OAEG;IAEH;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IAEH;;;;;;;OAOG;IACH,sIA0DC;;2BA9H0B,qBAAqB;2BACrB,qBAAqB"}
@@ -0,0 +1,96 @@
1
+ export type CreateSysDBSuccessCallback = () => void;
2
+ export type Integer = number;
3
+ export type DatabaseDeleted = () => void;
4
+ export type DatabaseFull = import("websql-configurable/lib/websql/WebSQLDatabase.js").default & {
5
+ _db: {
6
+ _db: {
7
+ close: (errBack: (err: Error) => void) => void;
8
+ };
9
+ };
10
+ };
11
+ export type OpenDatabase = (name: string, version: string, displayName: string, estimatedSize: number) => import('websql-configurable/lib/websql/WebSQLDatabase.js').default;
12
+ export type IDBFactoryFull = globalThis.IDBFactory & {
13
+ __openDatabase: OpenDatabase;
14
+ __connections: {
15
+ [key: string]: import("./IDBDatabase.js").IDBDatabaseFull[];
16
+ };
17
+ };
18
+ /**
19
+ * IDBFactory Class.
20
+ * @see https://w3c.github.io/IndexedDB/#idl-def-IDBFactory
21
+ * @class
22
+ */
23
+ export function IDBFactory(): void;
24
+ export class IDBFactory {
25
+ /**
26
+ * The IndexedDB Method to create a new database and return the DB.
27
+ * @param {string} name
28
+ * @this {IDBFactoryFull}
29
+ * @throws {TypeError} Illegal invocation or no arguments (for database name)
30
+ * @returns {IDBOpenDBRequest}
31
+ */
32
+ open(this: IDBFactoryFull, name: string, ...args: any[]): IDBOpenDBRequest;
33
+ /**
34
+ * Deletes a database.
35
+ * @param {string} name
36
+ * @this {IDBFactoryFull}
37
+ * @returns {IDBOpenDBRequest}
38
+ */
39
+ deleteDatabase(this: IDBFactoryFull, name: string, ...args: any[]): IDBOpenDBRequest;
40
+ /**
41
+ *
42
+ * @param {import('./Key.js').Key} key1
43
+ * @param {import('./Key.js').Key} key2
44
+ * @throws {TypeError}
45
+ * @returns {0|1|-1}
46
+ */
47
+ cmp(key1: import('./Key.js').Key, key2: import('./Key.js').Key, ...args: any[]): 0 | 1 | -1;
48
+ /**
49
+ * May return outdated information if a database has since been deleted.
50
+ * @see https://github.com/w3c/IndexedDB/pull/240/files
51
+ * @this {IDBFactoryFull}
52
+ * @returns {Promise<{
53
+ * name: string,
54
+ * version: Integer
55
+ * }[]>}
56
+ */
57
+ databases(this: IDBFactoryFull): Promise<{
58
+ name: string;
59
+ version: Integer;
60
+ }[]>;
61
+ /**
62
+ * @todo forceClose: Test
63
+ * This is provided to facilitate unit-testing of the
64
+ * closing of a database connection with a forced flag:
65
+ * <http://w3c.github.io/IndexedDB/#steps-for-closing-a-database-connection>
66
+ * @param {string} dbName
67
+ * @param {Integer} connIdx
68
+ * @param {string} msg
69
+ * @throws {TypeError}
70
+ * @this {IDBFactoryFull}
71
+ * @returns {void}
72
+ */
73
+ __forceClose(this: IDBFactoryFull, dbName: string, connIdx: Integer, msg: string): void;
74
+ /**
75
+ *
76
+ * @param {string} [origin]
77
+ * @returns {void}
78
+ */
79
+ __setConnectionQueueOrigin(origin?: string | undefined): void;
80
+ }
81
+ export namespace IDBFactory {
82
+ /**
83
+ * @returns {IDBFactoryFull}
84
+ */
85
+ function __createInstance(): IDBFactoryFull;
86
+ }
87
+ import cmp from './cmp.js';
88
+ export const shimIndexedDB: IDBFactoryFull;
89
+ /**
90
+ * @param {import('./CFG.js').FSApi} _fs
91
+ * @returns {void}
92
+ */
93
+ export function setFS(_fs: import('./CFG.js').FSApi): void;
94
+ import { IDBOpenDBRequest } from './IDBRequest.js';
95
+ export { cmp };
96
+ //# sourceMappingURL=IDBFactory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDBFactory.d.ts","sourceRoot":"","sources":["../src/IDBFactory.js"],"names":[],"mappings":"+CAoTa,IAAI;sBApSJ,MAAM;oCAKN,IAAI;;;;mCA4Je,KAAK,KAAK,IAAI,KAAK,IAAI;;;;kCAsM5C,MAAM,WAAW,MAAM,eAAe,MAAM,iBAAiB,MAAM,KACtE,OAAO,kDAAkD,EAAE,OAAO;;oBAKrD,YAAY;;;;;AAjBjC;;;;GAIG;AACH,mCAEC;;IAmCD;;;;;;OAMG;IACH,iCALW,MAAM,mBAGJ,gBAAgB,CA4W5B;IAED;;;;;OAKG;IACH,2CAJW,MAAM,mBAEJ,gBAAgB,CAgJ5B;IAED;;;;;;OAMG;IACH,UALW,OAAO,UAAU,EAAE,GAAG,QACtB,OAAO,UAAU,EAAE,GAAG,mBAEpB,CAAC,GAAC,CAAC,GAAC,CAAC,CAAC,CAclB;IAED;;;;;;;;MAQE;IACF,iCALY,QAAQ;QACpB,MAAU,MAAM,CAAC;QACjB,OAAW,EAAE,OAAO,CAAA;KACjB,EAAE,CAAC,CA2CL;IAED;;;;;;;;;;;MAWE;IACF,2CAPU,MAAM,WACN,OAAO,OACP,MAAM,GAGJ,IAAI,CA+Bf;IAED;;;;OAIG;IACH,yDAFa,IAAI,CAIhB;;;IArpBD;;OAEG;IACH,4CAYC;;gBA5Ye,UAAU;AA0hC1B,2CAAoD;AAvgCpD;;;GAGG;AACH,2BAHW,OAAO,UAAU,EAAE,KAAK,GACtB,IAAI,CAIhB;iCA1B8B,iBAAiB"}
@@ -0,0 +1,243 @@
1
+ export type Integer = number;
2
+ export type IDBIndexProperties = {
3
+ columnName: string;
4
+ keyPath: import('./Key.js').KeyPath;
5
+ optionalParams: {
6
+ unique: boolean;
7
+ multiEntry: boolean;
8
+ };
9
+ deleted?: boolean;
10
+ __deleted?: boolean;
11
+ cursors?: import('./IDBCursor.js').IDBCursorWithValueFull[];
12
+ };
13
+ export type IDBIndexFull = IDBIndex & {
14
+ name: string;
15
+ keyPath: import('./Key.js').KeyPath;
16
+ multiEntry: boolean;
17
+ unique: boolean;
18
+ objectStore: import('./IDBObjectStore.js').IDBObjectStoreFull;
19
+ __pendingCreate?: boolean;
20
+ __deleted?: boolean;
21
+ __originalName: string;
22
+ __currentName: string;
23
+ __pendingName?: string;
24
+ __pendingDelete?: boolean;
25
+ __name: string;
26
+ __multiEntry: boolean;
27
+ __unique: boolean;
28
+ __objectStore: import('./IDBObjectStore.js').IDBObjectStoreFull;
29
+ __keyPath: import('./Key.js').KeyPath;
30
+ __recreated?: boolean;
31
+ };
32
+ export type IndexList = {
33
+ [key: string]: IDBIndexProperties;
34
+ };
35
+ export type Query = any | IDBKeyRange;
36
+ export type AnyValue = any;
37
+ /**
38
+ * @param {boolean} nullDisallowed
39
+ * @param {IDBIndexFull} index
40
+ * @param {import('./Key.js').Value|import('./Key.js').Key} range
41
+ * @param {"value"|"key"|"count"} opType
42
+ * @param {boolean} multiChecks
43
+ * @returns {[
44
+ * nullDisallowed: boolean,
45
+ * index: IDBIndexFull,
46
+ * hasRange: boolean,
47
+ * range: import('./Key.js').Value|import('./Key.js').Key,
48
+ * opType: "value"|"key"|"count",
49
+ * multiChecks: boolean,
50
+ * sql: string[],
51
+ * sqlValues: string[]
52
+ * ]}
53
+ */
54
+ export function buildFetchIndexDataSQL(nullDisallowed: boolean, index: IDBIndexFull, range: import('./Key.js').Value | import('./Key.js').Key, opType: "value" | "key" | "count", multiChecks: boolean): [nullDisallowed: boolean, index: IDBIndexFull, hasRange: boolean, range: any, opType: "key" | "value" | "count", multiChecks: boolean, sql: string[], sqlValues: string[]];
55
+ /**
56
+ * @param {number|null} count
57
+ * @param {boolean} unboundedDisallowed
58
+ * @param {IDBIndexFull} index
59
+ * @param {boolean} hasKey
60
+ * @param {import('./Key.js').Value|import('./Key.js').Key} range
61
+ * @param {"value"|"key"|"count"} opType
62
+ * @param {boolean} multiChecks
63
+ * @param {string[]} sql
64
+ * @param {string[]} sqlValues
65
+ * @param {SQLTransaction} tx
66
+ * @param {null|undefined} args
67
+ * @param {(result: number|undefined|[]|AnyValue|AnyValue[]) => void} success
68
+ * @param {(tx: SQLTransaction, err: SQLError) => void} error
69
+ * @returns {void}
70
+ */
71
+ export function executeFetchIndexData(count: number | null, unboundedDisallowed: boolean, index: IDBIndexFull, hasKey: boolean, range: import('./Key.js').Value | import('./Key.js').Key, opType: "value" | "key" | "count", multiChecks: boolean, sql: string[], sqlValues: string[], tx: SQLTransaction, args: null | undefined, success: (result: number | undefined | [] | AnyValue | AnyValue[]) => void, error: (tx: SQLTransaction, err: SQLError) => void): void;
72
+ /**
73
+ * @typedef {number} Integer
74
+ */
75
+ /**
76
+ * @typedef {{
77
+ * columnName: string,
78
+ * keyPath: import('./Key.js').KeyPath,
79
+ * optionalParams: {
80
+ * unique: boolean,
81
+ * multiEntry: boolean
82
+ * }
83
+ * deleted?: boolean,
84
+ * __deleted?: boolean,
85
+ * cursors?: import('./IDBCursor.js').IDBCursorWithValueFull[],
86
+ * }} IDBIndexProperties
87
+ */
88
+ /**
89
+ * IDB Index.
90
+ * @see http://www.w3.org/TR/IndexedDB/#idl-def-IDBIndex
91
+ * @class
92
+ */
93
+ export function IDBIndex(): void;
94
+ export class IDBIndex {
95
+ /**
96
+ * @typedef {any|IDBKeyRange} Query
97
+ */
98
+ /**
99
+ * Retrieves index data for the given key.
100
+ * @param {Query} range
101
+ * @param {"value"|"key"|"count"} opType
102
+ * @param {boolean} nullDisallowed
103
+ * @param {number} [count]
104
+ * @this {IDBIndexFull}
105
+ * @returns {import('./IDBRequest.js').IDBRequestFull}
106
+ */
107
+ __fetchIndexData(this: IDBIndexFull, range: Query, opType: "value" | "key" | "count", nullDisallowed: boolean, count?: number | undefined): import('./IDBRequest.js').IDBRequestFull;
108
+ /**
109
+ * Opens a cursor over the given key range.
110
+ * @this {IDBIndexFull}
111
+ * @returns {import('./IDBRequest.js').IDBRequestFull}
112
+ */
113
+ openCursor(this: IDBIndexFull, ...args: any[]): import('./IDBRequest.js').IDBRequestFull;
114
+ /**
115
+ * Opens a cursor over the given key range. The cursor only includes key values, not data.
116
+ * @this {IDBIndexFull}
117
+ * @returns {import('./IDBRequest.js').IDBRequestFull}
118
+ */
119
+ openKeyCursor(this: IDBIndexFull, ...args: any[]): import('./IDBRequest.js').IDBRequestFull;
120
+ /**
121
+ *
122
+ * @param {Query} query
123
+ * @throws {TypeError}
124
+ * @this {IDBIndexFull}
125
+ * @returns {import('./IDBRequest.js').IDBRequestFull}
126
+ */
127
+ get(this: IDBIndexFull, query: Query, ...args: any[]): import('./IDBRequest.js').IDBRequestFull;
128
+ /**
129
+ *
130
+ * @param {Query} query
131
+ * @throws {TypeError}
132
+ * @this {IDBIndexFull}
133
+ * @returns {import('./IDBRequest.js').IDBRequestFull}
134
+ */
135
+ getKey(this: IDBIndexFull, query: Query, ...args: any[]): import('./IDBRequest.js').IDBRequestFull;
136
+ /**
137
+ * @this {IDBIndexFull}
138
+ * @returns {import('./IDBRequest.js').IDBRequestFull}
139
+ */
140
+ getAll(this: IDBIndexFull, ...args: any[]): import('./IDBRequest.js').IDBRequestFull;
141
+ /**
142
+ * @this {IDBIndexFull}
143
+ * @returns {import('./IDBRequest.js').IDBRequestFull}
144
+ */
145
+ getAllKeys(this: IDBIndexFull, ...args: any[]): import('./IDBRequest.js').IDBRequestFull;
146
+ /**
147
+ * @this {IDBIndexFull}
148
+ * @returns {import('./IDBRequest.js').IDBRequestFull}
149
+ */
150
+ count(this: IDBIndexFull, ...args: any[]): import('./IDBRequest.js').IDBRequestFull;
151
+ /**
152
+ *
153
+ * @param {import('./IDBObjectStore.js').IDBObjectStoreFull} store
154
+ * @param {string} oldName
155
+ * @param {string} newName
156
+ * @param {string[][]} colInfoToPreserveArr
157
+ * @param {null|((
158
+ * tx: SQLTransaction,
159
+ * success: ((store: IDBObjectStore) => void)
160
+ * ) => void)} cb
161
+ * @this {IDBIndexFull}
162
+ * @returns {void}
163
+ */
164
+ __renameIndex(this: IDBIndexFull, store: import('./IDBObjectStore.js').IDBObjectStoreFull, oldName: string, newName: string, colInfoToPreserveArr?: string[][], cb?: ((tx: SQLTransaction, success: (store: IDBObjectStore) => void) => void) | null): void;
165
+ }
166
+ export namespace IDBIndex {
167
+ /**
168
+ * @typedef {IDBIndex & {
169
+ * name: string,
170
+ * keyPath: import('./Key.js').KeyPath,
171
+ * multiEntry: boolean,
172
+ * unique: boolean,
173
+ * objectStore: import('./IDBObjectStore.js').IDBObjectStoreFull,
174
+ * __pendingCreate?: boolean,
175
+ * __deleted?: boolean,
176
+ * __originalName: string,
177
+ * __currentName: string,
178
+ * __pendingName?: string,
179
+ * __pendingDelete?: boolean,
180
+ * __name: string,
181
+ * __multiEntry: boolean,
182
+ * __unique: boolean,
183
+ * __objectStore: import('./IDBObjectStore.js').IDBObjectStoreFull,
184
+ * __keyPath: import('./Key.js').KeyPath,
185
+ * __recreated?: boolean
186
+ * }} IDBIndexFull
187
+ */
188
+ /**
189
+ *
190
+ * @param {import('./IDBObjectStore.js').IDBObjectStoreFull} store
191
+ * @param {IDBIndexProperties} indexProperties
192
+ * @returns {IDBIndexFull}
193
+ */
194
+ function __createInstance(store: import("./IDBObjectStore.js").IDBObjectStoreFull, indexProperties: IDBIndexProperties): IDBIndexFull;
195
+ /**
196
+ *
197
+ * @param {IDBIndexFull} index
198
+ * @param {string} [msg]
199
+ * @throws {DOMException}
200
+ * @returns {void}
201
+ */
202
+ function __invalidStateIfDeleted(index: IDBIndexFull, msg?: string | undefined): void;
203
+ /**
204
+ * Clones an IDBIndex instance for a different IDBObjectStore instance.
205
+ * @param {IDBIndexFull} index
206
+ * @param {import('./IDBObjectStore.js').IDBObjectStoreFull} store
207
+ * @returns {IDBIndexFull}
208
+ */
209
+ function __clone(index: IDBIndexFull, store: import("./IDBObjectStore.js").IDBObjectStoreFull): IDBIndexFull;
210
+ /**
211
+ * Creates a new index on an object store.
212
+ * @param {import('./IDBObjectStore.js').IDBObjectStoreFull} store
213
+ * @param {IDBIndexFull} index
214
+ * @returns {void}
215
+ */
216
+ function __createIndex(store: import("./IDBObjectStore.js").IDBObjectStoreFull, index: IDBIndexFull): void;
217
+ /**
218
+ * Deletes an index from an object store.
219
+ * @param {import('./IDBObjectStore.js').IDBObjectStoreFull} store
220
+ * @param {IDBIndexFull} index
221
+ * @returns {void}
222
+ */
223
+ function __deleteIndex(store: import("./IDBObjectStore.js").IDBObjectStoreFull, index: IDBIndexFull): void;
224
+ /**
225
+ * @typedef {{[key: string]: IDBIndexProperties}} IndexList
226
+ */
227
+ /**
228
+ * Updates index list for the given object store.
229
+ * @param {import('./IDBObjectStore.js').IDBObjectStoreFull} store
230
+ * @param {SQLTransaction} tx
231
+ * @param {(store: IDBObjectStore) => void} success
232
+ * @param {(
233
+ * tx: SQLTransaction,
234
+ * err: SQLError
235
+ * ) => boolean} [failure]
236
+ * @returns {void}
237
+ */
238
+ function __updateIndexList(store: import("./IDBObjectStore.js").IDBObjectStoreFull, tx: SQLTransaction, success: (store: IDBObjectStore) => void, failure?: ((tx: SQLTransaction, err: SQLError) => boolean) | undefined): void;
239
+ }
240
+ import { IDBKeyRange } from './IDBKeyRange.js';
241
+ import IDBObjectStore from './IDBObjectStore.js';
242
+ export { IDBIndex as default };
243
+ //# sourceMappingURL=IDBIndex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDBIndex.d.ts","sourceRoot":"","sources":["../src/IDBIndex.js"],"names":[],"mappings":"sBAca,MAAM;iCAIN;IACZ,UAAc,EAAE,MAAM,CAAC;IACvB,OAAW,EAAE,OAAO,UAAU,EAAE,OAAO,CAAC;IACxC,cAAkB,EAAE;QACpB,MAAY,EAAE,OAAO,CAAC;QACtB,UAAgB,EAAE,OAAO,CAAA;KACpB,CAAA;IACL,OAAW,CAAC,EAAE,O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;;;;;;OAUG;IACH,gOAoBC;;4BAldoE,kBAAkB;2BAI5D,qBAAqB"}
@@ -0,0 +1,79 @@
1
+ export type IDBKeyRangeFull = globalThis.IDBKeyRange & {
2
+ __lowerCached: string | null | false;
3
+ __upperCached: string | null | false;
4
+ __lowerOpen: boolean;
5
+ };
6
+ /**
7
+ * @param {IDBKeyRangeFull|undefined} range
8
+ * @param {string} quotedKeyColumnName
9
+ * @param {string[]} sql
10
+ * @param {string[]} sqlValues
11
+ * @param {boolean} [addAnd]
12
+ * @param {boolean} [checkCached]
13
+ * @returns {void}
14
+ */
15
+ export function setSQLForKeyRange(range: IDBKeyRangeFull | undefined, quotedKeyColumnName: string, sql: string[], sqlValues: string[], addAnd?: boolean | undefined, checkCached?: boolean | undefined): void;
16
+ /**
17
+ * @typedef {globalThis.IDBKeyRange & {
18
+ * __lowerCached: string|null|false,
19
+ * __upperCached: string|null|false,
20
+ * __lowerOpen: boolean,
21
+ * }} IDBKeyRangeFull
22
+ */
23
+ /**
24
+ * The IndexedDB KeyRange object.
25
+ * @see http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#dfn-key-range
26
+ * @throws {TypeError}
27
+ * @class
28
+ */
29
+ export function IDBKeyRange(): void;
30
+ export class IDBKeyRange {
31
+ __lowerOpen: any;
32
+ __upperOpen: any;
33
+ /**
34
+ * @param {import('./Key.js').Key} key
35
+ * @this {IDBKeyRangeFull}
36
+ * @returns {boolean}
37
+ */
38
+ includes(this: IDBKeyRangeFull, key: import('./Key.js').Key, ...args: any[]): boolean;
39
+ }
40
+ export namespace IDBKeyRange {
41
+ /**
42
+ * @param {import('./Key.js').Key|null} lower
43
+ * @param {import('./Key.js').Key|null} upper
44
+ * @param {boolean} lowerOpen
45
+ * @param {boolean} upperOpen
46
+ * @returns {import('./IDBKeyRange.js').IDBKeyRangeFull}
47
+ */
48
+ function __createInstance(lower: any, upper: any, lowerOpen: boolean, upperOpen: boolean): IDBKeyRangeFull;
49
+ /**
50
+ * @param {import('./Key.js').Value} value
51
+ * @returns {import('./IDBKeyRange.js').IDBKeyRangeFull}
52
+ */
53
+ function only(value: any, ...args: any[]): IDBKeyRangeFull;
54
+ /**
55
+ * @param {import('./Key.js').Value} value
56
+ * @returns {globalThis.IDBKeyRange}
57
+ */
58
+ function lowerBound(value: any, ...args: any[]): globalThis.IDBKeyRange;
59
+ /**
60
+ * @param {import('./Key.js').Value} value
61
+ * @returns {globalThis.IDBKeyRange}
62
+ */
63
+ function upperBound(value: any, ...args: any[]): globalThis.IDBKeyRange;
64
+ /**
65
+ * @param {import('./Key.js').Value} lower
66
+ * @param {import('./Key.js').Value} upper
67
+ * @returns {globalThis.IDBKeyRange}
68
+ */
69
+ function bound(lower: any, upper: any, ...args: any[]): globalThis.IDBKeyRange;
70
+ }
71
+ /**
72
+ * @param {import('./Key.js').Value} value
73
+ * @param {boolean} [nullDisallowed]
74
+ * @throws {DOMException}
75
+ * @returns {import('./IDBKeyRange.js').IDBKeyRangeFull|undefined}
76
+ */
77
+ export function convertValueToKeyRange(value: import('./Key.js').Value, nullDisallowed?: boolean | undefined): import('./IDBKeyRange.js').IDBKeyRangeFull | undefined;
78
+ export { IDBKeyRange as default };
79
+ //# sourceMappingURL=IDBKeyRange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IDBKeyRange.d.ts","sourceRoot":"","sources":["../src/IDBKeyRange.js"],"names":[],"mappings":"8BAOa,sBAAsB,GAAG;IACtC,aAAiB,EAAE,MAAM,GAAC,IAAI,GAAC,KAAK,CAAC;IACrC,aAAiB,EAAE,MAAM,GAAC,IAAI,GAAC,KAAK,CAAC;IACrC,WAAe,EAAE,OAAO,CAAC;CACtB;AAwKH;;;;;;;;GAQG;AACH,yCARW,eAAe,GAAC,SAAS,uBACzB,MAAM,OACN,MAAM,EAAE,aACR,MAAM,EAAE,oEAGN,IAAI,CA8BhB;AAlND;;;;;;EAME;AAEF;;;;;GAKG;AACH,oCAIC;;IAHG,iBAAwB;IACxB,iBAAwB;IAkD5B;;;;OAIG;IACH,qCAJW,OAAO,UAAU,EAAE,GAAG,mBAEpB,OAAO,CAYnB;;;IA5DD;;;;;;OAMG;IACH,2GAoCC;IAmBD;;;OAGG;IACH,2DAKC;IAED;;;OAGG;IACH,wEAMC;IAED;;;OAGG;IACH,wEAMC;IAED;;;;OAIG;IACH,+EAMC;;AAmFD;;;;;GAKG;AACH,8CALW,OAAO,UAAU,EAAE,KAAK,yCAGtB,OAAO,kBAAkB,EAAE,eAAe,GAAC,SAAS,CAkBhE"}