@goldstack/utils-cli
Version:
Utilities for building command line interfaces.
30 lines • 1.05 kB
TypeScript
type AsyncFunction<O> = () => Promise<O>;
/**
* Interface defining the required logger instance methods
*/
export interface LoggerInstance {
debug: (obj: object | null | undefined, msg?: string) => void;
info: (obj: object | null | undefined, msg?: string) => void;
warn: (obj: object | null | undefined, msg?: string) => void;
error: (obj: object | null | undefined, msg?: string) => void;
}
/**
* Configuration options for the logger
*/
export interface LoggerConfig {
/** Custom logger instance implementing LoggerInstance interface */
instance?: LoggerInstance;
}
/**
* Configure the logger instance
* @param config - Configuration options for the logger
*/
export declare function configureLogger(config: LoggerConfig): void;
/**
* Get the current logger instance
* @returns The configured logger instance or the default pino logger
*/
export declare function logger(): LoggerInstance;
export declare const wrapCli: (func: AsyncFunction<any>) => Promise<void>;
export {};
//# sourceMappingURL=utilsCli.d.ts.map