@vonage/client-sdk
Version:
The Client SDK is intended to provide a ready solution for developers to build Programmable Conversation applications across multiple Channels including: Messages, Voice, SIP, websockets, and App.
54 lines (53 loc) • 2.13 kB
TypeScript
import { Nullable } from '../kotlin/clientsdk-clientcore_js';
import vonage from '../utils/vonage';
/**
* A group of Topics that a {@link VonageLogger} can subscribe to
*/
export type Topics = vonage.Topics | typeof Topics.prototype.name;
/**
* A group of Topics that a {@link VonageLogger} can subscribe to
*/
export declare const Topics: typeof vonage.Topics;
export type Topic = vonage.TopicJS;
export declare const Topic: typeof vonage.TopicJS;
export type LoggingLevelName = typeof vonage.LoggingLevelJS.prototype.name;
/**
* The Client Logging Level.
*
* It can be set for the internal logger via {@link ClientInitConfigObject.loggingLevel}
* as well as for a custom logger via {@link VonageLogger.minLogLevel}.
*
* @enum
*/
export declare const LoggingLevel: {
readonly Verbose: "Verbose";
readonly Debug: "Debug";
readonly Info: "Info";
readonly Warn: "Warn";
readonly Error: "Error";
readonly Assert: "Assert";
};
export type LoggingLevel = vonage.LoggingLevelJS | LoggingLevelName;
/**
* An interface representing a client logger to be set via {@link ClientInitConfigObject.customLoggers}
*
* @property name The name of the logger.
* @property minLogLevel The minimum log level of the logger.
* @property topics The topics that the logger is subscribed to.
* @property onLog The callback to be invoked when a log is emitted.
*
* @example
* [[include: snippet_Logging.txt]]
*/
export type VonageLogger = VonageLoggerJS | ({
minLogLevel?: LoggingLevel;
topics?: Topics[];
} & Omit<VonageLoggerJS, 'minLogLevel' | 'topics'>);
export declare const convertLogger: (logger: VonageLogger) => VonageLoggerJS;
export interface VonageLoggerJS {
name: string;
minLogLevel?: Nullable<vonage.LoggingLevelJS>;
topics?: Nullable<vonage.Topics[]>;
onLog(level: LoggingLevelName, topic: Topic, message: string): void;
}
export declare const createVonageLogger: (name: string, onLog: (level: LoggingLevelName, topic: Topic, message: string) => void, minLogLevel?: LoggingLevel, topics?: Topics[]) => VonageLogger;