diff --git a/tgui/global.d.ts b/tgui/global.d.ts index b49a40816eea..b64bd4006dbe 100644 --- a/tgui/global.d.ts +++ b/tgui/global.d.ts @@ -222,6 +222,6 @@ interface Window { // 516 byondstorage API. hubStorage: Storage; - byondStorage: Storage; + domainStorage: Storage; serverStorage: Storage; } diff --git a/tgui/packages/common/storage.ts b/tgui/packages/common/storage.ts index 238aaf913779..b2564acf36dc 100644 --- a/tgui/packages/common/storage.ts +++ b/tgui/packages/common/storage.ts @@ -6,12 +6,6 @@ * @license MIT */ -declare interface Window { - hubStorage: Storage; - msIndexedDB: IDBFactory; - msIDBTransaction: IDBTransaction; -} - export const IMPL_MEMORY = 0; export const IMPL_HUB_STORAGE = 1; export const IMPL_INDEXED_DB = 2; @@ -25,16 +19,16 @@ const INDEXED_DB_VERSION = 1; const INDEXED_DB_NAME = 'tgui'; const INDEXED_DB_STORE_NAME = 'storage-v1'; -const READ_ONLY = 'readonly' as const; -const READ_WRITE = 'readwrite' as const; +const READ_ONLY = 'readonly'; +const READ_WRITE = 'readwrite'; -interface StorageBackend { +type StorageBackend = { impl: StorageImplementation; get(key: string): Promise; set(key: string, value: any): Promise; remove(key: string): Promise; clear(): Promise; -} +}; const testGeneric = (testFn: () => boolean) => (): boolean => { try {