// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// https://github.com/WICG/storage-buckets
[
RuntimeEnabled=StorageBuckets,
Exposed=(Window,Worker),
SecureContext
] interface StorageBucket {
readonly attribute DOMString name;
[Exposed=Window, CallWith=ScriptState, Measure] Promise<boolean> persist();
[CallWith=ScriptState, Measure] Promise<boolean> persisted();
[CallWith=ScriptState, Measure] Promise<StorageEstimate> estimate();
[CallWith=ScriptState, RuntimeEnabled=StorageBucketsDurability, Measure] Promise<StorageBucketDurability> durability();
[CallWith=ScriptState, Measure] Promise<undefined> setExpires(DOMHighResTimeStamp expires);
[CallWith=ScriptState, Measure] Promise<DOMHighResTimeStamp?> expires();
[SameObject, Measure] readonly attribute IDBFactory indexedDB;
[SameObject, RuntimeEnabled=StorageBucketsLocks, Measure] readonly attribute LockManager locks;
[SameObject, RaisesException, Measure] readonly attribute CacheStorage caches;
[CallWith=ScriptState, RaisesException, Measure] Promise<FileSystemDirectoryHandle> getDirectory();
};