Options
All
  • Public
  • Public/Protected
  • All
Menu

Radical Console

Index

Type aliases

CommandConfigEnabledType

CommandConfigEnabledType: boolean | function

CommandConfigFunction

CommandConfigFunction: function

Type declaration

    • <T>(cls: Function, args?: any[]): T
    • Type parameters

      Parameters

      • cls: Function
      • Optional args: any[]

      Returns T

HelpHelperOverrideType

HelpHelperOverrideType: function

Type declaration

LogLevel

LogLevel: "error" | "warn" | "alert" | "notice" | "help" | "info" | "verbose" | "data" | "debug" | "silly" | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

OptionConfigFunction

OptionConfigFunction: function

Type declaration

    • Parameters

      • cls: Object
      • key: string
      • args: any[]

      Returns OptionConfig

ParseArgumentsFunction

ParseArgumentsFunction: function

Used in the CLI, after parsing the argv, this arguments go to the handle for the command

param
param
returns

, missing: Array, valid: boolean}}

Type declaration

PrepareArgumentsFunction

PrepareArgumentsFunction: function

called in decorator, transforms config.name with all arguments to a proper structure

Type declaration

    • <T, CommandConfig>(config: T): T
    • Type parameters

      • T: CommandConfig

      • CommandConfig

      Parameters

      • config: T

      Returns T

ServiceIdentifier

ServiceIdentifier: interfaces.ServiceIdentifier<any>

SubCommandsFindFunction

SubCommandsFindFunction: function

Type declaration

    • (filePath: string): string[]
    • Parameters

      • filePath: string

      Returns string[]

SubCommandsGetFunction

SubCommandsGetFunction: function

Type declaration

    • <T>(filePath: string, recursive?: boolean, asArray?: boolean): T

TransformArgumentFunction

TransformArgumentFunction: function

Type declaration

TransformOptionsFunction

TransformOptionsFunction: function

Transforms a OptionConfig array (usually found on CommandConfig) to yargs-parser options. This is used on the cli:parse event (fired in Cli#parse) and cli:execute:parse (fired in Cli#executeCommand)

see

{Cli)

Type declaration

Variables

cli

cli: Cli = container.get<Cli>('cli')

colors

colors: object

Type declaration

config

config: Config = BaseConfig.makeProperty(_config)

container

container: Container = Container.getInstance()

lazyInject

lazyInject: function = getDecorators(container).lazyInject

Type declaration

    • (serviceIdentifier: string | symbol | Newable<any> | Abstract<any>): function
    • Parameters

      • serviceIdentifier: string | symbol | Newable<any> | Abstract<any>

      Returns function

        • (proto: any, key: string): void
        • Parameters

          • proto: any
          • key: string

          Returns void

levels

levels: object

Type declaration

logLevels

logLevels: string[] = [ 'error', 'warn', 'alert', 'notice', 'help', 'info', 'verbose', 'data', 'debug', 'silly' ]

parser

parser: Parser = new Parser()

provide

provide: function = makeProvideDecorator(container)

Type declaration

    • (serviceIdentifier: string | symbol | Newable<any> | Abstract<any>): function
    • Parameters

      • serviceIdentifier: string | symbol | Newable<any> | Abstract<any>

      Returns function

        • (target: any): any
        • Parameters

          • target: any

          Returns any

transports

transports: TransportInstance[] = [new (wtransports.Console)({// json : true,colorize : true,prettyPrint: true,// timestamp : true,showLevel: true,formatter: function (options: ConsoleTransportOptions) {// Return string will be passed to logger.let message = options[ 'message' ] ? options[ 'message' ] : ''let color = config.syslog.colors[ options.level ] || config.cli.colors[ options.level ]let level = parser.parse(`{${color}}${options.level}{/${color}}`)let meta: any = getConsoleMeta(options);let metaPrefix = meta.length > 200 ? '\n' : '\t'return `${level} :: ${message} ${metaPrefix}${meta}`// level : 'info',// handleExceptions: true,// label: string|null;// formatter(opts?:ConsoleTransportOptions) : string{// return opts['message'];// }}})]

Functions

alwaysRun

  • alwaysRun(): MethodDecorator
  • Returns MethodDecorator

bindTo

  • Parameters

    Returns function

      • (target: any): any
      • Parameters

        • target: any

        Returns any

command

  • command(name: string, config?: CommandConfig): ClassDecorator
  • command(name: string, description?: string, config?: CommandConfig): ClassDecorator
  • Parameters

    Returns ClassDecorator

  • Parameters

    • name: string
    • Optional description: string
    • Optional config: CommandConfig

    Returns ClassDecorator

getConsoleMeta

  • getConsoleMeta(options: ConsoleTransportOptions): string
  • Parameters

    • options: ConsoleTransportOptions

    Returns string

helper

  • helper(name: string): ClassDecorator
  • helper(options: HelperOptions): ClassDecorator
  • helper(name: string, options: HelperOptions): ClassDecorator
  • Parameters

    • name: string

    Returns ClassDecorator

  • Parameters

    Returns ClassDecorator

  • Parameters

    Returns ClassDecorator

inject

  • Parameters

    Returns function

      • (target: any, targetKey: string, index?: number | undefined): void
      • Parameters

        • target: any
        • targetKey: string
        • Optional index: number | undefined

        Returns void

injectable

  • injectable(): function
  • Returns function

      • (target: any): any
      • Parameters

        • target: any

        Returns any

option

  • option(opt: any): any
  • option(config: OptionConfig): PropertyDecorator
  • option(type: KindOf, config?: OptionConfig): PropertyDecorator
  • option(key: string, type: KindOf, config?: OptionConfig): PropertyDecorator
  • option(key: string, description: string, config?: OptionConfig): PropertyDecorator
  • option(key: string, description: string, type?: KindOf, config?: OptionConfig): PropertyDecorator
  • Parameters

    • opt: any

    Returns any

  • Parameters

    Returns PropertyDecorator

  • Parameters

    Returns PropertyDecorator

  • Parameters

    Returns PropertyDecorator

  • Parameters

    • key: string
    • description: string
    • Optional config: OptionConfig

    Returns PropertyDecorator

  • Parameters

    • key: string
    • description: string
    • Optional type: KindOf
    • Optional config: OptionConfig

    Returns PropertyDecorator

setLogLevel

  • Parameters

    Returns void

setVerbosity

  • setVerbosity(verbosity: number): void
  • Parameters

    • verbosity: number

    Returns void

singleton

  • Parameters

    Returns function

      • (target: any): any
      • Parameters

        • target: any

        Returns any

Object literals

defaults

defaults: object

argument

command

  • command<T, CommandConfig>(cls: Function): T
  • Type parameters

    • T: CommandConfig

    • CommandConfig

    Parameters

    • cls: Function

    Returns T

config

  • Returns CliConfig

events

  • events(): EventsConstructorOptions
  • Returns EventsConstructorOptions

helper

option

  • Parameters

    • cls: Object
    • key: string

    Returns OptionConfig

Generated using TypeDoc