Skip to content

Commit 1a6fc9c

Browse files
committed
Improve precision of IDB API and add tests
1 parent 23aef73 commit 1a6fc9c

File tree

10 files changed

+414
-156
lines changed

10 files changed

+414
-156
lines changed

api-reports/2_12.txt

+81-41
Original file line numberDiff line numberDiff line change
@@ -13530,32 +13530,43 @@ HttpMethod[SO] val PATCH: HttpMethod
1353013530
HttpMethod[SO] val POST: HttpMethod
1353113531
HttpMethod[SO] val PUT: HttpMethod
1353213532
HttpMethod[SO] val QUERY: HttpMethod
13533+
IDBCreateIndexOptions[JT] val locale: js.UndefOr[String]
13534+
IDBCreateIndexOptions[JT] val multiEntry: js.UndefOr[Boolean]
13535+
IDBCreateIndexOptions[JT] val unique: js.UndefOr[Boolean]
13536+
IDBCreateObjectStoreOptions[JT] val autoIncrement: js.UndefOr[Boolean]
13537+
IDBCreateObjectStoreOptions[JT] val keyPath: Any
1353313538
IDBCursor[JC] def advance(count: Int): Unit
13534-
IDBCursor[JC] def continue(key: js.Any?): Unit
13535-
IDBCursor[JC] def delete(): IDBRequest
13539+
IDBCursor[JC] def continue(key: Any?): Unit
13540+
IDBCursor[JC] def delete(): IDBRequest[Unit]
1353613541
IDBCursor[JC] def direction: IDBCursorDirection
13537-
IDBCursor[JC] def key: js.Any
13542+
IDBCursor[JC] def key: Any
1353813543
IDBCursor[JC] def primaryKey: js.Any
1353913544
IDBCursor[JC] def source: js.Any
13540-
IDBCursor[JC] def update(value: js.Any): IDBRequest
13545+
IDBCursor[JC] def update(value: js.Any): IDBRequest[Any]
1354113546
IDBCursorDirection[JT]
1354213547
IDBCursorDirection[SO] val NEXT: IDBCursorDirection
1354313548
IDBCursorDirection[SO] val NEXT_UNIQUE: IDBCursorDirection
1354413549
IDBCursorDirection[SO] val PREV: IDBCursorDirection
1354513550
IDBCursorDirection[SO] val PREV_UNIQUE: IDBCursorDirection
13551+
IDBCursorReadOnly[JC] def advance(count: Int): Unit
13552+
IDBCursorReadOnly[JC] def continue(key: Any?): Unit
13553+
IDBCursorReadOnly[JC] def direction: IDBCursorDirection
13554+
IDBCursorReadOnly[JC] def key: Any
13555+
IDBCursorReadOnly[JC] def primaryKey: js.Any
13556+
IDBCursorReadOnly[JC] def source: js.Any
1354613557
IDBCursorWithValue[JC] def advance(count: Int): Unit
13547-
IDBCursorWithValue[JC] def continue(key: js.Any?): Unit
13548-
IDBCursorWithValue[JC] def delete(): IDBRequest
13558+
IDBCursorWithValue[JC] def continue(key: Any?): Unit
13559+
IDBCursorWithValue[JC] def delete(): IDBRequest[Unit]
1354913560
IDBCursorWithValue[JC] def direction: IDBCursorDirection
13550-
IDBCursorWithValue[JC] def key: js.Any
13561+
IDBCursorWithValue[JC] def key: Any
1355113562
IDBCursorWithValue[JC] def primaryKey: js.Any
1355213563
IDBCursorWithValue[JC] def source: js.Any
13553-
IDBCursorWithValue[JC] def update(value: js.Any): IDBRequest
13564+
IDBCursorWithValue[JC] def update(value: js.Any): IDBRequest[Any]
1355413565
IDBCursorWithValue[JC] def value: js.Any
1355513566
IDBDatabase[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
1355613567
IDBDatabase[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
1355713568
IDBDatabase[JC] def close(): Unit
13558-
IDBDatabase[JC] def createObjectStore(name: String, optionalParameters: js.Any?): IDBObjectStore
13569+
IDBDatabase[JC] def createObjectStore(name: String, optionalParameters: js.UndefOr[IDBCreateObjectStoreOptions]?): IDBObjectStore
1355913570
IDBDatabase[JC] def deleteObjectStore(name: String): Unit
1356013571
IDBDatabase[JC] def dispatchEvent(evt: Event): Boolean
1356113572
IDBDatabase[JC] def name: String
@@ -13567,20 +13578,42 @@ IDBDatabase[JC] def removeEventListener[T <: Event](`type`: String, listener: js
1356713578
IDBDatabase[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
1356813579
IDBDatabase[JC] def transaction(storeNames: js.Any, mode: IDBTransactionMode?): IDBTransaction
1356913580
IDBDatabase[JC] def version: Int
13581+
IDBDatabaseInfo[JT] val name: String
13582+
IDBDatabaseInfo[JT] val version: Int
1357013583
IDBEnvironment[JT] def indexedDB: IDBFactory (@deprecated in 1.2.0)
13584+
IDBEvent[JC] def bubbles: Boolean
13585+
IDBEvent[JC] def cancelBubble: Boolean
13586+
IDBEvent[JC] def cancelable: Boolean
13587+
IDBEvent[JC] def currentTarget: EventTarget
13588+
IDBEvent[JC] def defaultPrevented: Boolean
13589+
IDBEvent[JC] def eventPhase: Int
13590+
IDBEvent[JC] def isTrusted: Boolean
13591+
IDBEvent[JC] def preventDefault(): Unit
13592+
IDBEvent[JC] def stopImmediatePropagation(): Unit
13593+
IDBEvent[JC] def stopPropagation(): Unit
13594+
IDBEvent[JC] def target: EventTarget
13595+
IDBEvent[JC] override def target: IDBEventTarget[A]
13596+
IDBEvent[JC] def timeStamp: Double
13597+
IDBEvent[JC] def `type`: String
13598+
IDBEventTarget[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
13599+
IDBEventTarget[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
13600+
IDBEventTarget[JC] def dispatchEvent(evt: Event): Boolean
13601+
IDBEventTarget[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
13602+
IDBEventTarget[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
13603+
IDBEventTarget[JC] def result: A
1357113604
IDBFactory[JC] def cmp(first: js.Any, second: js.Any): Int
13572-
IDBFactory[JC] def deleteDatabase(name: String): IDBOpenDBRequest
13573-
IDBFactory[JC] def open(name: String): IDBOpenDBRequest
13574-
IDBFactory[JC] def open(name: String, version: Int): IDBOpenDBRequest
13575-
IDBIndex[JC] def count(): IDBRequest
13576-
IDBIndex[JC] def count(key: js.Any): IDBRequest
13577-
IDBIndex[JC] def get(key: js.Any): IDBRequest
13578-
IDBIndex[JC] def getKey(key: js.Any): IDBRequest
13605+
IDBFactory[JC] def databases(): js.Promise[js.Array[IDBDatabaseInfo]]
13606+
IDBFactory[JC] def deleteDatabase(name: String): IDBOpenDBRequest[Unit]
13607+
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]
13610+
IDBIndex[JC] def get(key: Any): IDBRequest[js.Any]
13611+
IDBIndex[JC] def getKey(key: Any): IDBRequest[js.UndefOr[js.Any]]
1357913612
IDBIndex[JC] def keyPath: String
1358013613
IDBIndex[JC] def name: String
1358113614
IDBIndex[JC] def objectStore: IDBObjectStore
13582-
IDBIndex[JC] def openCursor(range: IDBKeyRange?, direction: IDBCursorDirection?): IDBRequest
13583-
IDBIndex[JC] def openKeyCursor(range: IDBKeyRange?, direction: IDBCursorDirection?): IDBRequest
13615+
IDBIndex[JC] def openCursor(range: IDBKeyRange?, direction: IDBCursorDirection?): IDBRequest[IDBCursor]
13616+
IDBIndex[JC] def openKeyCursor(range: IDBKeyRange?, direction: IDBCursorDirection?): IDBRequest[IDBCursorReadOnly]
1358413617
IDBIndex[JC] def unique: Boolean
1358513618
IDBKeyRange[JC] def lower: js.Any
1358613619
IDBKeyRange[JC] def lowerOpen: Boolean
@@ -13590,48 +13623,48 @@ IDBKeyRange[JO] def bound(lower: js.Any, upper: js.Any, lowerOpen: Boolean?, upp
1359013623
IDBKeyRange[JO] def lowerBound(bound: js.Any, open: Boolean?): IDBKeyRange
1359113624
IDBKeyRange[JO] def only(value: js.Any): IDBKeyRange
1359213625
IDBKeyRange[JO] def upperBound(bound: js.Any, open: Boolean?): IDBKeyRange
13593-
IDBObjectStore[JC] def add(value: js.Any, key: js.Any?): IDBRequest
13594-
IDBObjectStore[JC] def clear(): IDBRequest
13595-
IDBObjectStore[JC] def count(key: js.Any?): IDBRequest
13596-
IDBObjectStore[JC] def createIndex(name: String, keyPath: String, optionalParameters: js.Any?): IDBIndex
13597-
IDBObjectStore[JC] def delete(key: js.Any): IDBRequest
13626+
IDBObjectStore[JC] def add(value: js.Any, key: Any?): IDBRequest[Any]
13627+
IDBObjectStore[JC] def clear(): IDBRequest[Unit]
13628+
IDBObjectStore[JC] def count(key: Any?): IDBRequest[Double]
13629+
IDBObjectStore[JC] def createIndex(name: String, keyPath: Any, optionalParameters: IDBCreateIndexOptions?): IDBIndex
13630+
IDBObjectStore[JC] def delete(key: Any): IDBRequest[Unit]
1359813631
IDBObjectStore[JC] def deleteIndex(indexName: String): Unit
13599-
IDBObjectStore[JC] def get(key: js.Any): IDBRequest
13600-
IDBObjectStore[JC] def getAll(query: js.UndefOr[IDBKeyRange | js.Any]?, count: js.UndefOr[Int]?): IDBRequest
13601-
IDBObjectStore[JC] def getAllKeys(query: js.UndefOr[IDBKeyRange | js.Any]?, count: js.UndefOr[Int]?): IDBRequest
13602-
IDBObjectStore[JC] def getKey(key: js.Any): IDBRequest
13632+
IDBObjectStore[JC] def get(key: Any): IDBRequest[js.Any]
13633+
IDBObjectStore[JC] def getAll(query: js.UndefOr[IDBKeyRange | Any]?, count: js.UndefOr[Int]?): IDBRequest[js.Array[js.Any]]
13634+
IDBObjectStore[JC] def getAllKeys(query: js.UndefOr[IDBKeyRange | Any]?, count: js.UndefOr[Int]?): IDBRequest[js.Array[Any]]
13635+
IDBObjectStore[JC] def getKey(key: Any): IDBRequest[js.UndefOr[Any]]
1360313636
IDBObjectStore[JC] def index(name: String): IDBIndex
1360413637
IDBObjectStore[JC] def indexNames: DOMStringList
1360513638
IDBObjectStore[JC] def keyPath: String
1360613639
IDBObjectStore[JC] def name: String
13607-
IDBObjectStore[JC] def openCursor(range: js.UndefOr[IDBKeyRange | js.Any]?, direction: js.UndefOr[IDBCursorDirection]?): IDBRequest
13608-
IDBObjectStore[JC] def openKeyCursor(range: js.UndefOr[IDBKeyRange | js.Any]?, direction: js.UndefOr[IDBCursorDirection]?): IDBRequest
13609-
IDBObjectStore[JC] def put(value: js.Any, key: js.Any?): IDBRequest
13640+
IDBObjectStore[JC] def openCursor(range: js.UndefOr[IDBKeyRange | Any]?, direction: js.UndefOr[IDBCursorDirection]?): IDBRequest[IDBCursor]
13641+
IDBObjectStore[JC] def openKeyCursor(range: js.UndefOr[IDBKeyRange | Any]?, direction: js.UndefOr[IDBCursorDirection]?): IDBRequest[IDBCursorReadOnly]
13642+
IDBObjectStore[JC] def put(value: js.Any, key: Any?): IDBRequest[Any]
1361013643
IDBObjectStore[JC] def transaction: IDBTransaction
1361113644
IDBOpenDBRequest[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
1361213645
IDBOpenDBRequest[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
1361313646
IDBOpenDBRequest[JC] def dispatchEvent(evt: Event): Boolean
1361413647
IDBOpenDBRequest[JC] def error: DOMException
1361513648
IDBOpenDBRequest[JC] var onblocked: js.Function1[IDBVersionChangeEvent, _]
1361613649
IDBOpenDBRequest[JC] var onerror: js.Function1[Event, _]
13617-
IDBOpenDBRequest[JC] var onsuccess: js.Function1[Event, _]
13650+
IDBOpenDBRequest[JC] var onsuccess: js.Function1[IDBEvent[A], _]
1361813651
IDBOpenDBRequest[JC] var onupgradeneeded: js.Function1[IDBVersionChangeEvent, _]
1361913652
IDBOpenDBRequest[JC] def readyState: String
1362013653
IDBOpenDBRequest[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
1362113654
IDBOpenDBRequest[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
13622-
IDBOpenDBRequest[JC] def result: js.Any
13655+
IDBOpenDBRequest[JC] def result: A
1362313656
IDBOpenDBRequest[JC] def source: js.Any
1362413657
IDBOpenDBRequest[JC] def transaction: IDBTransaction
1362513658
IDBRequest[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
1362613659
IDBRequest[JC] def addEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
1362713660
IDBRequest[JC] def dispatchEvent(evt: Event): Boolean
1362813661
IDBRequest[JC] def error: DOMException
1362913662
IDBRequest[JC] var onerror: js.Function1[Event, _]
13630-
IDBRequest[JC] var onsuccess: js.Function1[Event, _]
13663+
IDBRequest[JC] var onsuccess: js.Function1[IDBEvent[A], _]
1363113664
IDBRequest[JC] def readyState: String
1363213665
IDBRequest[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
1363313666
IDBRequest[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
13634-
IDBRequest[JC] def result: js.Any
13667+
IDBRequest[JC] def result: A
1363513668
IDBRequest[JC] def source: js.Any
1363613669
IDBRequest[JC] def transaction: IDBTransaction
1363713670
IDBTransaction[JC] def abort(): Unit
@@ -13648,9 +13681,9 @@ IDBTransaction[JC] var onerror: js.Function1[Event, _]
1364813681
IDBTransaction[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], options: EventListenerOptions): Unit
1364913682
IDBTransaction[JC] def removeEventListener[T <: Event](`type`: String, listener: js.Function1[T, _], useCapture: Boolean?): Unit
1365013683
IDBTransactionMode[JT]
13651-
IDBTransactionMode[SO] val READ_ONLY: IDBTransactionMode
13652-
IDBTransactionMode[SO] val READ_WRITE: IDBTransactionMode
13653-
IDBTransactionMode[SO] val VERSION_CHANGE: IDBTransactionMode
13684+
IDBTransactionMode[SO] val readonly: IDBTransactionMode
13685+
IDBTransactionMode[SO] val readwrite: IDBTransactionMode
13686+
IDBTransactionMode[SO] val versionchange: IDBTransactionMode
1365413687
IDBVersionChangeEvent[JC] def bubbles: Boolean
1365513688
IDBVersionChangeEvent[JC] def cancelBubble: Boolean
1365613689
IDBVersionChangeEvent[JC] def cancelable: Boolean
@@ -13664,6 +13697,7 @@ IDBVersionChangeEvent[JC] def preventDefault(): Unit
1366413697
IDBVersionChangeEvent[JC] def stopImmediatePropagation(): Unit
1366513698
IDBVersionChangeEvent[JC] def stopPropagation(): Unit
1366613699
IDBVersionChangeEvent[JC] def target: EventTarget
13700+
IDBVersionChangeEvent[JC] override def target: IDBEventTarget[A]
1366713701
IDBVersionChangeEvent[JC] def timeStamp: Double
1366813702
IDBVersionChangeEvent[JC] def `type`: String
1366913703
IDBVersionChangeEventInit[JT] var bubbles: js.UndefOr[Boolean]
@@ -25561,16 +25595,22 @@ html[SO] type UList = HTMLUListElement
2556125595
html[SO] type Unknown = HTMLUnknownElement
2556225596
html[SO] type Video = HTMLVideoElement
2556325597
html[SO] def Media = HTMLMediaElement
25598+
idb[SO] type CreateIndexOptions = IDBCreateIndexOptions
25599+
idb[SO] type CreateObjectStoreOptions = IDBCreateObjectStoreOptions
2556425600
idb[SO] type Cursor = IDBCursor
25601+
idb[SO] type CursorReadOnly = IDBCursorReadOnly
2556525602
idb[SO] type CursorWithValue = IDBCursorWithValue
2556625603
idb[SO] type Database = IDBDatabase
25604+
idb[SO] type DatabaseInfo = IDBDatabaseInfo
2556725605
idb[SO] type Environment = IDBEnvironment (@deprecated in 1.2.0)
25606+
idb[SO] type EventTarget[+A] = IDBEventTarget[A]
25607+
idb[SO] type Event[+A] = IDBEvent[A]
2556825608
idb[SO] type Factory = IDBFactory
2556925609
idb[SO] type Index = IDBIndex
2557025610
idb[SO] type KeyRange = IDBKeyRange
2557125611
idb[SO] type ObjectStore = IDBObjectStore
25572-
idb[SO] type OpenDBRequest = IDBOpenDBRequest
25573-
idb[SO] type Request = IDBRequest
25612+
idb[SO] type OpenDBRequest[A] = IDBOpenDBRequest[A]
25613+
idb[SO] type Request[A] = IDBRequest[A]
2557425614
idb[SO] type Transaction = IDBTransaction
2557525615
idb[SO] type VersionChangeEvent = IDBVersionChangeEvent
2557625616
idb[SO] def CursorDirection = IDBCursorDirection
@@ -25744,8 +25784,8 @@ raw[SO] type IDBFactory = dom.IDBFactory (@deprecated in 2.0.0)
2574425784
raw[SO] type IDBIndex = dom.IDBIndex (@deprecated in 2.0.0)
2574525785
raw[SO] type IDBKeyRange = dom.IDBKeyRange (@deprecated in 2.0.0)
2574625786
raw[SO] type IDBObjectStore = dom.IDBObjectStore (@deprecated in 2.0.0)
25747-
raw[SO] type IDBOpenDBRequest = dom.IDBOpenDBRequest (@deprecated in 2.0.0)
25748-
raw[SO] type IDBRequest = dom.IDBRequest (@deprecated in 2.0.0)
25787+
raw[SO] type IDBOpenDBRequest = dom.IDBOpenDBRequest[js.Any] (@deprecated in 2.0.0)
25788+
raw[SO] type IDBRequest = dom.IDBRequest[js.Any] (@deprecated in 2.0.0)
2574925789
raw[SO] type IDBTransaction = dom.IDBTransaction (@deprecated in 2.0.0)
2575025790
raw[SO] type IDBVersionChangeEvent = dom.IDBVersionChangeEvent (@deprecated in 2.0.0)
2575125791
raw[SO] type ImageBitmap = dom.ImageBitmap (@deprecated in 2.0.0)

0 commit comments

Comments
 (0)