Skip to content

fix: waitUntil and transaction type #1326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,10 @@ interface IDBObjectStoreParameters {
keyPath?: string | string[] | null;
}

interface IDBTransactionOptions {
durability?: IDBTransactionDurability;
}

interface IDBVersionChangeEventInit extends EventInit {
newVersion?: number | null;
oldVersion?: number;
Expand Down Expand Up @@ -8495,7 +8499,7 @@ interface IDBDatabase extends EventTarget {
*/
deleteObjectStore(name: string): void;
/** 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. */
transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;
transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
2 changes: 1 addition & 1 deletion baselines/dom.iterable.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ interface Headers {

interface IDBDatabase {
/** 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. */
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
}

interface IDBObjectStore {
Expand Down
8 changes: 6 additions & 2 deletions baselines/serviceworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ interface IDBObjectStoreParameters {
keyPath?: string | string[] | null;
}

interface IDBTransactionOptions {
durability?: IDBTransactionDurability;
}

interface IDBVersionChangeEventInit extends EventInit {
newVersion?: number | null;
oldVersion?: number;
Expand Down Expand Up @@ -1385,7 +1389,7 @@ declare var EventTarget: {

/** 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. */
interface ExtendableEvent extends Event {
waitUntil(f: any): void;
waitUntil(f: Promise<any>): void;
}

declare var ExtendableEvent: {
Expand Down Expand Up @@ -1706,7 +1710,7 @@ interface IDBDatabase extends EventTarget {
*/
deleteObjectStore(name: string): void;
/** 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. */
transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;
transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
2 changes: 1 addition & 1 deletion baselines/serviceworker.iterable.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface Headers {

interface IDBDatabase {
/** 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. */
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
}

interface IDBObjectStore {
Expand Down
6 changes: 5 additions & 1 deletion baselines/sharedworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ interface IDBObjectStoreParameters {
keyPath?: string | string[] | null;
}

interface IDBTransactionOptions {
durability?: IDBTransactionDurability;
}

interface IDBVersionChangeEventInit extends EventInit {
newVersion?: number | null;
oldVersion?: number;
Expand Down Expand Up @@ -1625,7 +1629,7 @@ interface IDBDatabase extends EventTarget {
*/
deleteObjectStore(name: string): void;
/** 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. */
transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;
transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
2 changes: 1 addition & 1 deletion baselines/sharedworker.iterable.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface Headers {

interface IDBDatabase {
/** 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. */
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
}

interface IDBObjectStore {
Expand Down
8 changes: 6 additions & 2 deletions baselines/webworker.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ interface IDBObjectStoreParameters {
keyPath?: string | string[] | null;
}

interface IDBTransactionOptions {
durability?: IDBTransactionDurability;
}

interface IDBVersionChangeEventInit extends EventInit {
newVersion?: number | null;
oldVersion?: number;
Expand Down Expand Up @@ -1446,7 +1450,7 @@ declare var EventTarget: {

/** 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. */
interface ExtendableEvent extends Event {
waitUntil(f: any): void;
waitUntil(f: Promise<any>): void;
}

declare var ExtendableEvent: {
Expand Down Expand Up @@ -1781,7 +1785,7 @@ interface IDBDatabase extends EventTarget {
*/
deleteObjectStore(name: string): void;
/** 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. */
transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;
transaction(storeNames: string | string[], mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
addEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof IDBDatabaseEventMap>(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
Expand Down
2 changes: 1 addition & 1 deletion baselines/webworker.iterable.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface Headers {

interface IDBDatabase {
/** 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. */
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode): IDBTransaction;
transaction(storeNames: string | Iterable<string>, mode?: IDBTransactionMode, options?: IDBTransactionOptions): IDBTransaction;
}

interface IDBObjectStore {
Expand Down
36 changes: 35 additions & 1 deletion inputfiles/overridingTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,23 @@
"name": "push",
"type": "PushEvent"
}
]
],
"methods": {
"method": {
"waitUntil": {
"signature": {
"0": {
"param": [
{
"name": "f",
"overrideType": "Promise<any>"
}
]
}
}
}
}
}
}
},
"Cache": {
Expand Down Expand Up @@ -2688,6 +2704,24 @@
}
}
},
"ExtendableEvent": {
"methods": {
"method": {
"waitUntil": {
"signature": {
"0": {
"param": [
{
"name": "f",
"overrideType": "Promise<any>"
}
]
}
}
}
}
}
},
"EventTarget": {
"methods": {
"method": {
Expand Down
13 changes: 0 additions & 13 deletions inputfiles/removedTypes.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,6 @@
"Element": {
"implements": ["GeometryUtils", "Region"]
},
"IDBDatabase": {
"methods": {
"method": {
"transaction": {
"signature": {
"0": {
"param": ["options"]
}
}
}
}
}
},
"Navigator": {
"implements": [
"NavigatorBadge",
Expand Down