arrayT
이 페이지에서

arrayT()

함수, 타입 분류

Builds the ShaderType for an array.

import { arrayT } from 'typeshade'

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

구문

const arrayT: <E extends ShaderType, S extends number | undefined = undefined>(
elem: E,
size?: S,
) => { readonly kind: "array"; readonly elem: E; readonly size: S; }

매개변수

elem E extends ShaderType

The element type, itself a literal-typed ShaderType.

size선택 사항 S extends number | undefined

The fixed element count, or undefined for a runtime-sized array.

반환값

{ readonly kind: 'array'; readonly elem: E; readonly size: S }

A { kind: 'array', elem, size } descriptor that keeps both literal types.

설명

Pass size for a fixed-length array (array<T, N>); omit it for a runtime-sized one (array<T>). Both elem and size keep their literal types so KeyOf spells the exact array<…> key that typeKey produces.

관련 가이드

함께 보기

소스

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

이 페이지 편집 문제 보고