/
UiStateStorage.ts
45 lines (42 loc) · 1.19 KB
/
UiStateStorage.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
42
43
44
45
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module UiStateStorage
*/
/** Interface for getting, saving and deleting settings.
* @public
*/
export interface UiStateStorage {
getSetting(
settingNamespace: string,
settingName: string
): Promise<UiStateStorageResult>;
saveSetting(
settingNamespace: string,
settingName: string,
setting: any
): Promise<UiStateStorageResult>;
deleteSetting(
settingNamespace: string,
settingName: string
): Promise<UiStateStorageResult>;
}
/** Enum for [[UiStateStorage]] status.
* @public
*/
export enum UiStateStorageStatus {
Success = 0,
NotFound = 1,
UnknownError = 2,
Uninitialized = 3,
AuthorizationError = 4,
}
/** Interface for result of accessing UI state setting in [[UiStateStorage]].
* @public
*/
export interface UiStateStorageResult {
status: UiStateStorageStatus;
setting?: any;
}