-
Notifications
You must be signed in to change notification settings - Fork 0
/
storageBuckets.api.d.ts
41 lines (32 loc) · 1.1 KB
/
storageBuckets.api.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
export {};
declare global {
interface NavigatorStorageBuckets {
readonly storageBuckets: StorageBucketManager;
}
interface WorkerNavigatorStorageBuckets {
readonly storageBuckets: StorageBucketManager;
}
interface Navigator extends NavigatorStorageBuckets {}
interface WorkerNavigator extends WorkerNavigatorStorageBuckets {}
interface StorageBucketManager {
open(name: string, options?: StorageBucketOptions): Promise<StorageBucket>;
keys(): Promise<string[]>;
delete(name: string): Promise<void>;
}
interface StorageBucketOptions {
persisted?: boolean;
quota?: number;
expires?: DOMHighResTimeStamp;
}
interface ExtendedStorageManager extends StorageBucket {
getFileHandle(name: string, opt?: any): Promise<FileSystemHandle>;
}
interface StorageBucket extends StorageManager {
readonly name: string;
setExpires(expires: DOMHighResTimeStamp): Promise<void>;
expires(): Promise<DOMHighResTimeStamp | null>;
readonly indexedDB: IDBFactory;
readonly caches: CacheStorage;
getDirectory(): Promise<FileSystemDirectoryHandle>;
}
}