[
Exposed=(Window,Worker),
SecureContext
] interface StorageBucketManager {
[NewObject] Promise<StorageBucket> open(DOMString name,
optional StorageBucketOptions options = {});
Promise<sequence<DOMString>> keys();
Promise<undefined> delete(DOMString name);
};
dictionary StorageBucketOptions {
boolean persisted = false;
StorageBucketDurability durability = "relaxed";
unsigned long long? quota = null;
DOMTimeStamp? expires = null;
};
enum StorageBucketDurability {
"strict",
"relaxed"
};
[
Exposed=(Window,Worker),
SecureContext
] interface StorageBucket {
[Exposed=Window] Promise<boolean> persist();
Promise<boolean> persisted();
Promise<StorageEstimate> estimate();
Promise<StorageBucketDurability> durability();
Promise<undefined> setExpires(DOMTimeStamp expires);
Promise<DOMTimeStamp> expires();
};
partial interface Navigator {
[SecureContext, SameObject] readonly attribute StorageBucketManager storageBuckets;
};
partial interface StorageBucket {
[SameObject] readonly attribute IDBFactory indexedDB;
};
partial interface StorageBucket {
[SameObject] readonly attribute CacheStorage caches;
};
partial interface StorageBucket {
[SameObject] readonly attribute LockManager locks;
};
partial interface StorageBucket {
Promise<FileSystemDirectoryHandle> getDirectory();
};
partial interface StorageBucket {
[NewObject] Promise<Blob> createBlob(optional sequence<BlobPart> blobParts,
optional BlobPropertyBag options = {});
[NewObject] Promise<File> createFile(sequence<BlobPart> fileBits,
USVString fileName,
optional FilePropertyBag options = {});
};
StorageBucket
exposes a subset of methods from ServiceWorkerContainer and will include the following methods.
ServiceWorkerContainerRegistration
will pull some members from ServiceWorkerContainer
so it can be included in the StorageBucket
interface, ultimately changing the Service Worker spec.
interface mixin ServiceWorkerContainerRegistration {
[NewObject] Promise<ServiceWorkerRegistration> register(USVString scriptURL,
optional RegistrationOptions options = {});
[NewObject] Promise<any> getRegistration(optional USVString clientURL = "");
[NewObject] Promise<FrozenArray<ServiceWorkerRegistration>> getRegistrations();
};
interface StorageBucketServiceWorkerContainer {};
StorageBucketServiceWorkerContainer includes ServiceWorkerContainerRegistration;
partial interface StorageBucket {
[SameObject] readonly attribute StorageBucketServiceWorkerContainer serviceWorker;
};