ArithArg
타입, 타입 분류
The operand a binary arithmetic method accepts for a receiver of key K.
import type { ArithArg } from 'typeshade'
시그니처, 설명, 예제는 커밋 c66579bf의 컴파일러 소스에서 그대로 가져온 영어 원문입니다.
구문
type ArithArg<K extends string> = K extends `vec${number}<${infer E}>` ? ReadonlyNode<K> | ReadonlyNode<KindScalar<E>> | number : ReadonlyNode<KindScalar<K>> | number;설명
For a vector
receiver: the same vector key, or a scalar of the vector’s element kind (WGSL’s
vector-scalar broadcast). For a scalar receiver: the same scalar kind. A vec2 against a
vec3, an integer against a float, or an i32 against a u32 is a type error. An f64
receiver (and the scalar broadcast of an f64 vector) also accepts f32, which widens
exactly. A JS number is accepted everywhere and lifts to the receiver’s own scalar kind.
소스
src/core/ir/node.ts, 81행, 커밋 c66579bf 기준