matchbox
matchbox<
DataSpecs
,Tag
,TagProp
>(tag
:Tag
,data
:any
,tagProp
:TagProp
):MatchboxMember
<Tag
,DataSpecs
,TagProp
>
Defined in: matchbox-factory.ts:82
matchbox creates a single Matchbox variant instance.
Type Parameters
Section titled “Type Parameters”Type Parameter | Default type |
---|---|
DataSpecs | - |
Tag extends string | number | symbol | - |
TagProp extends string | "tag" |
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
tag | Tag | The tag value for the variant. |
data | any | The data associated with the variant. |
tagProp | TagProp | The property name used for the tag (default: “tag”). |
Returns
Section titled “Returns”MatchboxMember
<Tag
, DataSpecs
, TagProp
>
A Matchbox instance with type-safe API methods.