diff --git a/src/index.ts b/src/index.ts index f39440b..268aea8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,9 +3,14 @@ import { BrowserLocalStorage } from "./browser"; import { NodeDirectoryStorage } from "./node"; /** - * Récupère le meilleur stockage "local" disponible + * Base type for storage usage */ -export function getLocalStorage(appname: string): KeyValueStorage { +export type Storage = KeyValueStorage + +/** + * Get the best "local" storage available + */ +export function getLocalStorage(appname: string): Storage { try { return new ScopedStorage(new BrowserLocalStorage(), appname); } catch { @@ -19,8 +24,8 @@ export function getLocalStorage(appname: string): KeyValueStorage { } /** - * Récupère un stockage "mémoire" + * Get a in-memory volatile storage */ -export function getMemoryStorage(): KeyValueStorage { +export function getMemoryStorage(): Storage { return new MemoryStorage(); }