forked from finos/a11y-theme-builder-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterface.ts
28 lines (27 loc) · 956 Bytes
/
interface.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
/*
* Copyright (c) 2023 Discover Financial Services
* Licensed under Apache-2.0 License. See License.txt in the project root for license information
*/
/**
* The StorageElement interface defines the minimum requirements for each element
* that is stored.
*/
export interface StorageElement {
metadata: Object;
}
/**
* The Storage interface which defines what must be implemented in order to create
* persistent storage for the Theme Builder.
*/
export interface Storage {
/** Get the value associated with a key */
get(key: string): Promise<StorageElement>;
/** Set the value associated with a key */
set(key: string, value: StorageElement): Promise<void>;
/** Delete the value associated with a key */
delete(key: string): Promise<void>;
/** List all of the keys stored */
listKeys(): Promise<string[]>;
/** List the metadata associated with each entry */
listMetadata(): Promise<StorageElement[]>;
}