Skip to content
On this page

Scale JS / @scale-codec/core / Variant

Interface: Variant<E, Tag, Content>

@scale-codec/core.Variant

Type parameters

NameType
Eextends EnumRecord
Tagextends string
Contentextends [] | [any] = []

Table of contents

Properties

Properties

[enumTags]

[enumTags]: E

Defined in

packages/enum/src/lib.ts:12


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
NameType
Textends string | number | symbol
Parameters
NameType
tagT
Returns

[T, Content] extends [Tag, [C]] ? C : never

Defined in

packages/enum/src/lib.ts:16


content

Readonly content: Content extends [C] ? C : undefined

Defined in

packages/enum/src/lib.ts:14


tag

Readonly tag: Tag

Defined in

packages/enum/src/lib.ts:13


unit

Readonly unit: Content extends [] ? true : false

Defined in

packages/enum/src/lib.ts:15