SwizzleKey
On this page

SwizzleKey

Type in Types

The key of v.swizzle(S) for a vector key K: the element scalar when S has one character, otherwise vecN<elem> with N the length of S.

import type { SwizzleKey } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

type SwizzleKey<K extends string, S extends string> =
StrLen<S> extends 1 ? ElemKey<K> : `vec${StrLen<S> & number}<${ElemKey<K>}>`;

Source

src/core/ir/node.ts, line 329, at commit 26de7be8

Edit this page Report a problem