Skip to content

Commit 837b023

Browse files
susiwen8saschanaz
andauthored
fix: waitUntil and transaction type (#1326)
Co-authored-by: saschanaz <[email protected]>
1 parent aa3050e commit 837b023

10 files changed

+61
-24
lines changed

baselines/dom.generated.d.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,10 @@ interface IDBObjectStoreParameters {
570570
keyPath?: string | string[] | null;
571571
}
572572

573+
interface IDBTransactionOptions {
574+
durability?: IDBTransactionDurability;
575+
}
576+
573577
interface IDBVersionChangeEventInit extends EventInit {
574578
newVersion?: number | null;
575579
oldVersion?: number;
@@ -8506,7 +8510,7 @@ interface IDBDatabase extends EventTarget {
85068510
*/
85078511
deleteObjectStore(name: string): void;
85088512
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
8509-
transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;
8513+
transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
85108514
addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
85118515
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
85128516
removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;

baselines/dom.iterable.generated.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ interface Headers {
101101

102102
interface IDBDatabase {
103103
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
104-
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
104+
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
105105
}
106106

107107
interface IDBObjectStore {

baselines/serviceworker.generated.d.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ interface IDBObjectStoreParameters {
251251
keyPath?: string | string[] | null;
252252
}
253253

254+
interface IDBTransactionOptions {
255+
durability?: IDBTransactionDurability;
256+
}
257+
254258
interface IDBVersionChangeEventInit extends EventInit {
255259
newVersion?: number | null;
256260
oldVersion?: number;
@@ -1385,7 +1389,7 @@ declare var EventTarget: {
13851389

13861390
/** Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries. */
13871391
interface ExtendableEvent extends Event {
1388-
waitUntil(f: any): void;
1392+
waitUntil(f: Promise<any>): void;
13891393
}
13901394

13911395
declare var ExtendableEvent: {
@@ -1706,7 +1710,7 @@ interface IDBDatabase extends EventTarget {
17061710
*/
17071711
deleteObjectStore(name: string): void;
17081712
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
1709-
transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;
1713+
transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
17101714
addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
17111715
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
17121716
removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;

baselines/serviceworker.iterable.generated.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ interface Headers {
3939

4040
interface IDBDatabase {
4141
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
42-
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
42+
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
4343
}
4444

4545
interface IDBObjectStore {

baselines/sharedworker.generated.d.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ interface IDBObjectStoreParameters {
226226
keyPath?: string | string[] | null;
227227
}
228228

229+
interface IDBTransactionOptions {
230+
durability?: IDBTransactionDurability;
231+
}
232+
229233
interface IDBVersionChangeEventInit extends EventInit {
230234
newVersion?: number | null;
231235
oldVersion?: number;
@@ -1625,7 +1629,7 @@ interface IDBDatabase extends EventTarget {
16251629
*/
16261630
deleteObjectStore(name: string): void;
16271631
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
1628-
transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;
1632+
transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
16291633
addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
16301634
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
16311635
removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;

baselines/sharedworker.iterable.generated.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ interface Headers {
3939

4040
interface IDBDatabase {
4141
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
42-
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
42+
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
4343
}
4444

4545
interface IDBObjectStore {

baselines/webworker.generated.d.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ interface IDBObjectStoreParameters {
251251
keyPath?: string | string[] | null;
252252
}
253253

254+
interface IDBTransactionOptions {
255+
durability?: IDBTransactionDurability;
256+
}
257+
254258
interface IDBVersionChangeEventInit extends EventInit {
255259
newVersion?: number | null;
256260
oldVersion?: number;
@@ -1446,7 +1450,7 @@ declare var EventTarget: {
14461450

14471451
/** Extends the lifetime of the install and activate events dispatched on the global scope as part of the service worker lifecycle. This ensures that any functional events (like FetchEvent) are not dispatched until it upgrades database schemas and deletes the outdated cache entries. */
14481452
interface ExtendableEvent extends Event {
1449-
waitUntil(f: any): void;
1453+
waitUntil(f: Promise<any>): void;
14501454
}
14511455

14521456
declare var ExtendableEvent: {
@@ -1781,7 +1785,7 @@ interface IDBDatabase extends EventTarget {
17811785
*/
17821786
deleteObjectStore(name: string): void;
17831787
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
1784-
transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;
1788+
transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
17851789
addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
17861790
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
17871791
removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;

baselines/webworker.iterable.generated.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ interface Headers {
3939

4040
interface IDBDatabase {
4141
/** Returns a new transaction with the given mode ("readonly" or "readwrite") and scope which can be a single object store name or an array of names. */
42-
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
42+
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
4343
}
4444

4545
interface IDBObjectStore {

inputfiles/overridingTypes.jsonc

+35-1
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,23 @@
20102010
"name": "push",
20112011
"type": "PushEvent"
20122012
}
2013-
]
2013+
],
2014+
"methods": {
2015+
"method": {
2016+
"waitUntil": {
2017+
"signature": {
2018+
"0": {
2019+
"param": [
2020+
{
2021+
"name": "f",
2022+
"overrideType": "Promise<any>"
2023+
}
2024+
]
2025+
}
2026+
}
2027+
}
2028+
}
2029+
}
20142030
}
20152031
},
20162032
"Cache": {
@@ -2688,6 +2704,24 @@
26882704
}
26892705
}
26902706
},
2707+
"ExtendableEvent": {
2708+
"methods": {
2709+
"method": {
2710+
"waitUntil": {
2711+
"signature": {
2712+
"0": {
2713+
"param": [
2714+
{
2715+
"name": "f",
2716+
"overrideType": "Promise<any>"
2717+
}
2718+
]
2719+
}
2720+
}
2721+
}
2722+
}
2723+
}
2724+
},
26912725
"EventTarget": {
26922726
"methods": {
26932727
"method": {

inputfiles/removedTypes.jsonc

-13
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,6 @@
5959
"Element": {
6060
"implements": ["GeometryUtils", "Region"]
6161
},
62-
"IDBDatabase": {
63-
"methods": {
64-
"method": {
65-
"transaction": {
66-
"signature": {
67-
"0": {
68-
"param": ["options"]
69-
}
70-
}
71-
}
72-
}
73-
}
74-
},
7562
"Navigator": {
7663
"implements": [
7764
"NavigatorBadge",

0 commit comments

Comments
 (0)