diff --git a/app/sdk/src/index.ts b/app/sdk/src/index.ts index 5cbf7924..9b6aead1 100644 --- a/app/sdk/src/index.ts +++ b/app/sdk/src/index.ts @@ -1,5 +1,7 @@ import { AccountSession } from './accountSession'; import { AdminSession } from './adminSession'; +import { SqlStore } from './sqlStore'; +import { WebStore } from './webStore'; export class DatabagSDK { @@ -7,15 +9,11 @@ export class DatabagSDK { console.log("databag sdk"); } - public async initSqlStore(path: string): Promise { + public async initOfflineStore(store: SqlStore): Promise { return new AccountSession(); } - public async initWebStore(): Promise { - return new AccountSession(); - } - - public async initMemStore(): Promise { + public async initOnlineStore(store: WebStore): Promise { return new AccountSession(); } @@ -38,7 +36,7 @@ export class DatabagSDK { return new AdminSession(); } - public async adminLogout(): Promise { + public async adminLogout(session: AdminSession): Promise { } } diff --git a/app/sdk/src/sqlStore.ts b/app/sdk/src/sqlStore.ts new file mode 100644 index 00000000..5454031f --- /dev/null +++ b/app/sdk/src/sqlStore.ts @@ -0,0 +1,3 @@ +export interface SqlStore { + query(stmt: string, params: (string | number)[]): any[]; +} diff --git a/app/sdk/src/webStore.ts b/app/sdk/src/webStore.ts new file mode 100644 index 00000000..bb60ff5f --- /dev/null +++ b/app/sdk/src/webStore.ts @@ -0,0 +1,6 @@ +export interface WebStore { + getValue(key: string): string; + setValue(key: string, value: string): void; + clearValue(key: string): void; + clearAll(): void; +}