style: rename platform to bridge (#452)

* style: rename platform to bridge

* chore: tsc
This commit is contained in:
Baptiste Grob
2020-08-25 16:56:32 +02:00
committed by GitHub
parent b2511455dd
commit da78399567
11 changed files with 45 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
/** Platform-specific (i-e desktop/web) behavior is handled by a Platform object. */
export interface Platform {
/** Platform-specific (i-e Electron/browser) behavior is handled by a Bridge object. */
export interface Bridge {
getKeychainValue(): Promise<unknown>;
setKeychainValue(value: any): Promise<void>;
clearKeychainValue(): Promise<void>;
@@ -7,7 +7,7 @@ export interface Platform {
const KEYCHAIN_STORAGE_KEY = 'keychain';
export class WebPlatform implements Platform {
export class BrowserBridge implements Bridge {
async getKeychainValue(): Promise<unknown> {
const value = localStorage.getItem(KEYCHAIN_STORAGE_KEY);
if (value) {
@@ -21,4 +21,4 @@ export class WebPlatform implements Platform {
async clearKeychainValue(): Promise<void> {
localStorage.removeItem(KEYCHAIN_STORAGE_KEY);
}
}
}