Browse Source

Adds type-checking for storage

main
Eric Amodio 2 years ago
parent
commit
45e0407501
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/storage.ts

+ 3
- 3
src/storage.ts View File

@ -15,7 +15,7 @@ export class Storage {
return this.context.globalState.update(key, undefined);
}
async store(key: StorageKeys | SyncedStorageKeys, value: unknown): Promise<void> {
async store<T>(key: StorageKeys | SyncedStorageKeys, value: T): Promise<void> {
return this.context.globalState.update(key, value);
}
@ -46,9 +46,9 @@ export class Storage {
return this.context.workspaceState.update(key, undefined);
}
async storeWorkspace(
async storeWorkspace<T>(
key: WorkspaceStorageKeys | `${WorkspaceStorageKeys.ConnectedPrefix}${string}`,
value: unknown,
value: T,
): Promise<void> {
return this.context.workspaceState.update(key, value);
}

Loading…
Cancel
Save