ParamSpec
Type in Authoring
The parameter record externFn takes: a plain map from parameter name to ShaderType, in declaration order.
import type { ParamSpec } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
type ParamSpec = Record<string, ShaderType>;Description
An extern function is only ever called, never
used as a pipeline entry point, so its record carries no stage attribute and no struct
handle. FnParamSpec is the richer record fn() accepts.
Examples
Example
import { externFn, f32T, vec2fT, type ParamSpec } from 'typeshade'
const WARP_PARAMS = { x: f32T, y: f32T, scale: f32T } satisfies ParamSpecexport const warp = externFn('warp', WARP_PARAMS, vec2fT)See also
Source
src/core/ir/builder.ts, line 59, at commit 26de7be8