Introduction
Clientside trigger handler
add = ({
regex,
action,
id = crypto.randomUUID(),
enabled = true,
once = false,
duration = false,
fg = false,
bg = false,
lines = 0,
tags = [],
onRemove,
onDisable,
onEnable,
})
Name | Type | Default | Description |
---|---|---|---|
regex | regex | Required | Regex pattern to match |
action | function | Required | Callback function to fire when event is raised. |
id | string | guid | id used for enabling/disabling/deleting |
enabled | boolean | true | Enabled or disabled state of the action |
once | boolean | false | Listener will fire once and be removed (single fire). |
duration | miliseconds | Optional | Duration for action to remain active (single fire). |
fg | hex | Optional | Foreground color to match in form of hex color code |
bg | hex | Optional | Background color to match in form of hex color code |
lines | int | Optional | Number of lines for action to remain active |
tags | string array | Optional | String identifiers for filtering and searching |
onRemove | function | Optional | Callback function to fire when action is removed |
onDisable | function | Optional | Callback function to fire when action is disabled |
onEnable | function | Optional | Callback function to fire when action is enabled |