0 | module Web.Internal.IndexedDBTypes
11 | namespace IDBRequestReadyState
14 | data IDBRequestReadyState = Pending | Done
17 | Show IDBRequestReadyState where
18 | show Pending = "pending"
22 | Eq IDBRequestReadyState where
23 | (==) = (==) `on` show
26 | Ord IDBRequestReadyState where
27 | compare = compare `on` show
30 | read : String -> Maybe IDBRequestReadyState
31 | read "pending" = Just Pending
32 | read "done" = Just Done
36 | ToFFI IDBRequestReadyState String where
40 | FromFFI IDBRequestReadyState String where
44 | namespace IDBTransactionDurability
47 | data IDBTransactionDurability = Default | Strict | Relaxed
50 | Show IDBTransactionDurability where
51 | show Default = "default"
52 | show Strict = "strict"
53 | show Relaxed = "relaxed"
56 | Eq IDBTransactionDurability where
57 | (==) = (==) `on` show
60 | Ord IDBTransactionDurability where
61 | compare = compare `on` show
64 | read : String -> Maybe IDBTransactionDurability
65 | read "default" = Just Default
66 | read "strict" = Just Strict
67 | read "relaxed" = Just Relaxed
71 | ToFFI IDBTransactionDurability String where
75 | FromFFI IDBTransactionDurability String where
79 | namespace IDBCursorDirection
82 | data IDBCursorDirection = Next | Nextunique | Prev | Prevunique
85 | Show IDBCursorDirection where
87 | show Nextunique = "nextunique"
89 | show Prevunique = "prevunique"
92 | Eq IDBCursorDirection where
93 | (==) = (==) `on` show
96 | Ord IDBCursorDirection where
97 | compare = compare `on` show
100 | read : String -> Maybe IDBCursorDirection
101 | read "next" = Just Next
102 | read "nextunique" = Just Nextunique
103 | read "prev" = Just Prev
104 | read "prevunique" = Just Prevunique
108 | ToFFI IDBCursorDirection String where
112 | FromFFI IDBCursorDirection String where
116 | namespace IDBTransactionMode
119 | data IDBTransactionMode = Readonly | Readwrite | Versionchange
122 | Show IDBTransactionMode where
123 | show Readonly = "readonly"
124 | show Readwrite = "readwrite"
125 | show Versionchange = "versionchange"
128 | Eq IDBTransactionMode where
129 | (==) = (==) `on` show
132 | Ord IDBTransactionMode where
133 | compare = compare `on` show
136 | read : String -> Maybe IDBTransactionMode
137 | read "readonly" = Just Readonly
138 | read "readwrite" = Just Readwrite
139 | read "versionchange" = Just Versionchange
143 | ToFFI IDBTransactionMode String where
147 | FromFFI IDBTransactionMode String where
156 | export data IDBCursor : Type where [external]
159 | ToFFI IDBCursor IDBCursor where toFFI = id
162 | FromFFI IDBCursor IDBCursor where fromFFI = Just
165 | SafeCast IDBCursor where
166 | safeCast = unsafeCastOnPrototypeName "IDBCursor"
168 | export data IDBCursorWithValue : Type where [external]
171 | ToFFI IDBCursorWithValue IDBCursorWithValue where toFFI = id
174 | FromFFI IDBCursorWithValue IDBCursorWithValue where fromFFI = Just
177 | SafeCast IDBCursorWithValue where
178 | safeCast = unsafeCastOnPrototypeName "IDBCursorWithValue"
180 | export data IDBDatabase : Type where [external]
183 | ToFFI IDBDatabase IDBDatabase where toFFI = id
186 | FromFFI IDBDatabase IDBDatabase where fromFFI = Just
189 | SafeCast IDBDatabase where
190 | safeCast = unsafeCastOnPrototypeName "IDBDatabase"
192 | export data IDBFactory : Type where [external]
195 | ToFFI IDBFactory IDBFactory where toFFI = id
198 | FromFFI IDBFactory IDBFactory where fromFFI = Just
201 | SafeCast IDBFactory where
202 | safeCast = unsafeCastOnPrototypeName "IDBFactory"
204 | export data IDBIndex : Type where [external]
207 | ToFFI IDBIndex IDBIndex where toFFI = id
210 | FromFFI IDBIndex IDBIndex where fromFFI = Just
213 | SafeCast IDBIndex where
214 | safeCast = unsafeCastOnPrototypeName "IDBIndex"
216 | export data IDBKeyRange : Type where [external]
219 | ToFFI IDBKeyRange IDBKeyRange where toFFI = id
222 | FromFFI IDBKeyRange IDBKeyRange where fromFFI = Just
225 | SafeCast IDBKeyRange where
226 | safeCast = unsafeCastOnPrototypeName "IDBKeyRange"
228 | export data IDBObjectStore : Type where [external]
231 | ToFFI IDBObjectStore IDBObjectStore where toFFI = id
234 | FromFFI IDBObjectStore IDBObjectStore where fromFFI = Just
237 | SafeCast IDBObjectStore where
238 | safeCast = unsafeCastOnPrototypeName "IDBObjectStore"
240 | export data IDBOpenDBRequest : Type where [external]
243 | ToFFI IDBOpenDBRequest IDBOpenDBRequest where toFFI = id
246 | FromFFI IDBOpenDBRequest IDBOpenDBRequest where fromFFI = Just
249 | SafeCast IDBOpenDBRequest where
250 | safeCast = unsafeCastOnPrototypeName "IDBOpenDBRequest"
252 | export data IDBRequest : Type where [external]
255 | ToFFI IDBRequest IDBRequest where toFFI = id
258 | FromFFI IDBRequest IDBRequest where fromFFI = Just
261 | SafeCast IDBRequest where
262 | safeCast = unsafeCastOnPrototypeName "IDBRequest"
264 | export data IDBTransaction : Type where [external]
267 | ToFFI IDBTransaction IDBTransaction where toFFI = id
270 | FromFFI IDBTransaction IDBTransaction where fromFFI = Just
273 | SafeCast IDBTransaction where
274 | safeCast = unsafeCastOnPrototypeName "IDBTransaction"
276 | export data IDBVersionChangeEvent : Type where [external]
279 | ToFFI IDBVersionChangeEvent IDBVersionChangeEvent where toFFI = id
282 | FromFFI IDBVersionChangeEvent IDBVersionChangeEvent where fromFFI = Just
285 | SafeCast IDBVersionChangeEvent where
286 | safeCast = unsafeCastOnPrototypeName "IDBVersionChangeEvent"
293 | export data IDBDatabaseInfo : Type where [external]
296 | ToFFI IDBDatabaseInfo IDBDatabaseInfo where toFFI = id
299 | FromFFI IDBDatabaseInfo IDBDatabaseInfo where fromFFI = Just
301 | export data IDBIndexParameters : Type where [external]
304 | ToFFI IDBIndexParameters IDBIndexParameters where toFFI = id
307 | FromFFI IDBIndexParameters IDBIndexParameters where fromFFI = Just
309 | export data IDBObjectStoreParameters : Type where [external]
312 | ToFFI IDBObjectStoreParameters IDBObjectStoreParameters where toFFI = id
315 | FromFFI IDBObjectStoreParameters IDBObjectStoreParameters where fromFFI = Just
317 | export data IDBTransactionOptions : Type where [external]
320 | ToFFI IDBTransactionOptions IDBTransactionOptions where toFFI = id
323 | FromFFI IDBTransactionOptions IDBTransactionOptions where fromFFI = Just
325 | export data IDBVersionChangeEventInit : Type where [external]
328 | ToFFI IDBVersionChangeEventInit IDBVersionChangeEventInit where toFFI = id
331 | FromFFI IDBVersionChangeEventInit IDBVersionChangeEventInit where fromFFI = Just