A pattern that matches a value of type T. One of:
T
"a"
42
true
===
Partial<T>
(input: T) => boolean
(x): x is U
type Event = { kind: "click"; x: number } | { kind: "key"; code: string };const p1: Pattern<Event> = { kind: "click" }; // object patternconst p2: Pattern<Event> = (e) => e.kind === "key"; // guard Copy
type Event = { kind: "click"; x: number } | { kind: "key"; code: string };const p1: Pattern<Event> = { kind: "click" }; // object patternconst p2: Pattern<Event> = (e) => e.kind === "key"; // guard
A pattern that matches a value of type
T. One of:"a",42,true) matched by===.Partial<T>of shallow key/value pairs that must all match by strict equality. Only available whenTis an object type.(input: T) => boolean. Type predicates ((x): x is U) narrow the handler input via Narrow.