Class WorkerOutput
Hierarchy
-
EventEmitter
- WorkerOutput
Properties
Methods
Properties
Type declaration
-
[key: string]: WorkerInputEmitter
Type declaration
-
[key: string]: WorkerProgress
Methods
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Close a group of output
Returns void
-
Parameters
-
event: string | symbol
-
Rest ...args: any[]
Returns boolean
-
-
Send an event with default informations
Parameters
-
event: WorkerMessageType
-
Default value infos: any = {}
Returns void
-
-
Returns Array<string | symbol>
-
Returns number
-
Increment to add to progress
Parameters
-
Default value inc: number = 1
-
Default value uid: string = undefined
Returns void
-
-
Parameters
-
type: string | symbol
Returns number
-
-
Parameters
-
event: string | symbol
Returns Function[]
-
-
Log something
Parameters
-
level: WorkerLogLevel
of log to use with filtering
-
Rest ...args: any[]
anything you want to log
Returns void
-
-
Parameters
-
level: WorkerLogLevel
-
context: any
-
Rest ...args: any[]
Returns void
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Create a new group of output Groups will stack
Parameters
-
Default value name: string = ""
of group
Returns void
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Parameters
-
event: string | symbol
Returns Function[]
-
-
Parameters
-
Optional event: string | symbol
Returns this
-
-
Parameters
-
event: string | symbol
-
listener: function
-
-
Parameters
-
Rest ...args: any[]
Returns void
-
-
-
Returns this
-
-
Request a user input
Parameters
-
title: string
of the input
-
Default value type: WorkerInputType = WorkerInputType.STRING
-
Default value regexp: (string | RegExp)[] = [/.*/]
to validate the input
-
Default value waitFor: boolean = true
call waitFor method
-
Default value timeout: number = 0
before giving up on input
Return the input request uuid if no waitFor or the input value Reject with "Request input timmeout" if timeout
Returns Promise<string>
-
-
Send the result of an input To be used by the listeners
Parameters
-
uuid: string
of input
-
value: string
entered by user
Returns void
-
-
Indicate that some listeners allow input
Parameters
-
interactive: boolean
Returns void
-
-
Parameters
-
n: number
Returns this
-
-
Set the output title
Parameters
-
title: string
to set
Returns void
-
-
Start a new progress indicator
Parameters
-
uid: string
-
total: number
-
Default value title: string = undefined
Returns void
-
-
Update a progress indicator
Parameters
-
current: number
value
-
Default value uid: string = undefined
id of the progress or default one
-
Default value title: string = undefined
update title as well
Returns void
-
-
Wait until an answer is provided
Parameters
-
uuid: string
of input to wait for
Returns Promise<string>
-
-
Parameters
-
emitter: EventEmitter
-
event: string | symbol
Returns number
-
Generated using TypeDoc
This class allow you to abstract the output for your program
You can sned output, ask for input and depending if you are in terminal It will show progress in the terminal, or send it via WebSockets or store it in a DB or in a logfile