0 | module Web.Raw.IndexedDB
   1 |
   2 | import JS
   3 | import Web.Internal.IndexedDBPrim
   4 | import Web.Internal.Types
   5 |
   6 | %default total
   7 |
   8 |
   9 | --------------------------------------------------------------------------------
  10 | --          Interfaces
  11 | --------------------------------------------------------------------------------
  12 |
  13 | namespace IDBCursor
  14 |
  15 |   export
  16 |   direction :
  17 |        {auto 0 _ : JSType t1}
  18 |     -> {auto 0 _ : Elem IDBCursor (Types t1)}
  19 |     -> (obj : t1)
  20 |     -> JSIO IDBCursorDirection
  21 |   direction a = tryJS "IDBCursor.direction" $ IDBCursor.prim__direction (up a)
  22 |
  23 |
  24 |   export
  25 |   key :
  26 |        {auto 0 _ : JSType t1}
  27 |     -> {auto 0 _ : Elem IDBCursor (Types t1)}
  28 |     -> (obj : t1)
  29 |     -> JSIO Any
  30 |   key a = tryJS "IDBCursor.key" $ IDBCursor.prim__key (up a)
  31 |
  32 |
  33 |   export
  34 |   primaryKey :
  35 |        {auto 0 _ : JSType t1}
  36 |     -> {auto 0 _ : Elem IDBCursor (Types t1)}
  37 |     -> (obj : t1)
  38 |     -> JSIO Any
  39 |   primaryKey a = tryJS "IDBCursor.primaryKey" $
  40 |     IDBCursor.prim__primaryKey (up a)
  41 |
  42 |
  43 |   export
  44 |   request :
  45 |        {auto 0 _ : JSType t1}
  46 |     -> {auto 0 _ : Elem IDBCursor (Types t1)}
  47 |     -> (obj : t1)
  48 |     -> JSIO IDBRequest
  49 |   request a = primJS $ IDBCursor.prim__request (up a)
  50 |
  51 |
  52 |   export
  53 |   source :
  54 |        {auto 0 _ : JSType t1}
  55 |     -> {auto 0 _ : Elem IDBCursor (Types t1)}
  56 |     -> (obj : t1)
  57 |     -> JSIO (HSum [IDBObjectStore, IDBIndex])
  58 |   source a = tryJS "IDBCursor.source" $ IDBCursor.prim__source (up a)
  59 |
  60 |
  61 |   export
  62 |   advance :
  63 |        {auto 0 _ : JSType t1}
  64 |     -> {auto 0 _ : Elem IDBCursor (Types t1)}
  65 |     -> (obj : t1)
  66 |     -> (count : Bits32)
  67 |     -> JSIO ()
  68 |   advance a b = primJS $ IDBCursor.prim__advance (up a) b
  69 |
  70 |
  71 |   export
  72 |   continue' :
  73 |        {auto 0 _ : JSType t1}
  74 |     -> {auto 0 _ : Elem IDBCursor (Types t1)}
  75 |     -> (obj : t1)
  76 |     -> (key : Optional Any)
  77 |     -> JSIO ()
  78 |   continue' a b = primJS $ IDBCursor.prim__continue (up a) (toFFI b)
  79 |
  80 |   export
  81 |   continue :
  82 |        {auto 0 _ : JSType t1}
  83 |     -> {auto 0 _ : Elem IDBCursor (Types t1)}
  84 |     -> (obj : t1)
  85 |     -> JSIO ()
  86 |   continue a = primJS $ IDBCursor.prim__continue (up a) undef
  87 |
  88 |
  89 |   export
  90 |   continuePrimaryKey :
  91 |        {auto 0 _ : JSType t1}
  92 |     -> {auto 0 _ : Elem IDBCursor (Types t1)}
  93 |     -> (obj : t1)
  94 |     -> (key : Any)
  95 |     -> (primaryKey : Any)
  96 |     -> JSIO ()
  97 |   continuePrimaryKey a b c = primJS $
  98 |     IDBCursor.prim__continuePrimaryKey (up a) (toFFI b) (toFFI c)
  99 |
 100 |
 101 |   export
 102 |   delete :
 103 |        {auto 0 _ : JSType t1}
 104 |     -> {auto 0 _ : Elem IDBCursor (Types t1)}
 105 |     -> (obj : t1)
 106 |     -> JSIO IDBRequest
 107 |   delete a = primJS $ IDBCursor.prim__delete (up a)
 108 |
 109 |
 110 |   export
 111 |   update :
 112 |        {auto 0 _ : JSType t1}
 113 |     -> {auto 0 _ : Elem IDBCursor (Types t1)}
 114 |     -> (obj : t1)
 115 |     -> (value : Any)
 116 |     -> JSIO IDBRequest
 117 |   update a b = primJS $ IDBCursor.prim__update (up a) (toFFI b)
 118 |
 119 |
 120 |
 121 | namespace IDBCursorWithValue
 122 |
 123 |   export
 124 |   value : (obj : IDBCursorWithValue) -> JSIO Any
 125 |   value a = tryJS "IDBCursorWithValue.value" $ IDBCursorWithValue.prim__value a
 126 |
 127 |
 128 |
 129 | namespace IDBDatabase
 130 |
 131 |   export
 132 |   name : (obj : IDBDatabase) -> JSIO String
 133 |   name a = primJS $ IDBDatabase.prim__name a
 134 |
 135 |
 136 |   export
 137 |   objectStoreNames : (obj : IDBDatabase) -> JSIO DOMStringList
 138 |   objectStoreNames a = primJS $ IDBDatabase.prim__objectStoreNames a
 139 |
 140 |
 141 |   export
 142 |   onabort : IDBDatabase -> Attribute False Maybe EventHandlerNonNull
 143 |   onabort v = fromNullablePrim
 144 |                 "IDBDatabase.getonabort"
 145 |                 prim__onabort
 146 |                 prim__setOnabort
 147 |                 v
 148 |
 149 |
 150 |   export
 151 |   onclose : IDBDatabase -> Attribute False Maybe EventHandlerNonNull
 152 |   onclose v = fromNullablePrim
 153 |                 "IDBDatabase.getonclose"
 154 |                 prim__onclose
 155 |                 prim__setOnclose
 156 |                 v
 157 |
 158 |
 159 |   export
 160 |   onerror : IDBDatabase -> Attribute False Maybe EventHandlerNonNull
 161 |   onerror v = fromNullablePrim
 162 |                 "IDBDatabase.getonerror"
 163 |                 prim__onerror
 164 |                 prim__setOnerror
 165 |                 v
 166 |
 167 |
 168 |   export
 169 |   onversionchange : IDBDatabase -> Attribute False Maybe EventHandlerNonNull
 170 |   onversionchange v = fromNullablePrim
 171 |                         "IDBDatabase.getonversionchange"
 172 |                         prim__onversionchange
 173 |                         prim__setOnversionchange
 174 |                         v
 175 |
 176 |
 177 |   export
 178 |   version : (obj : IDBDatabase) -> JSIO JSBits64
 179 |   version a = primJS $ IDBDatabase.prim__version a
 180 |
 181 |
 182 |   export
 183 |   close : (obj : IDBDatabase) -> JSIO ()
 184 |   close a = primJS $ IDBDatabase.prim__close a
 185 |
 186 |
 187 |   export
 188 |   createObjectStore' :
 189 |        {auto 0 _ : JSType t3}
 190 |     -> {auto 0 _ : Elem IDBObjectStoreParameters (Types t3)}
 191 |     -> (obj : IDBDatabase)
 192 |     -> (name : String)
 193 |     -> (options : Optional t3)
 194 |     -> JSIO IDBObjectStore
 195 |   createObjectStore' a b c = primJS $
 196 |     IDBDatabase.prim__createObjectStore a b (optUp c)
 197 |
 198 |   export
 199 |   createObjectStore :
 200 |        (obj : IDBDatabase)
 201 |     -> (name : String)
 202 |     -> JSIO IDBObjectStore
 203 |   createObjectStore a b = primJS $ IDBDatabase.prim__createObjectStore a b undef
 204 |
 205 |
 206 |   export
 207 |   deleteObjectStore : (obj : IDBDatabase) -> (name : String) -> JSIO ()
 208 |   deleteObjectStore a b = primJS $ IDBDatabase.prim__deleteObjectStore a b
 209 |
 210 |
 211 |   export
 212 |   transaction' :
 213 |        {auto 0 _ : JSType t4}
 214 |     -> {auto 0 _ : Elem IDBTransactionOptions (Types t4)}
 215 |     -> (obj : IDBDatabase)
 216 |     -> (storeNames : HSum [String, Array String])
 217 |     -> (mode : Optional IDBTransactionMode)
 218 |     -> (options : Optional t4)
 219 |     -> JSIO IDBTransaction
 220 |   transaction' a b c d = primJS $
 221 |     IDBDatabase.prim__transaction a (toFFI b) (toFFI c) (optUp d)
 222 |
 223 |   export
 224 |   transaction :
 225 |        (obj : IDBDatabase)
 226 |     -> (storeNames : HSum [String, Array String])
 227 |     -> JSIO IDBTransaction
 228 |   transaction a b = primJS $
 229 |     IDBDatabase.prim__transaction a (toFFI b) undef undef
 230 |
 231 |
 232 |
 233 | namespace IDBFactory
 234 |
 235 |   export
 236 |   cmp : (obj : IDBFactory) -> (first : Any) -> (second : Any) -> JSIO Int16
 237 |   cmp a b c = primJS $ IDBFactory.prim__cmp a (toFFI b) (toFFI c)
 238 |
 239 |
 240 |   export
 241 |   databases : (obj : IDBFactory) -> JSIO (Promise (Array IDBDatabaseInfo))
 242 |   databases a = primJS $ IDBFactory.prim__databases a
 243 |
 244 |
 245 |   export
 246 |   deleteDatabase :
 247 |        (obj : IDBFactory)
 248 |     -> (name : String)
 249 |     -> JSIO IDBOpenDBRequest
 250 |   deleteDatabase a b = primJS $ IDBFactory.prim__deleteDatabase a b
 251 |
 252 |
 253 |   export
 254 |   open' :
 255 |        (obj : IDBFactory)
 256 |     -> (name : String)
 257 |     -> (version : Optional JSBits64)
 258 |     -> JSIO IDBOpenDBRequest
 259 |   open' a b c = primJS $ IDBFactory.prim__open a b (toFFI c)
 260 |
 261 |   export
 262 |   open_ : (obj : IDBFactory) -> (name : String) -> JSIO IDBOpenDBRequest
 263 |   open_ a b = primJS $ IDBFactory.prim__open a b undef
 264 |
 265 |
 266 |
 267 | namespace IDBIndex
 268 |
 269 |   export
 270 |   keyPath : (obj : IDBIndex) -> JSIO Any
 271 |   keyPath a = tryJS "IDBIndex.keyPath" $ IDBIndex.prim__keyPath a
 272 |
 273 |
 274 |   export
 275 |   multiEntry : (obj : IDBIndex) -> JSIO Bool
 276 |   multiEntry a = tryJS "IDBIndex.multiEntry" $ IDBIndex.prim__multiEntry a
 277 |
 278 |
 279 |   export
 280 |   name : IDBIndex -> Attribute True Prelude.id String
 281 |   name v = fromPrim "IDBIndex.getname" prim__name prim__setName v
 282 |
 283 |
 284 |   export
 285 |   objectStore : (obj : IDBIndex) -> JSIO IDBObjectStore
 286 |   objectStore a = primJS $ IDBIndex.prim__objectStore a
 287 |
 288 |
 289 |   export
 290 |   unique : (obj : IDBIndex) -> JSIO Bool
 291 |   unique a = tryJS "IDBIndex.unique" $ IDBIndex.prim__unique a
 292 |
 293 |
 294 |   export
 295 |   count' : (obj : IDBIndex) -> (query : Optional Any) -> JSIO IDBRequest
 296 |   count' a b = primJS $ IDBIndex.prim__count a (toFFI b)
 297 |
 298 |   export
 299 |   count : (obj : IDBIndex) -> JSIO IDBRequest
 300 |   count a = primJS $ IDBIndex.prim__count a undef
 301 |
 302 |
 303 |   export
 304 |   getAll' :
 305 |        (obj : IDBIndex)
 306 |     -> (query : Optional Any)
 307 |     -> (count : Optional Bits32)
 308 |     -> JSIO IDBRequest
 309 |   getAll' a b c = primJS $ IDBIndex.prim__getAll a (toFFI b) (toFFI c)
 310 |
 311 |   export
 312 |   getAll : (obj : IDBIndex) -> JSIO IDBRequest
 313 |   getAll a = primJS $ IDBIndex.prim__getAll a undef undef
 314 |
 315 |
 316 |   export
 317 |   getAllKeys' :
 318 |        (obj : IDBIndex)
 319 |     -> (query : Optional Any)
 320 |     -> (count : Optional Bits32)
 321 |     -> JSIO IDBRequest
 322 |   getAllKeys' a b c = primJS $ IDBIndex.prim__getAllKeys a (toFFI b) (toFFI c)
 323 |
 324 |   export
 325 |   getAllKeys : (obj : IDBIndex) -> JSIO IDBRequest
 326 |   getAllKeys a = primJS $ IDBIndex.prim__getAllKeys a undef undef
 327 |
 328 |
 329 |   export
 330 |   get : (obj : IDBIndex) -> (query : Any) -> JSIO IDBRequest
 331 |   get a b = primJS $ IDBIndex.prim__get a (toFFI b)
 332 |
 333 |
 334 |   export
 335 |   getKey : (obj : IDBIndex) -> (query : Any) -> JSIO IDBRequest
 336 |   getKey a b = primJS $ IDBIndex.prim__getKey a (toFFI b)
 337 |
 338 |
 339 |   export
 340 |   openCursor' :
 341 |        (obj : IDBIndex)
 342 |     -> (query : Optional Any)
 343 |     -> (direction : Optional IDBCursorDirection)
 344 |     -> JSIO IDBRequest
 345 |   openCursor' a b c = primJS $ IDBIndex.prim__openCursor a (toFFI b) (toFFI c)
 346 |
 347 |   export
 348 |   openCursor : (obj : IDBIndex) -> JSIO IDBRequest
 349 |   openCursor a = primJS $ IDBIndex.prim__openCursor a undef undef
 350 |
 351 |
 352 |   export
 353 |   openKeyCursor' :
 354 |        (obj : IDBIndex)
 355 |     -> (query : Optional Any)
 356 |     -> (direction : Optional IDBCursorDirection)
 357 |     -> JSIO IDBRequest
 358 |   openKeyCursor' a b c = primJS $
 359 |     IDBIndex.prim__openKeyCursor a (toFFI b) (toFFI c)
 360 |
 361 |   export
 362 |   openKeyCursor : (obj : IDBIndex) -> JSIO IDBRequest
 363 |   openKeyCursor a = primJS $ IDBIndex.prim__openKeyCursor a undef undef
 364 |
 365 |
 366 |
 367 | namespace IDBKeyRange
 368 |
 369 |   export
 370 |   bound' :
 371 |        (lower : Any)
 372 |     -> (upper : Any)
 373 |     -> (lowerOpen : Optional Bool)
 374 |     -> (upperOpen : Optional Bool)
 375 |     -> JSIO IDBKeyRange
 376 |   bound' a b c d = primJS $
 377 |     IDBKeyRange.prim__bound (toFFI a) (toFFI b) (toFFI c) (toFFI d)
 378 |
 379 |   export
 380 |   bound : (lower : Any) -> (upper : Any) -> JSIO IDBKeyRange
 381 |   bound a b = primJS $ IDBKeyRange.prim__bound (toFFI a) (toFFI b) undef undef
 382 |
 383 |
 384 |   export
 385 |   lowerBound' : (lower : Any) -> (open_ : Optional Bool) -> JSIO IDBKeyRange
 386 |   lowerBound' a b = primJS $ IDBKeyRange.prim__lowerBound (toFFI a) (toFFI b)
 387 |
 388 |   export
 389 |   lowerBound : (lower : Any) -> JSIO IDBKeyRange
 390 |   lowerBound a = primJS $ IDBKeyRange.prim__lowerBound (toFFI a) undef
 391 |
 392 |
 393 |   export
 394 |   only : (value : Any) -> JSIO IDBKeyRange
 395 |   only a = primJS $ IDBKeyRange.prim__only (toFFI a)
 396 |
 397 |
 398 |   export
 399 |   upperBound' : (upper : Any) -> (open_ : Optional Bool) -> JSIO IDBKeyRange
 400 |   upperBound' a b = primJS $ IDBKeyRange.prim__upperBound (toFFI a) (toFFI b)
 401 |
 402 |   export
 403 |   upperBound : (upper : Any) -> JSIO IDBKeyRange
 404 |   upperBound a = primJS $ IDBKeyRange.prim__upperBound (toFFI a) undef
 405 |
 406 |
 407 |   export
 408 |   lower : (obj : IDBKeyRange) -> JSIO Any
 409 |   lower a = tryJS "IDBKeyRange.lower" $ IDBKeyRange.prim__lower a
 410 |
 411 |
 412 |   export
 413 |   lowerOpen : (obj : IDBKeyRange) -> JSIO Bool
 414 |   lowerOpen a = tryJS "IDBKeyRange.lowerOpen" $ IDBKeyRange.prim__lowerOpen a
 415 |
 416 |
 417 |   export
 418 |   upper : (obj : IDBKeyRange) -> JSIO Any
 419 |   upper a = tryJS "IDBKeyRange.upper" $ IDBKeyRange.prim__upper a
 420 |
 421 |
 422 |   export
 423 |   upperOpen : (obj : IDBKeyRange) -> JSIO Bool
 424 |   upperOpen a = tryJS "IDBKeyRange.upperOpen" $ IDBKeyRange.prim__upperOpen a
 425 |
 426 |
 427 |   export
 428 |   includes : (obj : IDBKeyRange) -> (key : Any) -> JSIO Bool
 429 |   includes a b = tryJS "IDBKeyRange.includes" $
 430 |     IDBKeyRange.prim__includes a (toFFI b)
 431 |
 432 |
 433 |
 434 | namespace IDBObjectStore
 435 |
 436 |   export
 437 |   autoIncrement : (obj : IDBObjectStore) -> JSIO Bool
 438 |   autoIncrement a = tryJS "IDBObjectStore.autoIncrement" $
 439 |     IDBObjectStore.prim__autoIncrement a
 440 |
 441 |
 442 |   export
 443 |   indexNames : (obj : IDBObjectStore) -> JSIO DOMStringList
 444 |   indexNames a = primJS $ IDBObjectStore.prim__indexNames a
 445 |
 446 |
 447 |   export
 448 |   keyPath : (obj : IDBObjectStore) -> JSIO Any
 449 |   keyPath a = tryJS "IDBObjectStore.keyPath" $ IDBObjectStore.prim__keyPath a
 450 |
 451 |
 452 |   export
 453 |   name : IDBObjectStore -> Attribute True Prelude.id String
 454 |   name v = fromPrim "IDBObjectStore.getname" prim__name prim__setName v
 455 |
 456 |
 457 |   export
 458 |   transaction : (obj : IDBObjectStore) -> JSIO IDBTransaction
 459 |   transaction a = primJS $ IDBObjectStore.prim__transaction a
 460 |
 461 |
 462 |   export
 463 |   add' :
 464 |        (obj : IDBObjectStore)
 465 |     -> (value : Any)
 466 |     -> (key : Optional Any)
 467 |     -> JSIO IDBRequest
 468 |   add' a b c = primJS $ IDBObjectStore.prim__add a (toFFI b) (toFFI c)
 469 |
 470 |   export
 471 |   add : (obj : IDBObjectStore) -> (value : Any) -> JSIO IDBRequest
 472 |   add a b = primJS $ IDBObjectStore.prim__add a (toFFI b) undef
 473 |
 474 |
 475 |   export
 476 |   clear : (obj : IDBObjectStore) -> JSIO IDBRequest
 477 |   clear a = primJS $ IDBObjectStore.prim__clear a
 478 |
 479 |
 480 |   export
 481 |   count' : (obj : IDBObjectStore) -> (query : Optional Any) -> JSIO IDBRequest
 482 |   count' a b = primJS $ IDBObjectStore.prim__count a (toFFI b)
 483 |
 484 |   export
 485 |   count : (obj : IDBObjectStore) -> JSIO IDBRequest
 486 |   count a = primJS $ IDBObjectStore.prim__count a undef
 487 |
 488 |
 489 |   export
 490 |   createIndex' :
 491 |        {auto 0 _ : JSType t4}
 492 |     -> {auto 0 _ : Elem IDBIndexParameters (Types t4)}
 493 |     -> (obj : IDBObjectStore)
 494 |     -> (name : String)
 495 |     -> (keyPath : HSum [String, Array String])
 496 |     -> (options : Optional t4)
 497 |     -> JSIO IDBIndex
 498 |   createIndex' a b c d = primJS $
 499 |     IDBObjectStore.prim__createIndex a b (toFFI c) (optUp d)
 500 |
 501 |   export
 502 |   createIndex :
 503 |        (obj : IDBObjectStore)
 504 |     -> (name : String)
 505 |     -> (keyPath : HSum [String, Array String])
 506 |     -> JSIO IDBIndex
 507 |   createIndex a b c = primJS $
 508 |     IDBObjectStore.prim__createIndex a b (toFFI c) undef
 509 |
 510 |
 511 |   export
 512 |   delete : (obj : IDBObjectStore) -> (query : Any) -> JSIO IDBRequest
 513 |   delete a b = primJS $ IDBObjectStore.prim__delete a (toFFI b)
 514 |
 515 |
 516 |   export
 517 |   deleteIndex : (obj : IDBObjectStore) -> (name : String) -> JSIO ()
 518 |   deleteIndex a b = primJS $ IDBObjectStore.prim__deleteIndex a b
 519 |
 520 |
 521 |   export
 522 |   getAll' :
 523 |        (obj : IDBObjectStore)
 524 |     -> (query : Optional Any)
 525 |     -> (count : Optional Bits32)
 526 |     -> JSIO IDBRequest
 527 |   getAll' a b c = primJS $ IDBObjectStore.prim__getAll a (toFFI b) (toFFI c)
 528 |
 529 |   export
 530 |   getAll : (obj : IDBObjectStore) -> JSIO IDBRequest
 531 |   getAll a = primJS $ IDBObjectStore.prim__getAll a undef undef
 532 |
 533 |
 534 |   export
 535 |   getAllKeys' :
 536 |        (obj : IDBObjectStore)
 537 |     -> (query : Optional Any)
 538 |     -> (count : Optional Bits32)
 539 |     -> JSIO IDBRequest
 540 |   getAllKeys' a b c = primJS $
 541 |     IDBObjectStore.prim__getAllKeys a (toFFI b) (toFFI c)
 542 |
 543 |   export
 544 |   getAllKeys : (obj : IDBObjectStore) -> JSIO IDBRequest
 545 |   getAllKeys a = primJS $ IDBObjectStore.prim__getAllKeys a undef undef
 546 |
 547 |
 548 |   export
 549 |   get : (obj : IDBObjectStore) -> (query : Any) -> JSIO IDBRequest
 550 |   get a b = primJS $ IDBObjectStore.prim__get a (toFFI b)
 551 |
 552 |
 553 |   export
 554 |   getKey : (obj : IDBObjectStore) -> (query : Any) -> JSIO IDBRequest
 555 |   getKey a b = primJS $ IDBObjectStore.prim__getKey a (toFFI b)
 556 |
 557 |
 558 |   export
 559 |   index : (obj : IDBObjectStore) -> (name : String) -> JSIO IDBIndex
 560 |   index a b = primJS $ IDBObjectStore.prim__index a b
 561 |
 562 |
 563 |   export
 564 |   openCursor' :
 565 |        (obj : IDBObjectStore)
 566 |     -> (query : Optional Any)
 567 |     -> (direction : Optional IDBCursorDirection)
 568 |     -> JSIO IDBRequest
 569 |   openCursor' a b c = primJS $
 570 |     IDBObjectStore.prim__openCursor a (toFFI b) (toFFI c)
 571 |
 572 |   export
 573 |   openCursor : (obj : IDBObjectStore) -> JSIO IDBRequest
 574 |   openCursor a = primJS $ IDBObjectStore.prim__openCursor a undef undef
 575 |
 576 |
 577 |   export
 578 |   openKeyCursor' :
 579 |        (obj : IDBObjectStore)
 580 |     -> (query : Optional Any)
 581 |     -> (direction : Optional IDBCursorDirection)
 582 |     -> JSIO IDBRequest
 583 |   openKeyCursor' a b c = primJS $
 584 |     IDBObjectStore.prim__openKeyCursor a (toFFI b) (toFFI c)
 585 |
 586 |   export
 587 |   openKeyCursor : (obj : IDBObjectStore) -> JSIO IDBRequest
 588 |   openKeyCursor a = primJS $ IDBObjectStore.prim__openKeyCursor a undef undef
 589 |
 590 |
 591 |   export
 592 |   put' :
 593 |        (obj : IDBObjectStore)
 594 |     -> (value : Any)
 595 |     -> (key : Optional Any)
 596 |     -> JSIO IDBRequest
 597 |   put' a b c = primJS $ IDBObjectStore.prim__put a (toFFI b) (toFFI c)
 598 |
 599 |   export
 600 |   put : (obj : IDBObjectStore) -> (value : Any) -> JSIO IDBRequest
 601 |   put a b = primJS $ IDBObjectStore.prim__put a (toFFI b) undef
 602 |
 603 |
 604 |
 605 | namespace IDBOpenDBRequest
 606 |
 607 |   export
 608 |   onblocked : IDBOpenDBRequest -> Attribute False Maybe EventHandlerNonNull
 609 |   onblocked v = fromNullablePrim
 610 |                   "IDBOpenDBRequest.getonblocked"
 611 |                   prim__onblocked
 612 |                   prim__setOnblocked
 613 |                   v
 614 |
 615 |
 616 |   export
 617 |   onupgradeneeded :
 618 |        IDBOpenDBRequest
 619 |     -> Attribute False Maybe EventHandlerNonNull
 620 |   onupgradeneeded v = fromNullablePrim
 621 |                         "IDBOpenDBRequest.getonupgradeneeded"
 622 |                         prim__onupgradeneeded
 623 |                         prim__setOnupgradeneeded
 624 |                         v
 625 |
 626 |
 627 |
 628 | namespace IDBRequest
 629 |
 630 |   export
 631 |   error :
 632 |        {auto 0 _ : JSType t1}
 633 |     -> {auto 0 _ : Elem IDBRequest (Types t1)}
 634 |     -> (obj : t1)
 635 |     -> JSIO (Maybe DOMException)
 636 |   error a = tryJS "IDBRequest.error" $ IDBRequest.prim__error (up a)
 637 |
 638 |
 639 |   export
 640 |   onerror :
 641 |        {auto 0 _ : JSType t}
 642 |     -> {auto 0 _ : Elem IDBRequest (Types t)}
 643 |     -> t
 644 |     -> Attribute False Maybe EventHandlerNonNull
 645 |   onerror v = fromNullablePrim
 646 |                 "IDBRequest.getonerror"
 647 |                 prim__onerror
 648 |                 prim__setOnerror
 649 |                 (v :> IDBRequest)
 650 |
 651 |
 652 |   export
 653 |   onsuccess :
 654 |        {auto 0 _ : JSType t}
 655 |     -> {auto 0 _ : Elem IDBRequest (Types t)}
 656 |     -> t
 657 |     -> Attribute False Maybe EventHandlerNonNull
 658 |   onsuccess v = fromNullablePrim
 659 |                   "IDBRequest.getonsuccess"
 660 |                   prim__onsuccess
 661 |                   prim__setOnsuccess
 662 |                   (v :> IDBRequest)
 663 |
 664 |
 665 |   export
 666 |   readyState :
 667 |        {auto 0 _ : JSType t1}
 668 |     -> {auto 0 _ : Elem IDBRequest (Types t1)}
 669 |     -> (obj : t1)
 670 |     -> JSIO IDBRequestReadyState
 671 |   readyState a = tryJS "IDBRequest.readyState" $
 672 |     IDBRequest.prim__readyState (up a)
 673 |
 674 |
 675 |   export
 676 |   result :
 677 |        {auto 0 _ : JSType t1}
 678 |     -> {auto 0 _ : Elem IDBRequest (Types t1)}
 679 |     -> (obj : t1)
 680 |     -> JSIO Any
 681 |   result a = tryJS "IDBRequest.result" $ IDBRequest.prim__result (up a)
 682 |
 683 |
 684 |   export
 685 |   source :
 686 |        {auto 0 _ : JSType t1}
 687 |     -> {auto 0 _ : Elem IDBRequest (Types t1)}
 688 |     -> (obj : t1)
 689 |     -> JSIO (Maybe (HSum [IDBObjectStore, IDBIndex, IDBCursor]))
 690 |   source a = tryJS "IDBRequest.source" $ IDBRequest.prim__source (up a)
 691 |
 692 |
 693 |   export
 694 |   transaction :
 695 |        {auto 0 _ : JSType t1}
 696 |     -> {auto 0 _ : Elem IDBRequest (Types t1)}
 697 |     -> (obj : t1)
 698 |     -> JSIO (Maybe IDBTransaction)
 699 |   transaction a = tryJS "IDBRequest.transaction" $
 700 |     IDBRequest.prim__transaction (up a)
 701 |
 702 |
 703 |
 704 | namespace IDBTransaction
 705 |
 706 |   export
 707 |   db : (obj : IDBTransaction) -> JSIO IDBDatabase
 708 |   db a = primJS $ IDBTransaction.prim__db a
 709 |
 710 |
 711 |   export
 712 |   durability : (obj : IDBTransaction) -> JSIO IDBTransactionDurability
 713 |   durability a = tryJS "IDBTransaction.durability" $
 714 |     IDBTransaction.prim__durability a
 715 |
 716 |
 717 |   export
 718 |   error : (obj : IDBTransaction) -> JSIO (Maybe DOMException)
 719 |   error a = tryJS "IDBTransaction.error" $ IDBTransaction.prim__error a
 720 |
 721 |
 722 |   export
 723 |   mode : (obj : IDBTransaction) -> JSIO IDBTransactionMode
 724 |   mode a = tryJS "IDBTransaction.mode" $ IDBTransaction.prim__mode a
 725 |
 726 |
 727 |   export
 728 |   objectStoreNames : (obj : IDBTransaction) -> JSIO DOMStringList
 729 |   objectStoreNames a = primJS $ IDBTransaction.prim__objectStoreNames a
 730 |
 731 |
 732 |   export
 733 |   onabort : IDBTransaction -> Attribute False Maybe EventHandlerNonNull
 734 |   onabort v = fromNullablePrim
 735 |                 "IDBTransaction.getonabort"
 736 |                 prim__onabort
 737 |                 prim__setOnabort
 738 |                 v
 739 |
 740 |
 741 |   export
 742 |   oncomplete : IDBTransaction -> Attribute False Maybe EventHandlerNonNull
 743 |   oncomplete v = fromNullablePrim
 744 |                    "IDBTransaction.getoncomplete"
 745 |                    prim__oncomplete
 746 |                    prim__setOncomplete
 747 |                    v
 748 |
 749 |
 750 |   export
 751 |   onerror : IDBTransaction -> Attribute False Maybe EventHandlerNonNull
 752 |   onerror v = fromNullablePrim
 753 |                 "IDBTransaction.getonerror"
 754 |                 prim__onerror
 755 |                 prim__setOnerror
 756 |                 v
 757 |
 758 |
 759 |   export
 760 |   abort : (obj : IDBTransaction) -> JSIO ()
 761 |   abort a = primJS $ IDBTransaction.prim__abort a
 762 |
 763 |
 764 |   export
 765 |   commit : (obj : IDBTransaction) -> JSIO ()
 766 |   commit a = primJS $ IDBTransaction.prim__commit a
 767 |
 768 |
 769 |   export
 770 |   objectStore : (obj : IDBTransaction) -> (name : String) -> JSIO IDBObjectStore
 771 |   objectStore a b = primJS $ IDBTransaction.prim__objectStore a b
 772 |
 773 |
 774 |
 775 | namespace IDBVersionChangeEvent
 776 |
 777 |   export
 778 |   new' :
 779 |        {auto 0 _ : JSType t2}
 780 |     -> {auto 0 _ : Elem IDBVersionChangeEventInit (Types t2)}
 781 |     -> (type : String)
 782 |     -> (eventInitDict : Optional t2)
 783 |     -> JSIO IDBVersionChangeEvent
 784 |   new' a b = primJS $ IDBVersionChangeEvent.prim__new a (optUp b)
 785 |
 786 |   export
 787 |   new : (type : String) -> JSIO IDBVersionChangeEvent
 788 |   new a = primJS $ IDBVersionChangeEvent.prim__new a undef
 789 |
 790 |
 791 |   export
 792 |   newVersion : (obj : IDBVersionChangeEvent) -> JSIO (Maybe JSBits64)
 793 |   newVersion a = tryJS "IDBVersionChangeEvent.newVersion" $
 794 |     IDBVersionChangeEvent.prim__newVersion a
 795 |
 796 |
 797 |   export
 798 |   oldVersion : (obj : IDBVersionChangeEvent) -> JSIO JSBits64
 799 |   oldVersion a = primJS $ IDBVersionChangeEvent.prim__oldVersion a
 800 |
 801 |
 802 |
 803 |
 804 |
 805 | --------------------------------------------------------------------------------
 806 | --          Dictionaries
 807 | --------------------------------------------------------------------------------
 808 |
 809 | namespace IDBDatabaseInfo
 810 |
 811 |   export
 812 |   new' :
 813 |        (name : Optional String)
 814 |     -> (version : Optional JSBits64)
 815 |     -> JSIO IDBDatabaseInfo
 816 |   new' a b = primJS $ IDBDatabaseInfo.prim__new (toFFI a) (toFFI b)
 817 |
 818 |   export
 819 |   new : JSIO IDBDatabaseInfo
 820 |   new = primJS $ IDBDatabaseInfo.prim__new undef undef
 821 |
 822 |
 823 |   export
 824 |   name :
 825 |        {auto 0 _ : JSType t}
 826 |     -> {auto 0 _ : Elem IDBDatabaseInfo (Types t)}
 827 |     -> t
 828 |     -> Attribute False Optional String
 829 |   name v = fromUndefOrPrimNoDefault
 830 |              "IDBDatabaseInfo.getname"
 831 |              prim__name
 832 |              prim__setName
 833 |              (v :> IDBDatabaseInfo)
 834 |
 835 |
 836 |   export
 837 |   version :
 838 |        {auto 0 _ : JSType t}
 839 |     -> {auto 0 _ : Elem IDBDatabaseInfo (Types t)}
 840 |     -> t
 841 |     -> Attribute False Optional JSBits64
 842 |   version v = fromUndefOrPrimNoDefault
 843 |                 "IDBDatabaseInfo.getversion"
 844 |                 prim__version
 845 |                 prim__setVersion
 846 |                 (v :> IDBDatabaseInfo)
 847 |
 848 |
 849 |
 850 | namespace IDBIndexParameters
 851 |
 852 |   export
 853 |   new' :
 854 |        (unique : Optional Bool)
 855 |     -> (multiEntry : Optional Bool)
 856 |     -> JSIO IDBIndexParameters
 857 |   new' a b = primJS $ IDBIndexParameters.prim__new (toFFI a) (toFFI b)
 858 |
 859 |   export
 860 |   new : JSIO IDBIndexParameters
 861 |   new = primJS $ IDBIndexParameters.prim__new undef undef
 862 |
 863 |
 864 |   export
 865 |   multiEntry :
 866 |        {auto 0 _ : JSType t}
 867 |     -> {auto 0 _ : Elem IDBIndexParameters (Types t)}
 868 |     -> t
 869 |     -> Attribute True Optional Bool
 870 |   multiEntry v = fromUndefOrPrim
 871 |                    "IDBIndexParameters.getmultiEntry"
 872 |                    prim__multiEntry
 873 |                    prim__setMultiEntry
 874 |                    False
 875 |                    (v :> IDBIndexParameters)
 876 |
 877 |
 878 |   export
 879 |   unique :
 880 |        {auto 0 _ : JSType t}
 881 |     -> {auto 0 _ : Elem IDBIndexParameters (Types t)}
 882 |     -> t
 883 |     -> Attribute True Optional Bool
 884 |   unique v = fromUndefOrPrim
 885 |                "IDBIndexParameters.getunique"
 886 |                prim__unique
 887 |                prim__setUnique
 888 |                False
 889 |                (v :> IDBIndexParameters)
 890 |
 891 |
 892 |
 893 | namespace IDBObjectStoreParameters
 894 |
 895 |   export
 896 |   new' :
 897 |        (keyPath : Optional (Maybe (HSum [String, Array String])))
 898 |     -> (autoIncrement : Optional Bool)
 899 |     -> JSIO IDBObjectStoreParameters
 900 |   new' a b = primJS $ IDBObjectStoreParameters.prim__new (toFFI a) (toFFI b)
 901 |
 902 |   export
 903 |   new : JSIO IDBObjectStoreParameters
 904 |   new = primJS $ IDBObjectStoreParameters.prim__new undef undef
 905 |
 906 |
 907 |   export
 908 |   autoIncrement :
 909 |        {auto 0 _ : JSType t}
 910 |     -> {auto 0 _ : Elem IDBObjectStoreParameters (Types t)}
 911 |     -> t
 912 |     -> Attribute True Optional Bool
 913 |   autoIncrement v = fromUndefOrPrim
 914 |                       "IDBObjectStoreParameters.getautoIncrement"
 915 |                       prim__autoIncrement
 916 |                       prim__setAutoIncrement
 917 |                       False
 918 |                       (v :> IDBObjectStoreParameters)
 919 |
 920 |
 921 |   export
 922 |   keyPath :
 923 |        {auto 0 _ : JSType t}
 924 |     -> {auto 0 _ : Elem IDBObjectStoreParameters (Types t)}
 925 |     -> t
 926 |     -> Attribute True Optional (Maybe (Union2 String (Array String)))
 927 |   keyPath v = fromUndefOrPrim
 928 |                 "IDBObjectStoreParameters.getkeyPath"
 929 |                 prim__keyPath
 930 |                 prim__setKeyPath
 931 |                 Nothing
 932 |                 (v :> IDBObjectStoreParameters)
 933 |
 934 |
 935 |
 936 | namespace IDBTransactionOptions
 937 |
 938 |   export
 939 |   new' :
 940 |        (durability : Optional IDBTransactionDurability)
 941 |     -> JSIO IDBTransactionOptions
 942 |   new' a = primJS $ IDBTransactionOptions.prim__new (toFFI a)
 943 |
 944 |   export
 945 |   new : JSIO IDBTransactionOptions
 946 |   new = primJS $ IDBTransactionOptions.prim__new undef
 947 |
 948 |
 949 |   export
 950 |   durability :
 951 |        {auto 0 _ : JSType t}
 952 |     -> {auto 0 _ : Elem IDBTransactionOptions (Types t)}
 953 |     -> t
 954 |     -> Attribute False Optional IDBTransactionDurability
 955 |   durability v = fromUndefOrPrimNoDefault
 956 |                    "IDBTransactionOptions.getdurability"
 957 |                    prim__durability
 958 |                    prim__setDurability
 959 |                    (v :> IDBTransactionOptions)
 960 |
 961 |
 962 |
 963 | namespace IDBVersionChangeEventInit
 964 |
 965 |   export
 966 |   new' :
 967 |        (oldVersion : Optional JSBits64)
 968 |     -> (newVersion : Optional (Maybe JSBits64))
 969 |     -> JSIO IDBVersionChangeEventInit
 970 |   new' a b = primJS $ IDBVersionChangeEventInit.prim__new (toFFI a) (toFFI b)
 971 |
 972 |   export
 973 |   new : JSIO IDBVersionChangeEventInit
 974 |   new = primJS $ IDBVersionChangeEventInit.prim__new undef undef
 975 |
 976 |
 977 |   export
 978 |   newVersion :
 979 |        {auto 0 _ : JSType t}
 980 |     -> {auto 0 _ : Elem IDBVersionChangeEventInit (Types t)}
 981 |     -> t
 982 |     -> Attribute True Optional (Maybe JSBits64)
 983 |   newVersion v = fromUndefOrPrim
 984 |                    "IDBVersionChangeEventInit.getnewVersion"
 985 |                    prim__newVersion
 986 |                    prim__setNewVersion
 987 |                    Nothing
 988 |                    (v :> IDBVersionChangeEventInit)
 989 |
 990 |
 991 |   export
 992 |   oldVersion :
 993 |        {auto 0 _ : JSType t}
 994 |     -> {auto 0 _ : Elem IDBVersionChangeEventInit (Types t)}
 995 |     -> t
 996 |     -> Attribute True Optional JSBits64
 997 |   oldVersion v = fromUndefOrPrim
 998 |                    "IDBVersionChangeEventInit.getoldVersion"
 999 |                    prim__oldVersion
1000 |                    prim__setOldVersion
1001 |                    0
1002 |                    (v :> IDBVersionChangeEventInit)
1003 |