ArrayElemKey
이 페이지에서

ArrayElemKey

타입, 타입 분류

Element key of an array key: array<f32,4> → 'f32', array<vec3<f32>> → 'vec3<f32>', and never for a key that is not an array.

import type { ArrayElemKey } from 'typeshade'

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

구문

type ArrayElemKey<K extends string> = K extends `array<${infer Inner}>`
? DropArraySize<Inner>
: never;

설명

Element key of an array key: array<f32,4> → 'f32', array<vec3<f32>> → 'vec3<f32>', and never for a key that is not an array. It is the inverse of the array arm of KeyOf, and it is what lets xs.at(i) know the element type without being told again — the declaration already said it.

함께 보기

소스

src/core/ir/types.ts, 920행, 커밋 c66579bf 기준

이 페이지 편집 문제 보고