Skip to content

Commit 93dafcf

Browse files
author
falsandtru
committed
Update IndexedDB interfaces
https://www.w3.org/TR/IndexedDB/
1 parent 965e812 commit 93dafcf

File tree

5 files changed

+57
-11
lines changed

5 files changed

+57
-11
lines changed

baselines/dom.generated.d.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6891,7 +6891,7 @@ interface IDBCursor {
68916891
direction: string;
68926892
key: any;
68936893
primaryKey: any;
6894-
source: any;
6894+
source: IDBObjectStore | IDBIndex;
68956895
advance(count: number): void;
68966896
continue(key?: any): void;
68976897
delete(): IDBRequest;
@@ -6929,7 +6929,7 @@ interface IDBDatabase extends EventTarget {
69296929
close(): void;
69306930
createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;
69316931
deleteObjectStore(name: string): void;
6932-
transaction(storeNames: any, mode?: string): IDBTransaction;
6932+
transaction(storeNames: string | string[], mode?: string): IDBTransaction;
69336933
addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void;
69346934
addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
69356935
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
@@ -6987,9 +6987,10 @@ declare var IDBKeyRange: {
69876987

69886988
interface IDBObjectStore {
69896989
indexNames: DOMStringList;
6990-
keyPath: string;
6990+
keyPath: string | string[];
69916991
name: string;
69926992
transaction: IDBTransaction;
6993+
autoIncrement: boolean;
69936994
add(value: any, key?: any): IDBRequest;
69946995
clear(): IDBRequest;
69956996
count(key?: any): IDBRequest;
@@ -7028,7 +7029,7 @@ interface IDBRequest extends EventTarget {
70287029
onsuccess: (ev: Event) => any;
70297030
readyState: string;
70307031
result: any;
7031-
source: any;
7032+
source: IDBObjectStore | IDBIndex | IDBCursor;
70327033
transaction: IDBTransaction;
70337034
addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
70347035
addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void;

baselines/webworker.generated.d.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ interface IDBCursor {
275275
direction: string;
276276
key: any;
277277
primaryKey: any;
278-
source: any;
278+
source: IDBObjectStore | IDBIndex;
279279
advance(count: number): void;
280280
continue(key?: any): void;
281281
delete(): IDBRequest;
@@ -313,7 +313,7 @@ interface IDBDatabase extends EventTarget {
313313
close(): void;
314314
createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;
315315
deleteObjectStore(name: string): void;
316-
transaction(storeNames: any, mode?: string): IDBTransaction;
316+
transaction(storeNames: string | string[], mode?: string): IDBTransaction;
317317
addEventListener(type: "abort", listener: (ev: Event) => any, useCapture?: boolean): void;
318318
addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
319319
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
@@ -371,9 +371,10 @@ declare var IDBKeyRange: {
371371

372372
interface IDBObjectStore {
373373
indexNames: DOMStringList;
374-
keyPath: string;
374+
keyPath: string | string[];
375375
name: string;
376376
transaction: IDBTransaction;
377+
autoIncrement: boolean;
377378
add(value: any, key?: any): IDBRequest;
378379
clear(): IDBRequest;
379380
count(key?: any): IDBRequest;
@@ -412,7 +413,7 @@ interface IDBRequest extends EventTarget {
412413
onsuccess: (ev: Event) => any;
413414
readyState: string;
414415
result: any;
415-
source: any;
416+
source: IDBObjectStore | IDBIndex | IDBCursor;
416417
transaction: IDBTransaction;
417418
addEventListener(type: "error", listener: (ev: ErrorEvent) => any, useCapture?: boolean): void;
418419
addEventListener(type: "success", listener: (ev: Event) => any, useCapture?: boolean): void;
@@ -880,9 +881,7 @@ interface DedicatedWorkerGlobalScope {
880881
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
881882
}
882883

883-
interface WorkerUtils extends Object, WindowBase64 {
884-
indexedDB: IDBFactory;
885-
msIndexedDB: IDBFactory;
884+
interface WorkerUtils extends Object, WindowBase64, IDBEnvironment {
886885
navigator: WorkerNavigator;
887886
clearImmediate(handle: number): void;
888887
clearInterval(handle: number): void;

inputfiles/addedTypes.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,5 +360,11 @@
360360
"interface": "StorageEvent",
361361
"name": "storageArea?",
362362
"type": "Storage"
363+
},
364+
{
365+
"kind": "property",
366+
"interface": "IDBObjectStore",
367+
"name": "autoIncrement",
368+
"type": "boolean"
363369
}
364370
]

inputfiles/overridingTypes.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,5 +319,35 @@
319319
"signatures": [
320320
"new (type: string, eventInitDict?: StorageEventInit): StorageEvent"
321321
]
322+
},
323+
{
324+
"kind": "property",
325+
"interface": "IDBCursor",
326+
"name": "source",
327+
"type": "IDBObjectStore | IDBIndex"
328+
},
329+
{
330+
"kind": "method",
331+
"interface": "IDBDatabase",
332+
"name": "transaction",
333+
"signatures": ["transaction(storeNames: string | string[], mode?: string): IDBTransaction"]
334+
},
335+
{
336+
"kind": "property",
337+
"interface": "IDBObjectStore",
338+
"name": "keyPath",
339+
"type": "string | string[]"
340+
},
341+
{
342+
"kind": "property",
343+
"interface": "IDBRequest",
344+
"name": "source",
345+
"type": "IDBObjectStore | IDBIndex | IDBCursor"
346+
},
347+
{
348+
"kind": "interface",
349+
"name": "WorkerUtils",
350+
"flavor": "Worker",
351+
"extends": "Object, WindowBase64, IDBEnvironment"
322352
}
323353
]

inputfiles/removedTypes.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,15 @@
4343
"kind": "property",
4444
"interface": "StorageEvent",
4545
"name": "storageArea"
46+
},
47+
{
48+
"kind": "property",
49+
"interface": "WorkerUtils",
50+
"name": "indexedDB"
51+
},
52+
{
53+
"kind": "property",
54+
"interface": "WorkerUtils",
55+
"name": "msIndexedDB"
4656
}
4757
]

0 commit comments

Comments
 (0)