Skip to content

Commit

Permalink
update these two
Browse files Browse the repository at this point in the history
  • Loading branch information
Absolucy committed Dec 25, 2024
1 parent 4d0668e commit 695aead
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion tgui/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,6 @@ interface Window {

// 516 byondstorage API.
hubStorage: Storage;
byondStorage: Storage;
domainStorage: Storage;
serverStorage: Storage;
}
14 changes: 4 additions & 10 deletions tgui/packages/common/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<any>;
set(key: string, value: any): Promise<void>;
remove(key: string): Promise<void>;
clear(): Promise<void>;
}
};

const testGeneric = (testFn: () => boolean) => (): boolean => {
try {
Expand Down

0 comments on commit 695aead

Please sign in to comment.