@types/signale
- Version 1.4.7
- Published
- 8.54 kB
- 1 dependency
- MIT license
Install
npm i @types/signale
yarn add @types/signale
pnpm add @types/signale
Overview
TypeScript definitions for signale
Index
Variables
Interfaces
Type Aliases
Variables
variable signale
const signale: signale.SignaleBase<signale.DefaultMethods> & Record<signale.DefaultMethods, signale.LoggerFunc> & { Signale: signale.SignaleConstructor; SignaleConfig: signale.SignaleConfig; SignaleOptions: signale.SignaleOptions; DefaultMethods: signale.DefaultMethods; };
Interfaces
interface CommandType
interface CommandType {}
property badge
badge: string;
The icon corresponding to the logger.
property color
color: string;
The color of the label, can be any of the foreground colors supported by [chalk](https://github.com/chalk/chalk#colors).
property label
label: string;
The label used to identify the type of the logger.
property logLevel
logLevel?: string | undefined;
property stream
stream?: NodeJS.WriteStream | NodeJS.WriteStream[] | undefined;
interface SignaleBase
interface SignaleBase<TTypes extends string = DefaultMethods> {}
method addSecrets
addSecrets: (secrets: string[] | number[]) => void;
Adds new secrets/sensitive-information to the targeted Signale instance.
Parameter secrets
Array holding the secrets/sensitive-information to be filtered out.
method clearSecrets
clearSecrets: () => void;
Removes all secrets/sensitive-information from the targeted Signale instance.
method config
config: (configObj: SignaleConfig) => Signale<TTypes>;
Sets the configuration of an instance overriding any existing global or local configuration.
Parameter configObj
Can hold any of the documented options.
method disable
disable: () => void;
Disables the logging functionality of all loggers belonging to a specific instance.
method enable
enable: () => void;
Enables the logging functionality of all loggers belonging to a specific instance.
method isEnabled
isEnabled: () => boolean;
Checks whether the logging functionality of a specific instance is enabled.
Returns
a boolean that describes whether or not the logger is enabled.
method scope
scope: (...name: string[]) => Signale<TTypes>;
Defines the scope name of the logger.
Parameter name
Can be one or more comma delimited strings.
method time
time: (label?: string) => string;
Sets a timers and accepts an optional label. If none provided the timer will receive a unique label automatically.
Parameter label
Label corresponding to the timer. Each timer must have its own unique label.
Returns
a string corresponding to the timer label.
method timeEnd
timeEnd: ( label?: string, span?: number) => { label: string; span?: number | undefined };
Deactivates the timer to which the given label corresponds. If no label is provided the most recent timer, that was created without providing a label, will be deactivated.
Parameter label
Label corresponding to the timer, each timer has its own unique label.
Parameter span
Total running time.
method unscope
unscope: () => void;
Clears the scope name of the logger.
interface SignaleConfig
interface SignaleConfig {}
property displayBadge
displayBadge?: boolean | undefined;
Display the badge of the logger.
property displayDate
displayDate?: boolean | undefined;
Display the current local date in
YYYY-MM-DD
format.
property displayFilename
displayFilename?: boolean | undefined;
Display the name of the file that the logger is reporting from.
property displayLabel
displayLabel?: boolean | undefined;
Display the label of the logger.
property displayScope
displayScope?: boolean | undefined;
Display the scope name of the logger.
property displayTimestamp
displayTimestamp?: boolean | undefined;
Display the current local time in
HH:MM:SS
format.
property underlineLabel
underlineLabel?: boolean | undefined;
Underline the logger label.
property underlineMessage
underlineMessage?: boolean | undefined;
Underline the logger message.
property underlinePrefix
underlinePrefix?: boolean | undefined;
property underlineSuffix
underlineSuffix?: boolean | undefined;
property uppercaseLabel
uppercaseLabel?: boolean | undefined;
interface SignaleConstructor
interface SignaleConstructor {}
construct signature
new <TTypes extends string = DefaultMethods>( options?: SignaleOptions<TTypes>): Signale<TTypes>;
interface SignaleOptions
interface SignaleOptions<TTypes extends string = DefaultMethods> {}
property config
config?: SignaleConfig | undefined;
Sets the configuration of an instance overriding any existing global or local configuration.
property disabled
disabled?: boolean | undefined;
property interactive
interactive?: boolean | undefined;
property logLevel
logLevel?: string | undefined;
property scope
scope?: string | undefined;
Name of the scope.
property secrets
secrets?: Array<string | number> | undefined;
property stream
stream?: NodeJS.WriteStream | NodeJS.WriteStream[] | undefined;
Destination to which the data is written, can be any valid [Writable stream](https://nodejs.org/api/stream.html#stream_writable_streams).
property timers
timers?: Map<string, Date> | undefined;
property types
types?: Partial<Record<TTypes, CommandType>> | undefined;
Holds the configuration of the custom and default loggers.
Type Aliases
type DefaultMethods
type DefaultMethods = | 'await' | 'complete' | 'error' | 'debug' | 'fatal' | 'fav' | 'info' | 'note' | 'pause' | 'pending' | 'star' | 'start' | 'success' | 'warn' | 'watch' | 'log';
type LoggerFunc
type LoggerFunc = (message?: any, ...optionalArgs: any[]) => void;
type Signale
type Signale<TTypes extends string = DefaultMethods> = SignaleBase<TTypes> & Record<TTypes, LoggerFunc> & Record<DefaultMethods, LoggerFunc>;
Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/signale
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/signale)
- HTML<a href="https://www.jsdocs.io/package/@types/signale"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3259 ms. - Missing or incorrect documentation? Open an issue for this package.