import MicroEmitter from './micro-emitter'; declare const ERROR = "error"; declare const WARN = "warn"; declare const INFO = "info"; declare const DEBUG = "debug"; declare type EventNames = typeof ERROR | typeof WARN | typeof INFO | typeof DEBUG; declare type EmittedEvents = { [name in EventNames]: (logArea: string, message: string, context?: Record, options?: Record) => void; }; declare type LogParams = Parameters; /** * The shared js log, which allows posting messages and listening to them. * @example * // to log * ```ts * log.warn("Area", "Warning... such and so...", { data: context}); * ``` * // to listen to all logs on the console * * ```ts * log.on(log.DEBUG, console.debug.bind(console)); * log.on(log.INFO, console.info.bind(console)); * log.on(log.WARN, console.info.bind(console)); * log.on(log.ERROR, console.error.bind(console)); * ``` */ export declare class Log extends MicroEmitter { /** * The Debug event constant. */ readonly DEBUG = "debug"; /** * The info event constant. */ readonly INFO = "info"; /** * The warn event constant. */ readonly WARN = "warn"; /** * the error event constant. */ readonly ERROR = "error"; constructor(); /** * @param area - The area of the code e.g. "Streaming" or "TransportBatch". * @param message - The error message e.g. "Something has gone wrong". * @param context - (optional) Data associated with the event. * @param options - (optional) Options object */ error(...args: LogParams): this; /** * @param area - The area of the code e.g. "Streaming" or "TransportBatch". * @param message - The error message e.g. "Something has gone wrong". * @param context - (optional) Data associated with the event. * @param options - (optional) Options object */ warn(...args: LogParams): this; /** * @param area - The area of the code e.g. "Streaming" or "TransportBatch". * @param message - The error message e.g. "Something has gone wrong". * @param context - (optional) Data associated with the event. * @param options - (optional) Options object */ info(...args: LogParams): this; /** * @param area - The area of the code e.g. "Streaming" or "TransportBatch". * @param message - The error message e.g. "Something has gone wrong". * @param context - (optional) Data associated with the event. * @param options - (optional) Options object */ debug(...args: LogParams): this; } declare const _default: Log; export default _default;