import { ConsoleProvider, ConsoleRegistration } from "@openremote/model";
import { Deferred } from "./util";
export interface ProviderAction {
    provider: string;
    action: string;
}
export interface ProviderMessage extends ProviderAction {
    data?: any;
    [x: string]: any;
}
export interface ProviderEnableRequest extends ProviderMessage {
    consoleId: string;
}
export interface ProviderEnableResponse extends ProviderMessage {
    hasPermission: boolean;
    success: boolean;
}
/**
 * Storage provider is a special case that must always be available and doesn't require init/enable logic
 */
export declare class Console {
    protected _realm: string;
    protected _registration: ConsoleRegistration;
    protected _autoEnable: boolean;
    protected _initialised: boolean;
    protected _initialiseInProgress: boolean;
    protected _pendingProviderPromises: {
        [name: string]: [Deferred<any>, number];
    };
    protected _providerMessageListeners: {
        [name: string]: (msg: ProviderMessage) => void;
    };
    protected _pendingProviderEnables: string[];
    protected _enableCompleteCallback: (() => void) | null;
    protected _registrationTimer: number | null;
    constructor(realm: string, autoEnable: boolean, enableComplete: () => void);
    get registration(): ConsoleRegistration;
    get autoEnable(): boolean;
    get pendingProviderEnables(): string[];
    get shellApple(): boolean;
    get shellAndroid(): boolean;
    get isMobile(): boolean;
    initialise(): Promise<void>;
    enableProviders(): Promise<void>;
    enableProvider(providerName: string, data?: any): Promise<ProviderEnableResponse>;
    disableProvider(provider: string): Promise<ProviderMessage>;
    getProvider(name: string): ConsoleProvider | undefined;
    sendProviderMessage(message: ProviderMessage, waitForResponse: boolean): Promise<any | null>;
    sendRegistration(delay?: number): Promise<void>;
    storeData(key: string, value: any): void;
    retrieveData<T>(key: string): Promise<T | undefined>;
    addProviderMessageListener(providerAction: ProviderAction, listener: (msg: ProviderMessage) => void): void;
    removeProviderMessageListener(providerAction: ProviderAction): void;
    protected _postNativeShellMessage(jsonMessage: any): any;
    /**
     * Function that allows sending of custom types and messages towards the console.
     * TODO: Will be improved in the future, see this GitHub issue; https://github.com/openremote/openremote/issues/1318
     */
    _doSendGenericMessage(type: string, msg: any): void;
    _doSendProviderMessage(msg: any): void;
    protected _handleProviderResponse(msg: any): void;
    protected _callCompletedCallback(): void;
    protected static _createConsoleRegistration(): ConsoleRegistration;
    protected _initialiseProvider(providerName: string): Promise<void>;
}
//# sourceMappingURL=console.d.ts.map