Skip to content

Commit a731b36

Browse files
committed
IDB counts should be Ints, not Doubles.
Acording to https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore/getAll#parameters the max count is 2^32
1 parent e0d2f58 commit a731b36

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

api-reports/2_12.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13605,8 +13605,8 @@ IDBFactory[JC] def cmp(first: Any, second: Any): Int
1360513605
IDBFactory[JC] def databases(): js.Promise[js.Array[IDBDatabaseInfo]]
1360613606
IDBFactory[JC] def deleteDatabase(name: String): IDBOpenDBRequest[Unit]
1360713607
IDBFactory[JC] def open(name: String, version: Int?): IDBOpenDBRequest[IDBDatabase]
13608-
IDBIndex[JC] def count(): IDBRequest[Double]
13609-
IDBIndex[JC] def count(key: Any): IDBRequest[Double]
13608+
IDBIndex[JC] def count(): IDBRequest[Int]
13609+
IDBIndex[JC] def count(key: Any): IDBRequest[Int]
1361013610
IDBIndex[JC] def get(key: Any): IDBRequest[Any]
1361113611
IDBIndex[JC] def getKey(key: Any): IDBRequest[js.UndefOr[Any]]
1361213612
IDBIndex[JC] def keyPath: String
@@ -13625,7 +13625,7 @@ IDBKeyRange[JO] def only(value: Any): IDBKeyRange
1362513625
IDBKeyRange[JO] def upperBound(bound: Any, open: Boolean?): IDBKeyRange
1362613626
IDBObjectStore[JC] def add(value: Any, key: Any?): IDBRequest[Any]
1362713627
IDBObjectStore[JC] def clear(): IDBRequest[Unit]
13628-
IDBObjectStore[JC] def count(key: Any?): IDBRequest[Double]
13628+
IDBObjectStore[JC] def count(key: Any?): IDBRequest[Int]
1362913629
IDBObjectStore[JC] def createIndex(name: String, keyPath: Any, optionalParameters: IDBCreateIndexOptions?): IDBIndex
1363013630
IDBObjectStore[JC] def delete(key: Any): IDBRequest[Unit]
1363113631
IDBObjectStore[JC] def deleteIndex(indexName: String): Unit

api-reports/2_13.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13605,8 +13605,8 @@ IDBFactory[JC] def cmp(first: Any, second: Any): Int
1360513605
IDBFactory[JC] def databases(): js.Promise[js.Array[IDBDatabaseInfo]]
1360613606
IDBFactory[JC] def deleteDatabase(name: String): IDBOpenDBRequest[Unit]
1360713607
IDBFactory[JC] def open(name: String, version: Int?): IDBOpenDBRequest[IDBDatabase]
13608-
IDBIndex[JC] def count(): IDBRequest[Double]
13609-
IDBIndex[JC] def count(key: Any): IDBRequest[Double]
13608+
IDBIndex[JC] def count(): IDBRequest[Int]
13609+
IDBIndex[JC] def count(key: Any): IDBRequest[Int]
1361013610
IDBIndex[JC] def get(key: Any): IDBRequest[Any]
1361113611
IDBIndex[JC] def getKey(key: Any): IDBRequest[js.UndefOr[Any]]
1361213612
IDBIndex[JC] def keyPath: String
@@ -13625,7 +13625,7 @@ IDBKeyRange[JO] def only(value: Any): IDBKeyRange
1362513625
IDBKeyRange[JO] def upperBound(bound: Any, open: Boolean?): IDBKeyRange
1362613626
IDBObjectStore[JC] def add(value: Any, key: Any?): IDBRequest[Any]
1362713627
IDBObjectStore[JC] def clear(): IDBRequest[Unit]
13628-
IDBObjectStore[JC] def count(key: Any?): IDBRequest[Double]
13628+
IDBObjectStore[JC] def count(key: Any?): IDBRequest[Int]
1362913629
IDBObjectStore[JC] def createIndex(name: String, keyPath: Any, optionalParameters: IDBCreateIndexOptions?): IDBIndex
1363013630
IDBObjectStore[JC] def delete(key: Any): IDBRequest[Unit]
1363113631
IDBObjectStore[JC] def deleteIndex(indexName: String): Unit

src/main/scala/org/scalajs/dom/IDBTypes.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class IDBObjectStore extends js.Object {
6464
*/
6565
def keyPath: String = js.native
6666

67-
def count(key: Any = js.native): IDBRequest[Double] = js.native
67+
def count(key: Any = js.native): IDBRequest[Int] = js.native
6868

6969
/** To determine if the add operation has completed successfully, listen for the transaction’s complete event in
7070
* addition to the IDBObjectStore.add request’s success event, because the transaction may still fail after the
@@ -196,12 +196,12 @@ class IDBIndex extends js.Object {
196196
/** The name of the object store referenced by this index. */
197197
def objectStore: IDBObjectStore = js.native
198198

199-
def count(key: Any): IDBRequest[Double] = js.native
199+
def count(key: Any): IDBRequest[Int] = js.native
200200

201201
/** If you want to see how many records are between keys 1000 and 2000 in an object store, you can write the
202202
* following:
203203
*/
204-
def count(): IDBRequest[Double] = js.native
204+
def count(): IDBRequest[Int] = js.native
205205

206206
/** Returns an IDBRequest object, and, in a separate thread, finds either the value in the referenced object store
207207
* that corresponds to the given key or the first corresponding value, if key is a key range.

0 commit comments

Comments
 (0)