var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
import { StorageEngine } from './storage';
export var LocalStorage = (function (_super) {
    __extends(LocalStorage, _super);
    function LocalStorage(options) {
        if (options === void 0) { options = {}; }
        _super.call(this);
    }
    LocalStorage.prototype.get = function (key) {
        return new Promise(function (resolve, reject) {
            try {
                var value = window.localStorage.getItem(key);
                resolve(value);
            }
            catch (e) {
                reject(e);
            }
        });
    };
    LocalStorage.prototype.set = function (key, value) {
        return new Promise(function (resolve, reject) {
            try {
                window.localStorage.setItem(key, value);
                resolve();
            }
            catch (e) {
                reject(e);
            }
        });
    };
    LocalStorage.prototype.remove = function (key) {
        return new Promise(function (resolve, reject) {
            try {
                window.localStorage.removeItem(key);
                resolve();
            }
            catch (e) {
                reject(e);
            }
        });
    };
    LocalStorage.prototype.clear = function () {
        return new Promise(function (resolve, reject) {
            try {
                window.localStorage.clear();
                resolve();
            }
            catch (e) {
                reject(e);
            }
        });
    };
    return LocalStorage;
}(StorageEngine));
