Optional
filters: { Readonly
allReadonly
anyReadonly
eventReadonly
noneReadonly
streamAdds a filter that will filter out events that do not match all all
masks.
Note that, for use in TypeScript, none
and any
are set to never
. This
prevents unintended use of none
and any
after all
is used, thus ensuring
that the types emitted by the final event handler is correct. Since JavaScript
does not perform type checks, this does not throw a runtime error.
Adds a filter that will filter out events that do not match any any
masks.
Note that, for use in TypeScript, none
and all
are set to never
. This
prevents unintended use of none
and all
after any
is used, thus ensuring
that the types emitted by the final event handler is correct. Since JavaScript
does not perform type checks, this does not throw a runtime error.
Private
arrayPrivate
autoPrivate
cleanupPrivate
crawlPrivate
Crawling function. Only triggers when depth cap hit or
Private
deepPrivate
Performs a deep equality check. This checks if all keys and values of expectedObject match all keys and values of actualObject and vice versa. If oneWay is set to true, this only checks if keys and values of expectedObject are in actualObject, and still returns true if the actualObject contains extra properties.
The object that is expected
The actual object
Optional
oneWay: booleanWhether the comparison is made one way
Whether the two objects are equal
Private
filterPrivate
getPrivate
literalAdds a filter that will filter out events that match the mask.
none
filters are run first, and take highest priority over other
filters.
Types for this method are only effective for specific cases due to the lack of negation types in TypeScript.
Generated using TypeDoc
Describes a class that automatically filters events from a stream. A filter can be instantiated using
WikimediaStream.filter
, and then chained withnone
,all
, andany
methods to create a filter that will filter out events. The final filter can then be used to add event listeners to the stream.none
,all
, andany
are chainable, however this is only the case if they are used in the correct order.none
filters are executed first and take highest priority.all
filters are executed second, andany
filters are executed last. Types help narrow down the final type of events passed through the event handlers, which is why the order of the filters is important.