Movatterモバイル変換


[0]ホーム

URL:


HomeReferenceSource

Function

Static Public Summary
public

Retrieve an IDBFileStorage instance by name (and it creates the indexedDB if it doesn'texist yet).

public

Wraps a DOMRequest into a promise, optionally transforming the result using the onsuccesscallback.

Static Public

publicasyncgetFileStorage(param:Object):IDBFileStoragesource

import {getFileStorage} from 'idb-file-storage/src/idb-file-storage.js'

Retrieve an IDBFileStorage instance by name (and it creates the indexedDB if it doesn'texist yet).

Params:

NameTypeAttributeDescription
paramObject
  • optional
param.namestring
  • optional
  • default: "default"

The name associated to the IDB File Storage.

param.persistentboolean
  • optional

Optionally enable persistent storage mode (not enabled by default).

Return:

IDBFileStorage

The IDBFileStorage instance with the given name.

publicwaitForDOMRequest(req:IDBRequest |DOMRequest, onsuccess:function):Promisesource

import {waitForDOMRequest} from 'idb-file-storage/src/idb-file-storage.js'

Wraps a DOMRequest into a promise, optionally transforming the result using the onsuccesscallback.

Params:

NameTypeAttributeDescription
reqIDBRequest |DOMRequest

The DOMRequest instance to wrap in a Promise.

onsuccessfunction
  • optional

An optional onsuccess callback which can transform the result before resolving it.

Return:

Promise

The promise which wraps the request result, rejected if the request.onerror has been called.


[8]ページ先頭

©2009-2025 Movatter.jp