StateMatchbox
Defined in: state-types.ts:11
MatchboxMemberApi defines the API for a member of a Matchbox, providing access to its key and data. This is used to ensure type safety and consistency across Matchbox members.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Description |
|---|---|
Tag extends string & keyof Specs | The key type for the member. |
Specs | The specifications defining the structure of the Matchbox. |
Methods
Section titled “Methods”match()
Section titled “match()”Call Signature
Section titled “Call Signature”match<
A>(cases:MatchCases<Specs,A,true>,exhaustive?:boolean):A
Defined in: matchbox-factory-types.ts:122
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
A |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
cases | MatchCases<Specs, A, true> |
exhaustive? | boolean |
Returns
Section titled “Returns”A
Call Signature
Section titled “Call Signature”match<
A>(cases:MatchCases<Specs,A,false>,exhaustive:boolean):A
Defined in: matchbox-factory-types.ts:123
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
A |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
cases | MatchCases<Specs, A, false> |
exhaustive | boolean |
Returns
Section titled “Returns”A
Properties
Section titled “Properties”| Property | Type |
|---|---|
is | <T>(key: T) => this is MatchboxMember<T, Specs, "key"> |
as | <T>(key: T) => MatchboxMember<T, Specs, "key"> |
key | Tag |
data | StateData<Specs[Tag]> |