import JSONdb from 'simple-json-db'; import { StorageInterface } from "./StorageInterface"; const db = new JSONdb('./data.json'); /** * Implementace úložiště používající JSON soubor. */ export default class JsonStorage implements StorageInterface { hasData(key: string): Promise { return Promise.resolve(db.has(key)); } getData(key: string): Promise { return db.get(key); } setData(key: string, data: Type): Promise { db.set(key, data); return Promise.resolve(); } }