Scale JS / @scale-codec/core / Variant
Interface: Variant<E, Tag, Content>
@scale-codec/core.Variant
Type parameters
Name | Type |
---|---|
E | extends EnumRecord |
Tag | extends string |
Content | extends [] | [any ] = [] |
Table of contents
Properties
Properties
[enumTags]
• [enumTags]: E
Defined in
as
• Readonly
as: <T>(tag
: T
) => [T
, Content
] extends [Tag
, [C
]] ? C
: never
Type declaration
▸ <T
>(tag
): [T
, Content
] extends [Tag
, [C
]] ? C
: never
Type parameters
Name | Type |
---|---|
T | extends string | number | symbol |
Parameters
Name | Type |
---|---|
tag | T |
Returns
[T
, Content
] extends [Tag
, [C
]] ? C
: never
Defined in
content
• Readonly
content: Content
extends [C
] ? C
: undefined
Defined in
tag
• Readonly
tag: Tag
Defined in
unit
• Readonly
unit: Content
extends [] ? true
: false