EnumU32
이 페이지에서

EnumU32

인터페이스, 값 분류

A typed u32 enum: a name-to-value map whose members are Node<'u32'> literals, plus the raw value map.

import type { EnumU32 } from 'typeshade'

시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.

구문

interface EnumU32<M extends Record<string, number>> {
readonly members: { readonly [K in keyof M]: Node<'u32'> };
readonly values: M;
}

설명

Pair it with matchEnum for exhaustive integer dispatch: the arms object must cover every member, and a missing or unknown key is a tsc error, so a forgotten case is caught at compile time instead of falling through the switch default.

인스턴스 속성

members읽기 전용 { readonly [K in keyof M]: Node<'u32'> }

Typed member literals: Kind.members.Fill is a Node<'u32'> holding that member’s value.

values읽기 전용 M

The raw name-to-value map, the integer case labels matchEnum dispatches on.

함께 보기

소스

src/core/ir/node.ts, 2337행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고