import { BaseStorage } from "@powerhousedao/connect";
import { connectConfig } from "@powerhousedao/connect/config";
const store = {
    get: function (key) {
        const value = localStorage.getItem(key);
        if (value) {
            return JSON.parse(value);
        }
        return undefined;
    },
    set: function (key, value) {
        return value
            ? localStorage.setItem(key, JSON.stringify(value))
            : localStorage.removeItem(key);
    },
    delete: function (key) {
        return localStorage.removeItem(key);
    },
};
export class BrowserStorage extends BaseStorage {
    constructor(namespace) {
        super(store, `${connectConfig.routerBasename}:${namespace}`);
    }
}
//# sourceMappingURL=browser.js.map