Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ColursInstance

Hierarchy

  • ColursInstance

Implements

Index

Constructors

constructor

Properties

options

options: IColurOptions

Accessors

toHtml

  • get toHtml(): any
  • To Html Returns ansi-html.

    Returns any

Methods

applyAnsi

  • applyAnsi(str: any, style: any | any[], isBrowser?: boolean): any | any[]
  • Parameters

    • str: any
    • style: any | any[]
    • Optional isBrowser: boolean

    Returns any | any[]

applyCss

  • applyCss(str: any, style: string | string[]): any[]
  • To Styles Gets css styles.

    Parameters

    • str: any

      the string to parse styles for.

    • style: string | string[]

      the style or style names to be applied.

    Returns any[]

applyHtml

  • applyHtml(str: any, style: string | string[]): string
  • Apply Styles as HTML Applies ANSI styles then converts to HTML.

    Parameters

    • str: any
    • style: string | string[]

      the style(s) to be applied.

    Returns string

browser

  • browser(state?: boolean): boolean
  • Browser Gets or set the browser state.

    Parameters

    • Optional state: boolean

      the state to set.

    Returns boolean

enabled

  • enabled(state?: boolean): boolean
  • Enabled Gets or set the enabled state.

    Parameters

    • Optional state: boolean

      the state to set.

    Returns boolean

Private end

  • end(style: string): string
  • End Applies the ending style.

    Parameters

    • style: string

      the style to be applied.

    Returns string

Private getInverse

  • getInverse(str: string, def?: string): string
  • Parameters

    • str: string
    • Optional def: string

    Returns string

hasAnsi

  • hasAnsi(val: any): boolean
  • Has Ansi Check if value has ansi styling.

    Parameters

    • val: any

      the value to be inspected.

    Returns boolean

Private log

  • log(type: string, ...args: any[]): void
  • Parameters

    • type: string
    • Rest ...args: any[]

    Returns void

setOption

  • setOption(key: any, val?: any): void
  • Set Option Sets an option(s) for the instance.

    Parameters

    • key: any

      the key or object of options.

    • Optional val: any

      the value to be set.

    Returns void

Private start

  • start(style: string): string
  • Start Applies the starting style.

    Parameters

    • style: string

      the starting style.

    Returns string

strip

  • strip(obj: any): any
  • Strip Strips ansi colors from value.

    Parameters

    • obj: any

      the object to strip color from.

    Returns any

Private styleInstance

  • styleInstance(colurs: any, style: any): c
  • Parameters

    • colurs: any
    • style: any

    Returns c

Generated using TypeDoc