half way there

This commit is contained in:
2026-02-03 04:24:11 +01:00
parent 991cd10f40
commit 2973e038d6
274 changed files with 992 additions and 964 deletions
+31
View File
@@ -0,0 +1,31 @@
import type { HostInfo } from './types';
export const StorageService = {
/**
* Returns the storage key for a specific tab with the required type prefix
*/
getKey(tabId: number): `session:${string}` {
return `session:host-info-${tabId}`;
},
/**
* Save host info for a tab
*/
async set(tabId: number, data: HostInfo) {
await storage.setItem<HostInfo>(this.getKey(tabId), data);
},
/**
* Get host info for a tab
*/
async get(tabId: number): Promise<HostInfo | null> {
return await storage.getItem<HostInfo>(this.getKey(tabId));
},
/**
* Clear data when a tab is closed
*/
async remove(tabId: number) {
await storage.removeItem(this.getKey(tabId));
}
};