@@ -8312,13 +8312,13 @@ interface IDBCursor {
8312
8312
* Delete the record pointed at by the cursor with a new value.
8313
8313
* If successful, request's result will be undefined.
8314
8314
*/
8315
- delete(): IDBRequest;
8315
+ delete(): IDBRequest<undefined> ;
8316
8316
/**
8317
8317
* Updated the record pointed at by the cursor with a new value.
8318
8318
* Throws a "DataError" DOMException if the effective object store uses in-line keys and the key would have changed.
8319
8319
* If successful, request's result will be the record's key.
8320
8320
*/
8321
- update(value: any): IDBRequest;
8321
+ update(value: any): IDBRequest<IDBValidKey> ;
8322
8322
}
8323
8323
8324
8324
declare var IDBCursor: {
@@ -8444,40 +8444,40 @@ interface IDBIndex {
8444
8444
* If successful, request's result will be the
8445
8445
* count.
8446
8446
*/
8447
- count(key?: IDBValidKey | IDBKeyRange): IDBRequest;
8447
+ count(key?: IDBValidKey | IDBKeyRange): IDBRequest<number> ;
8448
8448
/**
8449
8449
* Retrieves the value of the first record matching the
8450
8450
* given key or key range in query.
8451
8451
* If successful, request's result will be the value, or undefined if there was no matching record.
8452
8452
*/
8453
- get(key: IDBValidKey | IDBKeyRange): IDBRequest;
8453
+ get(key: IDBValidKey | IDBKeyRange): IDBRequest<any | undefined> ;
8454
8454
/**
8455
8455
* Retrieves the values of the records matching the given key or key range in query (up to count if given).
8456
8456
* If successful, request's result will be an Array of the values.
8457
8457
*/
8458
- getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest;
8458
+ getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<any[]> ;
8459
8459
/**
8460
8460
* Retrieves the keys of records matching the given key or key range in query (up to count if given).
8461
8461
* If successful, request's result will be an Array of the keys.
8462
8462
*/
8463
- getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest;
8463
+ getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<IDBValidKey[]> ;
8464
8464
/**
8465
8465
* Retrieves the key of the first record matching the
8466
8466
* given key or key range in query.
8467
8467
* If successful, request's result will be the key, or undefined if there was no matching record.
8468
8468
*/
8469
- getKey(key: IDBValidKey | IDBKeyRange): IDBRequest;
8469
+ getKey(key: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey | undefined> ;
8470
8470
/**
8471
8471
* Opens a cursor over the records matching query,
8472
8472
* ordered by direction. If query is null, all records in index are matched.
8473
8473
* If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records.
8474
8474
*/
8475
- openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest;
8475
+ openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null> ;
8476
8476
/**
8477
8477
* Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in index are matched.
8478
8478
* If successful, request's result will be an IDBCursor, or null if there were no matching records.
8479
8479
*/
8480
- openKeyCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest;
8480
+ openKeyCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null> ;
8481
8481
}
8482
8482
8483
8483
declare var IDBIndex: {
@@ -8556,19 +8556,19 @@ interface IDBObjectStore {
8556
8556
* Returns the associated transaction.
8557
8557
*/
8558
8558
readonly transaction: IDBTransaction;
8559
- add(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest;
8559
+ add(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey> ;
8560
8560
/**
8561
8561
* Deletes all records in store.
8562
8562
* If successful, request's result will
8563
8563
* be undefined.
8564
8564
*/
8565
- clear(): IDBRequest;
8565
+ clear(): IDBRequest<undefined> ;
8566
8566
/**
8567
8567
* Retrieves the number of records matching the
8568
8568
* given key or key range in query.
8569
8569
* If successful, request's result will be the count.
8570
8570
*/
8571
- count(key?: IDBValidKey | IDBKeyRange): IDBRequest;
8571
+ count(key?: IDBValidKey | IDBKeyRange): IDBRequest<number> ;
8572
8572
/**
8573
8573
* Creates a new index in store with the given name, keyPath and options and returns a new IDBIndex. If the keyPath and options define constraints that cannot be
8574
8574
* satisfied with the data already in store the upgrade
@@ -8583,7 +8583,7 @@ interface IDBObjectStore {
8583
8583
* If successful, request's result will
8584
8584
* be undefined.
8585
8585
*/
8586
- delete(key: IDBValidKey | IDBKeyRange): IDBRequest;
8586
+ delete(key: IDBValidKey | IDBKeyRange): IDBRequest<undefined> ;
8587
8587
/**
8588
8588
* Deletes the index in store with the given name.
8589
8589
* Throws an "InvalidStateError" DOMException if not called within an upgrade
@@ -8595,41 +8595,41 @@ interface IDBObjectStore {
8595
8595
* given key or key range in query.
8596
8596
* If successful, request's result will be the value, or undefined if there was no matching record.
8597
8597
*/
8598
- get(query: IDBValidKey | IDBKeyRange): IDBRequest;
8598
+ get(query: IDBValidKey | IDBKeyRange): IDBRequest<any | undefined> ;
8599
8599
/**
8600
8600
* Retrieves the values of the records matching the
8601
8601
* given key or key range in query (up to count if given).
8602
8602
* If successful, request's result will
8603
8603
* be an Array of the values.
8604
8604
*/
8605
- getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest;
8605
+ getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<any[]> ;
8606
8606
/**
8607
8607
* Retrieves the keys of records matching the
8608
8608
* given key or key range in query (up to count if given).
8609
8609
* If successful, request's result will
8610
8610
* be an Array of the keys.
8611
8611
*/
8612
- getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest;
8612
+ getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<IDBValidKey[]> ;
8613
8613
/**
8614
8614
* Retrieves the key of the first record matching the
8615
8615
* given key or key range in query.
8616
8616
* If successful, request's result will be the key, or undefined if there was no matching record.
8617
8617
*/
8618
- getKey(query: IDBValidKey | IDBKeyRange): IDBRequest;
8618
+ getKey(query: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey | undefined> ;
8619
8619
index(name: string): IDBIndex;
8620
8620
/**
8621
8621
* Opens a cursor over the records matching query,
8622
8622
* ordered by direction. If query is null, all records in store are matched.
8623
8623
* If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records.
8624
8624
*/
8625
- openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest;
8625
+ openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null> ;
8626
8626
/**
8627
8627
* Opens a cursor with key only flag set over the records matching query, ordered by direction. If query is null, all records in store are matched.
8628
8628
* If successful, request's result will be an IDBCursor pointing at the first matching record, or
8629
8629
* null if there were no matching records.
8630
8630
*/
8631
- openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest;
8632
- put(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest;
8631
+ openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null> ;
8632
+ put(value: any, key?: IDBValidKey | IDBKeyRange): IDBRequest<IDBValidKey> ;
8633
8633
}
8634
8634
8635
8635
declare var IDBObjectStore: {
@@ -8642,7 +8642,7 @@ interface IDBOpenDBRequestEventMap extends IDBRequestEventMap {
8642
8642
"upgradeneeded": IDBVersionChangeEvent;
8643
8643
}
8644
8644
8645
- interface IDBOpenDBRequest extends IDBRequest {
8645
+ interface IDBOpenDBRequest extends IDBRequest<IDBDatabase> {
8646
8646
onblocked: ((this: IDBOpenDBRequest, ev: Event) => any) | null;
8647
8647
onupgradeneeded: ((this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any) | null;
8648
8648
addEventListener<K extends keyof IDBOpenDBRequestEventMap>(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -8661,14 +8661,14 @@ interface IDBRequestEventMap {
8661
8661
"success": Event;
8662
8662
}
8663
8663
8664
- interface IDBRequest extends EventTarget {
8664
+ interface IDBRequest<T = any> extends EventTarget {
8665
8665
/**
8666
8666
* When a request is completed, returns the error (a DOMException), or null if the request succeeded. Throws
8667
8667
* a "InvalidStateError" DOMException if the request is still pending.
8668
8668
*/
8669
8669
readonly error: DOMException | null;
8670
- onerror: ((this: IDBRequest, ev: Event) => any) | null;
8671
- onsuccess: ((this: IDBRequest, ev: Event) => any) | null;
8670
+ onerror: ((this: IDBRequest<T> , ev: Event) => any) | null;
8671
+ onsuccess: ((this: IDBRequest<T> , ev: Event) => any) | null;
8672
8672
/**
8673
8673
* Returns "pending" until a request is complete,
8674
8674
* then returns "done".
@@ -8679,7 +8679,7 @@ interface IDBRequest extends EventTarget {
8679
8679
* or undefined if the request failed. Throws a
8680
8680
* "InvalidStateError" DOMException if the request is still pending.
8681
8681
*/
8682
- readonly result: any ;
8682
+ readonly result: T ;
8683
8683
/**
8684
8684
* Returns the IDBObjectStore, IDBIndex, or IDBCursor the request was made against, or null if is was an open
8685
8685
* request.
@@ -8690,9 +8690,9 @@ interface IDBRequest extends EventTarget {
8690
8690
* If this as an open request, then it returns an upgrade transaction while it is running, or null otherwise.
8691
8691
*/
8692
8692
readonly transaction: IDBTransaction | null;
8693
- addEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
8693
+ addEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest<T> , ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
8694
8694
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
8695
- removeEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
8695
+ removeEventListener<K extends keyof IDBRequestEventMap>(type: K, listener: (this: IDBRequest<T> , ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
8696
8696
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
8697
8697
}
8698
8698
@@ -17043,4 +17043,4 @@ type VRDisplayEventReason = "mounted" | "navigation" | "requested" | "unmounted"
17043
17043
type VideoFacingModeEnum = "user" | "environment" | "left" | "right";
17044
17044
type VisibilityState = "hidden" | "visible" | "prerender";
17045
17045
type WorkerType = "classic" | "module";
17046
- type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";
17046
+ type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";
0 commit comments