/*!
 * Copyright 2017 - 2020 by ChartIQ, Inc.
 * All rights reserved.
 */
import { _BaseClient } from "./baseClient";
import { ComponentMutateParams } from "../services/window/WindowAbstractions/BaseWindow";
import { StandardError, StandardErrorCallback, StandardPromise } from "../types";
/**
 *
 * @introduction
 * <h2>Storage Client (Finsemble Connect)</h2>
 *
 * The Storage Client handles saving and retrieving data for your smart desktop.
 *
 *
 *See the <a href=tutorial-storingData.html>Storing Data tutorial</a> for an overview of using the Storage Client.
 * @hideconstructor
 * @constructor
 */
export declare class StorageClient extends _BaseClient {
    clientReady: boolean;
    constructor();
    /**
     * Logs an "info" level log unless it's an error, in which case it logs a "error" level log
     */
    private log;
    /**
     * Define the user name for storage (i.e., each user has unique storage).
     * @param {object} params
     * @param {string} params.user A unique key to store user data under
     * @param {StandardCallback} [cb] Callback to be called on success.
     *
     * @example
     * FSBL.Clients.StorageClient.setUser({ user: "JohnDeere"});
     */
    setUser(params: {
        user: string;
    }, cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Specifies the data store. For normal operation this function doesn't have to be invoked -- the default data store is set in configuration.
     * @param {Object} params
     * @param {String} params.topic If specified then data store is set only for topic.
     * @param {string} params.dataStore Identifies the data store (e.g. "localStorage", "redis").
     * @param {function} [cb] Callback to be called on success.
     *
     * @deprecated
     *
     * @example
     * FSBL.Clients.StorageClient.setStore({topic:"finsemble", dataStore:"redis"})
     */
    setStore(params: {
        topic: string;
        dataStore?: string;
    }, cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Save a key value pair into storage.
     * @param {Object} params
     * @param {String} params.topic Storage topic for key being stored.
     * @param {String} params.key The key for the value to be stored under.
     * @param {any} params.value The value to be stored.
     * @param {function} [cb] Callback to be called on success.
     *
     * @example
     * FSBL.Clients.StorageClient.save({topic:"finsemble", key:"testKey", value:"testValue"});
     * FSBL.Clients.StorageClient.save({topic:"finsemble", key:"testKey", value:"testValue"}, (err, data) => {});
     * const {err, data} = await FSBL.Clients.StorageClient.save({topic:"finsemble", key:"testKey", value:"testValue"});
     */
    save(params: ComponentMutateParams, cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Rate limited storage save
     * This will be moved into windowStorageManager
     * @private
     */
    save1(params: {
        key: string;
        topic: string;
        value: any;
    }): Promise<{
        err?: StandardError;
        data?: void | undefined;
    }>;
    /**
     * Get a value from storage.
     *
     * @deprecated
     * This function returns a `Promise<T>` and rejects on an error. This is maintained for backward compatibility.
     * Please use getStandardized() for a standardized `Promise<{err, data}>`
     *
     * @param {Object} params
     * @param {String} params.key The key to get from storage.
     * @param {String} params.topic The topic that the data is saved under.
     * @param {function} [cb] Callback to be called on success.
     *
     * @example
     * FSBL.Clients.StorageClient.get({ topic:"finsemble", key:"testKey" }, function(err, data) {
     *	var myData = data;
     * });
     */
    get<T = any>(params: {
        key: string;
        topic: string;
    }, cb?: StandardErrorCallback<T>): Promise<T>;
    /**
     * Get a value from storage.
     *
     * @param {Object} params
     * @param {String} params.key The key to get from storage.
     * @param {String} params.topic The topic that the data is saved under.
     * @param {function} [cb] Callback to be called on success.
     *
     * @example
     * FSBL.Clients.StorageClient.getStandardized({ topic:"finsemble", key:"testKey" }, function(err, data) {
     *	let myData = data;
     * });
     * const {err, data} = await FSBL.Clients.StorageClient.getStandardized({ topic:"finsemble", key:"testKey" });
     */
    getStandardized<T = any>(params: {
        key: string;
        topic: string;
    }, cb?: StandardErrorCallback<T>): StandardPromise<T>;
    /**
     * Rate limited get. This will be moved into windowStorageManager
     * @private
     */
    get1<T = any>(params: {
        key: string;
        topic: string;
    }, cb?: StandardErrorCallback<T>): Promise<T>;
    /**
     * Get all keys for the topic.
     * @param {Object} params
     * @param {String} params.topic Topic for the keys to return.
     * @param {String=} params.keyPrefix Filter all keys that don't start with this prefix.
     * @param {function} [cb] Callback to be called on success.
     *
     * @example
     * FSBL.Clients.StorageClient.keys({topic:"finsemble", keyPrefix:"test"}, function(err, data){
     *	let myKeys = data;
     * });
     * const {err, data} = await FSBL.Clients.StorageClient.keys({topic:"finsemble", keyPrefix:"test"});
     */
    keys(params: {
        topic: string;
        keyPrefix?: string;
    }, cb?: StandardErrorCallback<string[]>): StandardPromise<string[]>;
    /**
     * @private
     * @deprecated Not used internally
     */
    keys1(params: {
        topic: string;
        keyPrefix?: string;
    }): Promise<string[]>;
    /**
     * Get a multiple values from storage based on regex.(coming soon)
     * @param {Object} params
     * @param {function} [cb] Callback to be called on success.
     * @private
     * @deprecated Not used internally
     */
    getMultiple(params: any, cb?: StandardErrorCallback<any>): StandardPromise<any>;
    /**
     * Delete a value from storage.
     * @param {Object} params
     * @param {String} params.key The key to get from storage.
     * @param {String} params.topic The topic that the data is saved under.
     * @param {function} [cb] Callback to be called on success.
     * @example
     * FSBL.Clients.StorageClient.remove({ key:"testKey" })
     * await FSBL.Clients.StorageClient.remove({ key:"testKey" })
     */
    remove(params: {
        key: string;
        topic: string;
    }, cb?: StandardErrorCallback<void>): StandardPromise<void>;
    /**
     * Rate limited remove()
     * @private This will be moved into windowStorageManager
     */
    remove1(params: {
        key: string;
        topic: string;
    }): Promise<{
        err?: StandardError;
        data?: void | undefined;
    }>;
    /**
     * @private
     * @deprecated
     */
    delete(...args: any[]): void;
    /**
     * Clears a storage adapter of all data.
     * @param {function} [cb] The callback to be invoked after the method completes successfully.
     *
     */
    clearCache(cb?: StandardErrorCallback<void>): StandardPromise<void>;
}
declare var storageClient: StorageClient;
export default storageClient;
//# sourceMappingURL=storageClient.d.ts.map