arrayLit
On this page

arrayLit()

Function in Values

A fixed-length array literal, array<elemKey, N>(...).

import { arrayLit } from 'typeshade/core/ir'

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

Syntax

const arrayLit: <E extends ShaderType, const I extends readonly ReadonlyNode[]>(
elem: E,
...items: I,
) => Node<`array<${KeyOf<E>},${I["length"]}>`>

Parameters

elem E extends ShaderType
...items I extends readonly ReadonlyNode[]

Return value

Node<`array<${KeyOf<E>},${I['length']}>`>

Description

The result key carries the element key and the item count, so arrayLit(f32T, a, b, c) is Node<'array<f32,3>'>, the key typeKey produces for its runtime type.

See also

Source

src/core/ir/node.ts, line 2474, at commit af54ddad5

Edit this page Report a problem