-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
227af2b
commit d27a7fa
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/ui-extensions/src/surfaces/point-of-sale/api/storage-api/storage-api.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export interface StorageApi { | ||
storage: StorageApiContent; | ||
} | ||
|
||
export interface StorageApiContent { | ||
/** | ||
* Get the value of a key from the storage | ||
* @throws Error if the storage operation fails | ||
* @param key | ||
* @returns the value of the key or undefined if the key does not exist | ||
*/ | ||
get(key: string): Promise<string | undefined>; | ||
|
||
/** | ||
* Set the value of a key in the storage | ||
* Value must be encoded as a string | ||
* @throws StorageApiError if the data size limit is exceeded | ||
* @throws Error if the storage operation fails | ||
* @param key | ||
* @param value | ||
*/ | ||
set(key: string, value: string): Promise<void>; | ||
} |