Skip to content

Commit a209d6b

Browse files
philipwaltonsandersn
authored andcommitted
Add null types to optional IDB query parameters (#701)
1 parent 499a2e9 commit a209d6b

3 files changed

Lines changed: 24 additions & 24 deletions

File tree

baselines/dom.generated.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9196,13 +9196,13 @@ interface IDBIndex {
91969196
*
91979197
* If successful, request's result will be an Array of the values.
91989198
*/
9199-
getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<any[]>;
9199+
getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>;
92009200
/**
92019201
* Retrieves the keys of records matching the given key or key range in query (up to count if given).
92029202
*
92039203
* If successful, request's result will be an Array of the keys.
92049204
*/
9205-
getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<IDBValidKey[]>;
9205+
getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>;
92069206
/**
92079207
* Retrieves the key of the first record matching the given key or key range in query.
92089208
*
@@ -9214,13 +9214,13 @@ interface IDBIndex {
92149214
*
92159215
* If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records.
92169216
*/
9217-
openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;
9217+
openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;
92189218
/**
92199219
* 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.
92209220
*
92219221
* If successful, request's result will be an IDBCursor, or null if there were no matching records.
92229222
*/
9223-
openKeyCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
9223+
openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
92249224
}
92259225

92269226
declare var IDBIndex: {
@@ -9346,13 +9346,13 @@ interface IDBObjectStore {
93469346
*
93479347
* If successful, request's result will be an Array of the values.
93489348
*/
9349-
getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<any[]>;
9349+
getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>;
93509350
/**
93519351
* Retrieves the keys of records matching the given key or key range in query (up to count if given).
93529352
*
93539353
* If successful, request's result will be an Array of the keys.
93549354
*/
9355-
getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<IDBValidKey[]>;
9355+
getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>;
93569356
/**
93579357
* Retrieves the key of the first record matching the given key or key range in query.
93589358
*
@@ -9365,13 +9365,13 @@ interface IDBObjectStore {
93659365
*
93669366
* If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records.
93679367
*/
9368-
openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;
9368+
openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;
93699369
/**
93709370
* 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.
93719371
*
93729372
* If successful, request's result will be an IDBCursor pointing at the first matching record, or null if there were no matching records.
93739373
*/
9374-
openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
9374+
openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
93759375
/**
93769376
* Adds or updates a record in store with the given value and key.
93779377
*

baselines/webworker.generated.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,13 +1824,13 @@ interface IDBIndex {
18241824
*
18251825
* If successful, request's result will be an Array of the values.
18261826
*/
1827-
getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<any[]>;
1827+
getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>;
18281828
/**
18291829
* Retrieves the keys of records matching the given key or key range in query (up to count if given).
18301830
*
18311831
* If successful, request's result will be an Array of the keys.
18321832
*/
1833-
getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<IDBValidKey[]>;
1833+
getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>;
18341834
/**
18351835
* Retrieves the key of the first record matching the given key or key range in query.
18361836
*
@@ -1842,13 +1842,13 @@ interface IDBIndex {
18421842
*
18431843
* If successful, request's result will be an IDBCursorWithValue, or null if there were no matching records.
18441844
*/
1845-
openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;
1845+
openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;
18461846
/**
18471847
* 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.
18481848
*
18491849
* If successful, request's result will be an IDBCursor, or null if there were no matching records.
18501850
*/
1851-
openKeyCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
1851+
openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
18521852
}
18531853

18541854
declare var IDBIndex: {
@@ -1974,13 +1974,13 @@ interface IDBObjectStore {
19741974
*
19751975
* If successful, request's result will be an Array of the values.
19761976
*/
1977-
getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<any[]>;
1977+
getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>;
19781978
/**
19791979
* Retrieves the keys of records matching the given key or key range in query (up to count if given).
19801980
*
19811981
* If successful, request's result will be an Array of the keys.
19821982
*/
1983-
getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<IDBValidKey[]>;
1983+
getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>;
19841984
/**
19851985
* Retrieves the key of the first record matching the given key or key range in query.
19861986
*
@@ -1993,13 +1993,13 @@ interface IDBObjectStore {
19931993
*
19941994
* If successful, request's result will be an IDBCursorWithValue pointing at the first matching record, or null if there were no matching records.
19951995
*/
1996-
openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;
1996+
openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>;
19971997
/**
19981998
* 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.
19991999
*
20002000
* If successful, request's result will be an IDBCursor pointing at the first matching record, or null if there were no matching records.
20012001
*/
2002-
openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
2002+
openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>;
20032003
/**
20042004
* Adds or updates a record in store with the given value and key.
20052005
*

inputfiles/overridingTypes.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -696,13 +696,13 @@
696696
"openCursor": {
697697
"name": "openCursor",
698698
"override-signatures": [
699-
"openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>"
699+
"openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>"
700700
]
701701
},
702702
"openKeyCursor": {
703703
"name": "openKeyCursor",
704704
"override-signatures": [
705-
"openKeyCursor(query?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>"
705+
"openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>"
706706
]
707707
},
708708
"add": {
@@ -744,13 +744,13 @@
744744
"getAll": {
745745
"name": "getAll",
746746
"override-signatures": [
747-
"getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<any[]>"
747+
"getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>"
748748
]
749749
},
750750
"getAllKeys": {
751751
"name": "getAllKeys",
752752
"override-signatures": [
753-
"getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<IDBValidKey[]>"
753+
"getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>"
754754
]
755755
},
756756
"getKey": {
@@ -802,13 +802,13 @@
802802
"openCursor": {
803803
"name": "openCursor",
804804
"override-signatures": [
805-
"openCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>"
805+
"openCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursorWithValue | null>"
806806
]
807807
},
808808
"openKeyCursor": {
809809
"name": "openKeyCursor",
810810
"override-signatures": [
811-
"openKeyCursor(range?: IDBValidKey | IDBKeyRange, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>"
811+
"openKeyCursor(query?: IDBValidKey | IDBKeyRange | null, direction?: IDBCursorDirection): IDBRequest<IDBCursor | null>"
812812
]
813813
},
814814
"count": {
@@ -826,13 +826,13 @@
826826
"getAll": {
827827
"name": "getAll",
828828
"override-signatures": [
829-
"getAll(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<any[]>"
829+
"getAll(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<any[]>"
830830
]
831831
},
832832
"getAllKeys": {
833833
"name": "getAllKeys",
834834
"override-signatures": [
835-
"getAllKeys(query?: IDBValidKey | IDBKeyRange, count?: number): IDBRequest<IDBValidKey[]>"
835+
"getAllKeys(query?: IDBValidKey | IDBKeyRange | null, count?: number): IDBRequest<IDBValidKey[]>"
836836
]
837837
},
838838
"getKey": {

0 commit comments

Comments
 (0)