Type alias unstable_Matcher<narrowedOrFn, input, pattern>Experimental

unstable_Matcher<narrowedOrFn, input, pattern>: ReturnType<CustomP<input, pattern, narrowedOrFn>[Pattern.matcher]>

A Matcher is an object with match function, which defines how this object should be matched by TS-Pattern.

Note that this api is unstable.

Type Parameters

  • narrowedOrFn
  • input = unknown
  • pattern = never

Example

class Some<T> implements P.unstable_Matchable {
[P.matcher](): P.unstable_Matcher<Some<T>>
}