Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Protected constructor

Properties

cursor

cursor: number

The current cursor position in the input line

line

line: string

The current input data

terminal

terminal: boolean

Static captureRejectionSymbol

captureRejectionSymbol: keyof symbol

Static captureRejections

captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

Static defaultMaxListeners

defaultMaxListeners: number

Static errorMonitor

errorMonitor: keyof symbol

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Methods

[Symbol.asyncIterator]

addListener

  • addListener(event: string, listener: function): this
  • addListener(event: "close", listener: function): this
  • addListener(event: "line", listener: function): this
  • addListener(event: "pause", listener: function): this
  • addListener(event: "resume", listener: function): this
  • addListener(event: "SIGCONT", listener: function): this
  • addListener(event: "SIGINT", listener: function): this
  • addListener(event: "SIGTSTP", listener: function): this
  • events.EventEmitter

    1. close
    2. line
    3. pause
    4. resume
    5. SIGCONT
    6. SIGINT
    7. SIGTSTP

    Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "line"
    • listener: function
        • (input: string): void
        • Parameters

          • input: string

          Returns void

    Returns this

  • Parameters

    • event: "pause"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "resume"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGCONT"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGINT"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGTSTP"
    • listener: function
        • (): void
        • Returns void

    Returns this

close

  • close(): void
  • Returns void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • emit(event: "close"): boolean
  • emit(event: "line", input: string): boolean
  • emit(event: "pause"): boolean
  • emit(event: "resume"): boolean
  • emit(event: "SIGCONT"): boolean
  • emit(event: "SIGINT"): boolean
  • emit(event: "SIGTSTP"): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

  • Parameters

    • event: "close"

    Returns boolean

  • Parameters

    • event: "line"
    • input: string

    Returns boolean

  • Parameters

    • event: "pause"

    Returns boolean

  • Parameters

    • event: "resume"

    Returns boolean

  • Parameters

    • event: "SIGCONT"

    Returns boolean

  • Parameters

    • event: "SIGINT"

    Returns boolean

  • Parameters

    • event: "SIGTSTP"

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getCursorPos

  • Returns the real position of the cursor in relation to the input prompt + string. Long input (wrapping) strings, as well as multiple line prompts are included in the calculations.

    Returns CursorPos

getMaxListeners

  • getMaxListeners(): number

listenerCount

  • listenerCount(event: string | symbol): number
  • Parameters

    • event: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string, listener: function): this
  • on(event: "close", listener: function): this
  • on(event: "line", listener: function): this
  • on(event: "pause", listener: function): this
  • on(event: "resume", listener: function): this
  • on(event: "SIGCONT", listener: function): this
  • on(event: "SIGINT", listener: function): this
  • on(event: "SIGTSTP", listener: function): this
  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "line"
    • listener: function
        • (input: string): void
        • Parameters

          • input: string

          Returns void

    Returns this

  • Parameters

    • event: "pause"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "resume"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGCONT"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGINT"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGTSTP"
    • listener: function
        • (): void
        • Returns void

    Returns this

once

  • once(event: string, listener: function): this
  • once(event: "close", listener: function): this
  • once(event: "line", listener: function): this
  • once(event: "pause", listener: function): this
  • once(event: "resume", listener: function): this
  • once(event: "SIGCONT", listener: function): this
  • once(event: "SIGINT", listener: function): this
  • once(event: "SIGTSTP", listener: function): this
  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "line"
    • listener: function
        • (input: string): void
        • Parameters

          • input: string

          Returns void

    Returns this

  • Parameters

    • event: "pause"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "resume"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGCONT"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGINT"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGTSTP"
    • listener: function
        • (): void
        • Returns void

    Returns this

pause

  • pause(): this
  • Returns this

prependListener

  • prependListener(event: string, listener: function): this
  • prependListener(event: "close", listener: function): this
  • prependListener(event: "line", listener: function): this
  • prependListener(event: "pause", listener: function): this
  • prependListener(event: "resume", listener: function): this
  • prependListener(event: "SIGCONT", listener: function): this
  • prependListener(event: "SIGINT", listener: function): this
  • prependListener(event: "SIGTSTP", listener: function): this
  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "line"
    • listener: function
        • (input: string): void
        • Parameters

          • input: string

          Returns void

    Returns this

  • Parameters

    • event: "pause"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "resume"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGCONT"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGINT"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGTSTP"
    • listener: function
        • (): void
        • Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string, listener: function): this
  • prependOnceListener(event: "close", listener: function): this
  • prependOnceListener(event: "line", listener: function): this
  • prependOnceListener(event: "pause", listener: function): this
  • prependOnceListener(event: "resume", listener: function): this
  • prependOnceListener(event: "SIGCONT", listener: function): this
  • prependOnceListener(event: "SIGINT", listener: function): this
  • prependOnceListener(event: "SIGTSTP", listener: function): this
  • Parameters

    • event: string
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "line"
    • listener: function
        • (input: string): void
        • Parameters

          • input: string

          Returns void

    Returns this

  • Parameters

    • event: "pause"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "resume"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGCONT"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGINT"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "SIGTSTP"
    • listener: function
        • (): void
        • Returns void

    Returns this

prompt

  • prompt(preserveCursor?: boolean): void
  • Parameters

    • Optional preserveCursor: boolean

    Returns void

question

  • question(query: string, callback: function): void
  • Parameters

    • query: string
    • callback: function
        • (answer: string): void
        • Parameters

          • answer: string

          Returns void

    Returns void

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

resume

  • resume(): this
  • Returns this

setMaxListeners

  • setMaxListeners(n: number): this

setPrompt

  • setPrompt(prompt: string): void
  • Parameters

    • prompt: string

    Returns void

write

  • write(data: string | Buffer, key?: Key): void
  • Parameters

    Returns void

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    Returns number

Static on

Static once

Generated using TypeDoc