forked from rescript-lang/experimental-rescript-webapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIDBFactory.res
More file actions
30 lines (25 loc) · 1.34 KB
/
IDBFactory.res
File metadata and controls
30 lines (25 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
open IndexedDBAPI
/**
Attempts to open a connection to the named database with the current version, or 1 if it does not already exist. If the request is successful request's result will be the connection.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBFactory/open)
*/
@send
external open_: (idbFactory, ~name: string, ~version: int=?) => idbOpenDBRequest = "open"
/**
Attempts to delete the named database. If the database already exists and there are open connections that don't close in response to a versionchange event, the request will be blocked until all they close. If the request is successful request's result will be null.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBFactory/deleteDatabase)
*/
@send
external deleteDatabase: (idbFactory, string) => idbOpenDBRequest = "deleteDatabase"
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBFactory/databases)
*/
@send
external databases: idbFactory => promise<array<idbDatabaseInfo>> = "databases"
/**
Compares two values as keys. Returns -1 if key1 precedes key2, 1 if key2 precedes key1, and 0 if the keys are equal.
Throws a "DataError" DOMException if either input is not a valid key.
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IDBFactory/cmp)
*/
@send
external cmp: (idbFactory, ~first: JSON.t, ~second: JSON.t) => int = "cmp"