Class: FilterState

filterState~FilterState()

filterState implementation.

Constructor

new FilterState()

Source:

Members

map :Map.<string, FilterStateEntry>

Internal map containing filter state.

Type:
  • Map.<string, FilterStateEntry>
Source:

Methods

disabledSubscriptions(filterText) → {Set.<string>}

Gets which subscriptions this filters has been disabled for.

Parameters:
Name Type Description
filterText string

The text of the filter.

Source:
Returns:

Set of subscription urls that this filter has been disabled for.

Type
Set.<string>

(package) fromObject(filterText, object)

Reads the state of a filter from an object representation.

Parameters:
Name Type Description
filterText string

The text of the filter.

object Object

An object containing at least one of disabled, hitCount, and lastHit properties and their appropriate values.

Source:
See:

getHitCount(filterText) → {number}

Returns the hit count of a filter.

Parameters:
Name Type Description
filterText string

The text of the filter.

Source:
Returns:

The hit count of the filter.

Type
number

getLastHit(filterText) → {number}

Returns the last hit time of a filter.

Parameters:
Name Type Description
filterText string

The text of the filter.

Source:
Returns:

The last hit time of the filter in milliseconds since the Unix epoch.

Type
number

isDisabledForSubscription(filterText, subscriptionUrl) → {boolean}

Checks whether a filter is disabled for a subscription.

Parameters:
Name Type Description
filterText string

The text of the filter.

subscriptionUrl string

The subscription to check for enabled / disabled state.

Source:
Returns:

Whether the filter is disabled.

Type
boolean

isEnabled(filterText) → {boolean}

Checks whether a filter is enabled.

Parameters:
Name Type Description
filterText string

The text of the filter.

Deprecated:
Source:
Returns:

Whether the filter is enabled.

Type
boolean

registerHit(filterText)

Registers a filter hit by incrementing the hit count of the filter and setting the last hit time of the filter to the current time.

Parameters:
Name Type Description
filterText string

The text of the filter.

Source:

reset(filterText)

Resets the enabled state, hit count, and last hit time of a filter.

Parameters:
Name Type Description
filterText string

The text of the filter.

Source:

resetEnabled(filterText)

Reset the disabled status of this filter to the default of enabled for all subscriptions.

Parameters:
Name Type Description
filterText string

The text of the filter.

Source:

resetHitCount(filterText)

Resets the hit count of a filter.

Parameters:
Name Type Description
filterText string

The text of the filter.

Source:

resetHits(filterText)

Resets the hit count and last hit time of a filter.

Parameters:
Name Type Description
filterText string

The text of the filter.

Source:

resetLastHit(filterText)

Resets the last hit time of a filter.

Parameters:
Name Type Description
filterText string

The text of the filter.

Source:

(generator, package) serialize(filterText) → {string}

Serializes the state of a filter.

Parameters:
Name Type Description
filterText string

The text of the filter.

Source:
See:
Yields:
The next line in the serialized representation of the state of the filter.
Type
string

setDisabledForSubscription(filterText, subscriptionUrl, disabled)

Sets the disabled state of a filter for a subscription.

Parameters:
Name Type Description
filterText string

The text of the filter.

subscriptionUrl string

The subscription to enable / disable the filter in.

disabled boolean

The new disabled state of the filter.

Source:

setEnabled(filterText, enabled)

Sets the enabled state of a filter.

Parameters:
Name Type Description
filterText string

The text of the filter.

enabled boolean

The new enabled state of the filter.

Deprecated:
Source:

setHitCount(filterText, hitCount)

Sets the hit count of a filter.

Parameters:
Name Type Description
filterText string

The text of the filter.

hitCount number

The new hit count of the filter.

Source:

setLastHit(filterText, lastHit)

Sets the last hit time of a filter.

Parameters:
Name Type Description
filterText string

The text of the filter.

lastHit number

The new last hit time of the filter in milliseconds since the Unix epoch.

Source:

toggleEnabled(filterText)

Toggles the enabled state of a filter.

Parameters:
Name Type Description
filterText string

The text of the filter.

Deprecated:
Source: