Skip to content

Commit 68c8b2f

Browse files
committed
refactor: add PersistentConfigurationStorage interface
1 parent 60fafe1 commit 68c8b2f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { IConfiguration } from './i-configuration';
2+
3+
/**
4+
* Persistent configuration storages are responsible for persisting
5+
* configuration between SDK reloads.
6+
*/
7+
// TODO: replace `IConfiguration` with a concrete `Configuration` type.
8+
export interface PersistentConfigurationStorage {
9+
/**
10+
* Load configuration from the persistent storage.
11+
*
12+
* The method may fail to load a configuration or throw an
13+
* exception (which is generally ignored).
14+
*/
15+
loadConfiguration(): PromiseLike<IConfiguration | null>;
16+
17+
/**
18+
* Store configuration to the persistent storage.
19+
*
20+
* The method is allowed to do async work (which is not awaited) or
21+
* throw exceptions (which are ignored).
22+
*/
23+
storeConfiguration(configuration: IConfiguration | null): void;
24+
}

0 commit comments

Comments
 (0)