Class: NumericFilter

NumericFilter(params)

Filter for numeric properties of a Toot (e.g., replies, reblogs, favourites). Allows filtering toots based on a minimum value for a given property.

Constructor

new NumericFilter(params)

Parameters:
Name Type Description
params NumericFilterArgs The filter arguments.
Properties
Name Type Attributes Description
invertSelection boolean <optional>
If true, the filter logic is inverted (e.g., exclude instead of include).
propertyName TootNumberProp Toot property to filter on (e.g., 'repliesCount').
value number <optional>
The minimum value for the filter.
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).
propertyName TootNumberProp The property of the toot to filter on (e.g., 'repliesCount').
value number Minimum value a toot must have in the 'propertyName' field to be included in the timeline.

Extends

Methods

isAllowed(toot) → {boolean}

Check if the toot meets the filter criterion.
Parameters:
Name Type Description
toot Toot The toot to check.
Returns:
True if the toot should appear in the timeline feed.
Type
boolean

toArgs() → {NumericFilterArgs}

Serializes the filter state for storage.
Overrides:
Returns:
Arguments that can be used to reconstruct the filter.
Type
NumericFilterArgs

updateValue(newValue)

Updates the filter's 'value' property.
Parameters:
Name Type Description
newValue number The new minimum value for the filter.

(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