/*!
 * Copyright 2017 - 2020 by ChartIQ, Inc.
 * All rights reserved.
 */
import { IRouterClient } from "./routerClientInstance";
import { StandardError } from "../types";
import { LogMessage, CentralLoggerClientState, LogLevel, LogCategory } from "../services/logger/types";
export declare class LoggerConnection {
    routerClient: IRouterClient | null;
    viewId: number | null;
    isRegistering: boolean;
    isRegistered: boolean;
    calibratedTimeStampOffset: number;
    newCalibratedTimeStampOffset: number;
    filteredMessagesCounter: number;
    startupTime: number;
    loggerQueue: LogMessage[];
    loggerClientName: string;
    onLogStateChangeCallback: ((newState: CentralLoggerClientState) => void)[];
    currentLogState: CentralLoggerClientState;
    system: {
        error: (...args: any[]) => void;
        warn: (...args: any[]) => void;
        info: (...args: any[]) => void;
        log: (...args: any[]) => void;
        debug: (...args: any[]) => void;
        verbose: (...args: any[]) => void;
        deprecated: (...args: any[]) => void;
    };
    perf: {
        error: (...args: any[]) => void;
        warn: (...args: any[]) => void;
        info: (...args: any[]) => void;
        log: (...args: any[]) => void;
        debug: (...args: any[]) => void;
        verbose: (...args: any[]) => void;
        deprecated: (...args: any[]) => void;
    };
    /**
     * Writes to "system" and also the local console. Use this when you need console messages
     * prior to connecting with the logger service.
     */
    console: {
        error: (...args: any[]) => void;
        warn: (...args: any[]) => void;
        info: (...args: any[]) => void;
        log: (...args: any[]) => void;
        debug: (...args: any[]) => void;
        verbose: (...args: any[]) => void;
        deprecated: (...args: any[]) => void;
    };
    transmitAndClearQueue: () => void;
    constructor();
    updateQueueBasedOnState(calibrateTimeFlag: boolean): void;
    onStateChanged(cb: (newState: CentralLoggerClientState) => void): void;
    setLogState(state: CentralLoggerClientState, calibrateTimeFlag: boolean): void;
    addToQueue(message: LogMessage): void;
    callStack(): string;
    setting(): CentralLoggerClientState;
    outputToConsole(level: LogLevel, args: any[]): void;
    formatAndQueueMessage(category: LogCategory, level: LogLevel, args: any[]): void;
    logIt(category: LogCategory, level: LogLevel, args: any[]): void;
    error(...args: any[]): void;
    warn(...args: any[]): void;
    info(...args: any[]): void;
    log(...args: any[]): void;
    debug(...args: any[]): void;
    verbose(...args: any[]): void;
    deprecated(...args: any[]): void;
    completeRegistration(loggerState?: CentralLoggerClientState): void;
    registerWithLoggerService(): void;
    unregisterClient(params?: {
        clientName: string;
        deleteFromPersistence?: boolean;
        viewId?: number;
    }, cb?: (err: StandardError, data?: any) => void): void;
    setRouterClient: (routerClient: IRouterClient) => void;
    waitForServiceAndCalibrate(): void;
    start(routerClient?: IRouterClient): Promise<void>;
}
/**
 * @introduction
 *
 * <h2>Logger Client (Finsemble Workspaces)</h2>
 *
 * The Logger Client supports very efficient and configurable run-time logging to the <a href=tutorial-CentralLogger.html>Central Logger</a>.
 * Logging has a small performance overhead, so developers can liberally instrument their code with log messages for debugging and diagnostics.
 * By default, only error and warning messages are captured by the Logger, with the other message types (e.g., log, info, debug) disabled.
 * Which message types are enabled or disabled is fully controlled from the <a href=tutorial-CentralLogger.html>Central Logger</a> - this means developers can fully instrument their code once and dynamically enable and disable logging later, as needed, for debugging or field support.
 *
 * The Finsemble team uses the Central Logger to <a href=tutorial-Troubleshooting.html>capture log message for field support</a>.
 * Finsemble customers, building their own Finsemble applications, have the option to do the same.
 *
 * **Note:** The Logger Client **wraps** all console logging (e.g., `console.error`, `console.log`) so these message can also be captured and viewed in the Central Logger, but console logging is never disabled locally. For better performance, we recommend most of your code's instrumentation be based on the Logger Client (e.g., `FSBL.Clients.Logger.debug(...)` instead of the `console.debug(...)`).
 *
 * Using the Logger is similar to using the browser's console for logging (e.g., `console.error` or `console.log`), although the Logger Client is accessed through the FSBL object as shown in the examples below.
 *
 *```javascript
 * 			FSBL.Clients.Logger.error("an error message", anErrorObject);
 * 			FSBL.Clients.Logger.warn("a warning message", object1, object2, object3);
 * 			FSBL.Clients.Logger.log("logging message");
 * 			FSBL.Clients.Logger.info("logging message");
 * 			FSBL.Clients.Logger.log("log message");
 * 			FSBL.Clients.Logger.debug("debug message");
 *```
 * The Logger Client also supports system logging (e.g., `Logger.system.log`) for Finsemble's internal logging. All Finsemble client APIs are in the process of being instrumented to log their entry-point calls and parameters, as shown below.
 *
 *```javascript
 * 			Logger.system.info("RouterClient.transmit", "TO CHANNEL", toChannel, "EVENT", event);
 *```
 * Developers can view all system logging in the Central Logger, although only `Logger.system.info` messages (recording API interactions) are intended for use outside the Finsemble development team.
 *
 *<strong>Note:</strong> Any service can also use the Logger by directing requiring the client. The Logger can immediately be used, but log message will not be transmitted to the Central Logger until `Logger.start()` is invoked (as shown below).
 *```javascript
 *
 * 			var Logger = require("../../clients/logger").default;
 * 			Logger.log("Service Ready");
 * 			Logger.start();
 *```
 * @hideConstructor
 * @shouldBePublished true
 * @class Logger
 * @constructor
 */
declare const CentralLoggerClient: {
    /**
     * Starts the logger client. There is no need to wait for this method to finish
     * because the logger client queues messages until it connects. logger.start() must be
     * called explicitly by each FSBL entry point.
     * @private
     */
    start: (routerClient?: {
        onReady: (cb?: (() => void) | undefined) => Promise<void>;
        addListener: <T = any>(channel: string, eventHandler: (err: null, response: import("./routerClientInstance").ListenerResponse<T>) => void) => import("./routerClientInstance").RouterListenerUnsubscribe;
        transmit: <T_1 = any>(toChannel: string, data: T_1, options?: {
            suppressWarnings: boolean;
        } | undefined) => void;
        removeListener: (channel: string, eventHandler: Function) => void;
        addResponder: <Q = any, R = any>(channel: string, queryEventHandler: import("../types").StandardErrorCallback<import("./routerClientInstance").ResponderMessage<Q, R>>) => void;
        query: <Q_1 = any, R_1 = any>(responderChannel: string, queryEvent: Q_1, queryParams?: {
            timeout?: number | undefined;
            logWhenNoResponder?: boolean | undefined;
        } | import("./routerClientInstance").QueryResponseCallback<R_1> | undefined, responseEventHandler?: import("./routerClientInstance").QueryResponseCallback<R_1> | undefined) => Promise<import("./routerClientInstance").StandardQueryResponse<R_1>>;
        removeResponder: (responderChannel: string) => void;
        addPubSubResponder: <T_2 = any>(topic: string | RegExp, initialState?: object | undefined, params?: {
            subscribeCallback?: import("./routerClientInstance").SubscribeCallback<T_2> | undefined;
            unsubscribeCallback?: import("./routerClientInstance").UnsubscribeCallback | undefined;
            publishCallback?: import("./routerClientInstance").PublishCallback<T_2> | undefined;
        } | undefined, callback?: ((err?: string | Error | undefined, result?: "success" | undefined) => void) | undefined) => void;
        removePubSubResponder: (topic: string | RegExp) => void;
        subscribe: <T_3 = any>(topic: string, notifyCallback: (err: StandardError, response: import("./routerClientInstance").SubscriberResponse<T_3>) => void) => {
            subscribeID: string;
            topic: string;
        };
        publish: <T_4 = any>(topic: string, event: T_4) => void;
        unsubscribe: (subscribeIDStruct: {
            subscribeID: string;
            topic: string;
        }) => void;
        trustedMessage: (incomingMessage: import("./routerClientInstance").RouterMessage<any>) => boolean;
        disconnectAll: () => void;
        calibrateTimeWithRouterService(callback: (offset: number) => void): void;
    } | undefined) => void;
    /**
     * @private
     */
    channelFilter: (channel: string) => boolean;
    /**
     * @private
     */
    setting: () => CentralLoggerClientState;
    /**
     * @private
     */
    callStack: () => string;
    /**
     * @private
     */
    unregisterClient: (params?: {
        clientName: string;
        deleteFromPersistence?: boolean | undefined;
        viewId?: number | undefined;
    } | undefined, cb?: ((err: StandardError, data?: any) => void) | undefined) => void;
    /**
     * Sets the router client for this instance of the Logger client.
     * @private
     */
    setRouterClient: (routerClient: IRouterClient) => void;
    /**
     * Used by assimilation service
     * @private
     */
    onStateChanged(cb: (newState: CentralLoggerClientState) => void): void;
    /**
     * Log a dev error message.
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.error("some message", parm1, parm2);
     */
    error: (...args: any[]) => void;
    /**
     * Log a dev warning message.
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.warn("some message", parm1, parm2);
     */
    warn: (...args: any[]) => void;
    /**
     * Log a dev info message.
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.info("some message", parm1, parm2);
     */
    info: (...args: any[]) => void;
    /**
     * Log a dev log message.
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.log("some message", parm1, parm2);
     */
    log: (...args: any[]) => void;
    /**
     * Log a dev debug message.
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.debug("some message", parm1, parm2);
     */
    debug: (...args: any[]) => void;
    /**
     * Log a dev verbose message (an extra level of verbose-debug output).
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.verbose("some message", parm1, parm2);
     */
    verbose: (...args: any[]) => void;
    /**
     * Log the use of a deprecated API, config, component, or otherwise
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.deprecated("some message", parm1, parm2);
     *
     * @private
     */
    deprecated: (...args: any[]) => void;
    /**
     * @private
     */
    system: {
        error: (...args: any[]) => void;
        warn: (...args: any[]) => void;
        info: (...args: any[]) => void;
        log: (...args: any[]) => void;
        debug: (...args: any[]) => void;
        verbose: (...args: any[]) => void;
        deprecated: (...args: any[]) => void;
    };
    /**
     * @private
     */
    perf: {
        error: (...args: any[]) => void;
        warn: (...args: any[]) => void;
        info: (...args: any[]) => void;
        log: (...args: any[]) => void;
        debug: (...args: any[]) => void;
        verbose: (...args: any[]) => void;
        deprecated: (...args: any[]) => void;
    };
    /**
     * @private
     *
     * logger.console.<level> is equivalent to logger.system.<level> except that the log
     * message is also displayed in the developer tools debugger. This set of functions
     * obeys the log level that is set within Central Logger (whereas `console.log` does not).
     *
     * When a window is starting up, logger.console.<level> will *always* log to the console
     * if it is called before the window has received its initial log level settings from
     * the logger service. This can be useful for debugging startup issues (without creating
     * stray console.log() statements).
     */
    console: {
        error: (...args: any[]) => void;
        warn: (...args: any[]) => void;
        info: (...args: any[]) => void;
        log: (...args: any[]) => void;
        debug: (...args: any[]) => void;
        verbose: (...args: any[]) => void;
        deprecated: (...args: any[]) => void;
    };
};
/** An implementation of the ICentralLogger interface that
 * merely logs straight to the console rather than going over to
 * Central Logging service. Used in situations where use of the
 * Central Logging service is not possible (such as in test
 * environments, or in the Central Logging service itself).
 */
export declare const LocalLogger: ICentralLogger;
export declare type ICentralLogger = typeof CentralLoggerClient;
export declare const LoggerClient: ICentralLogger;
export declare const Logger: {
    /**
     * Starts the logger client. There is no need to wait for this method to finish
     * because the logger client queues messages until it connects. logger.start() must be
     * called explicitly by each FSBL entry point.
     * @private
     */
    start: (routerClient?: {
        onReady: (cb?: (() => void) | undefined) => Promise<void>;
        addListener: <T = any>(channel: string, eventHandler: (err: null, response: import("./routerClientInstance").ListenerResponse<T>) => void) => import("./routerClientInstance").RouterListenerUnsubscribe;
        transmit: <T_1 = any>(toChannel: string, data: T_1, options?: {
            suppressWarnings: boolean;
        } | undefined) => void;
        removeListener: (channel: string, eventHandler: Function) => void;
        addResponder: <Q = any, R = any>(channel: string, queryEventHandler: import("../types").StandardErrorCallback<import("./routerClientInstance").ResponderMessage<Q, R>>) => void;
        query: <Q_1 = any, R_1 = any>(responderChannel: string, queryEvent: Q_1, queryParams?: {
            timeout?: number | undefined;
            logWhenNoResponder?: boolean | undefined;
        } | import("./routerClientInstance").QueryResponseCallback<R_1> | undefined, responseEventHandler?: import("./routerClientInstance").QueryResponseCallback<R_1> | undefined) => Promise<import("./routerClientInstance").StandardQueryResponse<R_1>>;
        removeResponder: (responderChannel: string) => void;
        addPubSubResponder: <T_2 = any>(topic: string | RegExp, initialState?: object | undefined, params?: {
            subscribeCallback?: import("./routerClientInstance").SubscribeCallback<T_2> | undefined;
            unsubscribeCallback?: import("./routerClientInstance").UnsubscribeCallback | undefined;
            publishCallback?: import("./routerClientInstance").PublishCallback<T_2> | undefined;
        } | undefined, callback?: ((err?: string | Error | undefined, result?: "success" | undefined) => void) | undefined) => void;
        removePubSubResponder: (topic: string | RegExp) => void;
        subscribe: <T_3 = any>(topic: string, notifyCallback: (err: StandardError, response: import("./routerClientInstance").SubscriberResponse<T_3>) => void) => {
            subscribeID: string;
            topic: string;
        };
        publish: <T_4 = any>(topic: string, event: T_4) => void;
        unsubscribe: (subscribeIDStruct: {
            subscribeID: string;
            topic: string;
        }) => void;
        trustedMessage: (incomingMessage: import("./routerClientInstance").RouterMessage<any>) => boolean;
        disconnectAll: () => void;
        calibrateTimeWithRouterService(callback: (offset: number) => void): void;
    } | undefined) => void;
    /**
     * @private
     */
    channelFilter: (channel: string) => boolean;
    /**
     * @private
     */
    setting: () => CentralLoggerClientState;
    /**
     * @private
     */
    callStack: () => string;
    /**
     * @private
     */
    unregisterClient: (params?: {
        clientName: string;
        deleteFromPersistence?: boolean | undefined;
        viewId?: number | undefined;
    } | undefined, cb?: ((err: StandardError, data?: any) => void) | undefined) => void;
    /**
     * Sets the router client for this instance of the Logger client.
     * @private
     */
    setRouterClient: (routerClient: IRouterClient) => void;
    /**
     * Used by assimilation service
     * @private
     */
    onStateChanged(cb: (newState: CentralLoggerClientState) => void): void;
    /**
     * Log a dev error message.
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.error("some message", parm1, parm2);
     */
    error: (...args: any[]) => void;
    /**
     * Log a dev warning message.
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.warn("some message", parm1, parm2);
     */
    warn: (...args: any[]) => void;
    /**
     * Log a dev info message.
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.info("some message", parm1, parm2);
     */
    info: (...args: any[]) => void;
    /**
     * Log a dev log message.
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.log("some message", parm1, parm2);
     */
    log: (...args: any[]) => void;
    /**
     * Log a dev debug message.
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.debug("some message", parm1, parm2);
     */
    debug: (...args: any[]) => void;
    /**
     * Log a dev verbose message (an extra level of verbose-debug output).
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.verbose("some message", parm1, parm2);
     */
    verbose: (...args: any[]) => void;
    /**
     * Log the use of a deprecated API, config, component, or otherwise
     *
     * @param {any} message parameter of any type that can be stringified (e.g. string, object)
     *
     * @example
     *
     * FSBL.Clients.Logger.deprecated("some message", parm1, parm2);
     *
     * @private
     */
    deprecated: (...args: any[]) => void;
    /**
     * @private
     */
    system: {
        error: (...args: any[]) => void;
        warn: (...args: any[]) => void;
        info: (...args: any[]) => void;
        log: (...args: any[]) => void;
        debug: (...args: any[]) => void;
        verbose: (...args: any[]) => void;
        deprecated: (...args: any[]) => void;
    };
    /**
     * @private
     */
    perf: {
        error: (...args: any[]) => void;
        warn: (...args: any[]) => void;
        info: (...args: any[]) => void;
        log: (...args: any[]) => void;
        debug: (...args: any[]) => void;
        verbose: (...args: any[]) => void;
        deprecated: (...args: any[]) => void;
    };
    /**
     * @private
     *
     * logger.console.<level> is equivalent to logger.system.<level> except that the log
     * message is also displayed in the developer tools debugger. This set of functions
     * obeys the log level that is set within Central Logger (whereas `console.log` does not).
     *
     * When a window is starting up, logger.console.<level> will *always* log to the console
     * if it is called before the window has received its initial log level settings from
     * the logger service. This can be useful for debugging startup issues (without creating
     * stray console.log() statements).
     */
    console: {
        error: (...args: any[]) => void;
        warn: (...args: any[]) => void;
        info: (...args: any[]) => void;
        log: (...args: any[]) => void;
        debug: (...args: any[]) => void;
        verbose: (...args: any[]) => void;
        deprecated: (...args: any[]) => void;
    };
};
export default LoggerClient;
//# sourceMappingURL=logger.d.ts.map