import Transport from 'winston-transport'; export declare enum ClientType { 'mssql' = 0, 'mysql2' = 1, 'pg' = 2 } export interface SqlTransportOptions { client: keyof typeof ClientType; connection: any; defaultMeta?: any; label?: string; level?: string; name?: string; silent?: boolean; tableName?: string; } export interface SqlTransport extends SqlTransportOptions { client: any; defaultMeta: any; label: string; level: string; name: string; silent: boolean; tableName: string; } export interface QueryOptions { fields?: string[]; from?: Date | string; order?: string; rows?: number; until?: Date | string; } export declare class SqlTransport extends Transport { /** * Constructor for the universal transport object. * @constructor * @param {Object} options * @param {string} options.client - Database client * @param {string} options.connection - Database connection uri | object * @param {string} [options.label] - Label stored with entry object if defined. * @param {string} [options.level=info] - Level of messages that this transport * should log. * @param {string} [options.name] - Transport instance identifier. Useful if you * need to create multiple universal transports. * @param {boolean} [options.silent=false] - Boolean flag indicating whether to * suppress output. * @param {string} [options.tableName=winston_logs] - The name of the table you * want to store log messages in. */ constructor(options: SqlTransportOptions); /** * Create logs table. * @return {Promise} result of creation within a Promise */ init(): Promise; /** * End the connection * Return a Promise which resolves when all queries are finished and the underlying connections are closed. * @return {Promise} result within a Promise */ end(): Promise; /** * Flush all logs * Return a Promise which resolves when all logs are finished. * @return {Promise} result within a Promise */ flush(): Promise; /** * Core logging method exposed to Winston. Metadata is optional. * @param {Object} info * @param {string} [info.level] - Level at which to log the message. * @param {string} [info.message] - Message to log * @param {Function} callback - Continuation to respond to when complete. */ log(info: any, callback: (e: unknown, data: any) => void): void; /** * Query the transport. Options object is optional. * @param {Object} options - Loggly-like query options for this instance. * @param {string} [options.from] - Start time for the search. * @param {string} [options.until=now] - End time for the search. Defaults to "now". * @param {string} [options.rows=100] - Limited number of rows returned by search. Defaults to 100. * @param {string} [options.order=desc] - Direction of results returned, either "asc" or "desc". * @param {string[]} [options.fields=[]] * @param {Function} callback - Continuation to respond to when complete. */ query(options: QueryOptions, callback: (e: unknown, data: any) => void): void; }