▪ Meta
+ new Twisters(options?
: Partial‹TwistersOptions‹Meta››, buffer?
: TwistersBuffer): Twisters
Create new Twisters instance
Parameters:
Name | Type | Description |
---|---|---|
options? |
Partial‹TwistersOptions‹Meta›› | - |
buffer? |
TwistersBuffer | DEPRECATED Please define buffer in options instead of passing it as the second constructor parameter |
Returns: Twisters
• lineBuffer: TwistersBuffer
deprecated
Please reference options.buffer
instead
• options: TwistersOptions‹Meta›
• spinnerLoop: SpinnerLoop
▸ flush(): void
Flush messages to stream.
remarks
This is called automatically if the flushInactive
option is true.
Otherwise this must be called manually when all messages have finished.
Returns: void
▸ forEachMessage(callback
: ForEachMessageCallback‹Meta›): void
Iterate over buffered messages and invoke the callback for each one.
Parameters:
Name | Type |
---|---|
callback |
ForEachMessageCallback‹Meta› |
Returns: void
▸ hasActiveMessage(): boolean
Returns true if any of the buffered messages are active, otherwise false.
Returns: boolean
▸ log(text
: string, messageOpt?
: Partial‹Message‹Meta››): Message‹Meta›
Log an inactive message
(convenience function equivalent to put('text', { active: false })
)
Parameters:
Name | Type |
---|---|
text |
string |
messageOpt? |
Partial‹Message‹Meta›› |
Returns: Message‹Meta›
▸ messageCount(): number
Get buffered message count.
Returns: number
▸ pick(name
: string): Message‹Meta› | undefined
Get buffered message by name.
Parameters:
Name | Type |
---|---|
name |
string |
Returns: Message‹Meta› | undefined
▸ put(name
: string, messageOpt?
: Partial‹Message‹Meta››): Message‹Meta›
Add/update a message
remarks
Message content is not cached by default.
This means that message text must be provided to subsequent put
calls,
even if the text is unchanged.
See custom-cache.js example to update messages using only changed attributes.
Parameters:
Name | Type |
---|---|
name |
string |
messageOpt? |
Partial‹Message‹Meta›› |
Returns: Message‹Meta›
▸ remove(name
: string): Message‹Meta› | undefined
Remove a buffered message by name
(convenience function equivalent to put('name', { removed: true })
)
Parameters:
Name | Type |
---|---|
name |
string |
Returns: Message‹Meta› | undefined
The existing message that was removed or undefined if no message was found for the provided key