Members
(static) dependencies :Array.<string>
Class dependencies:
['terminal.interceptor.capture']
.
styleCleaner :function
- Source:
- See:
-
- keepStyle
- removeStyle
Style cleaner.
captureInterceptor :console.interceptors.CaptureInterceptor
Capture interceptor instance.
Methods
add(closure, indexopt)
Add an stdout interceptor.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
closure |
function | The interceptor closure. | ||
index |
number | null |
<optional> |
null
|
The index where the interceptor should be inserted. |
Returns:
The Interceptor service instance.
remove(closure)
Remove an stdout interceptor.
Parameters:
Name | Type | Description |
---|---|---|
closure |
function | The interceptor closure. |
Returns:
The Interceptor service instance.
removeAll()
Remove all existing interceptors.
Returns:
The Interceptor service instance.
startCapture(muteopt)
Start capture.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
mute |
boolean |
<optional> |
true
|
Indicates if the console should be muted. |
Returns:
The Interceptor service instance.
stopCapture(unmuteopt)
Stop capture and get the output.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
unmute |
boolean |
<optional> |
true
|
Indicates if the console should be unmuted. |
Returns:
The captured data.
- Type
- Array.<string>
enable()
Enable interceptors.
Returns:
The Interceptor service instance.
disable()
Disable interceptors.
Returns:
The Interceptor service instance.
mute(stateopt)
Mute stdout in process but keep interceptors enabled.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
state |
boolean |
<optional> |
true
|
Indicates the mute state. |
Returns:
The Interceptor service instance.
unmute()
Unmute stdout in process.
Returns:
The Interceptor service instance.
editable(stateopt)
Allow interceptors to edit output content.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
state |
boolean |
<optional> |
true
|
Indicates the editable state. |
Returns:
The Interceptor service instance.
uneditable()
Deny interceptors to edit output content.
Returns:
The Interceptor service instance.
keepStyle(stateopt)
Keep styles in content when passing it to interceptors.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
state |
boolean |
<optional> |
true
|
Indicates if the style should be kept. |
Returns:
The Interceptor service instance.
removeStyle()
Remove styles in content when passing it to interceptor.
Returns:
The Interceptor service instance.