Constructor
new BooleanFilter(params)
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
BooleanFilterArgs | The filter arguments.
Properties
|
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
description |
string |
<optional> |
Optional description of the filter for display or documentation purposes. |
invertSelection |
boolean |
<optional> |
If true, the filter logic is inverted (e.g., exclude instead of include). |
options |
BooleanFilterOptionList | The BooleanFilterOptions available for this filter. | |
propretyName |
BooleanFilterName | The BooleanFilterOptions available for this filter. | |
selectedOptions |
Array.<string> | The names of the options selected for use in filtering. |
Extends
- TootFilter
- undefined
Members
options
Set the options list and remove invalid selected options.
Methods
isAllowed(toot) → {boolean}
Return true if the toot matches the filter.
Parameters:
Name | Type | Description |
---|---|---|
toot |
Toot | The toot to check. |
Returns:
- Type
- boolean
isOptionEnabled(optionName) → {boolean}
Return true if the option is in selectedOptions.
Parameters:
Name | Type | Description |
---|---|---|
optionName |
string | The option name. |
Returns:
- Type
- boolean
optionsSortedByName(minTootsopt) → {BooleanFilterOptionList}
Return options with numToots >= minToots sorted by name (selected options are always included).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
minToots |
number |
<optional> |
0 | Minimum number of toots. |
Returns:
optionsSortedByValue(minTootsopt) → {BooleanFilterOptionList}
Return options with numToots >= minToots sorted by numToots (selected options are always included).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
minToots |
number |
<optional> |
0 | Minimum number of toots. |
Returns:
toArgs() → {BooleanFilterArgs}
Required for serialization of settings to local storage.
- Overrides:
Returns:
- Type
- BooleanFilterArgs
updateOption(optionName, isSelected)
Add or remove an option from the filter.
Parameters:
Name | Type | Description |
---|---|---|
optionName |
string | The option name. |
isSelected |
boolean | If true, add the option; if false, remove it. |
(static) isValidFilterProperty(name) → {boolean}
Checks if a given property name is a valid numeric filter name.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The property name to check. |
Returns:
True if the name is a filterable numeric property.
- Type
- boolean