@thi.ng/shader-ast
Version:
DSL to define shader code in TypeScript and cross-compile to GLSL, JS and other targets
23 lines • 940 B
TypeScript
import type { Term } from "../api/nodes.js";
import type { FloatTerm } from "../api/terms.js";
import type { Int, IVec, Prim, Type, UVec } from "../api/types.js";
/**
* Returns base type for given term. Used for array ops.
*
* @example
* ```ts
* itemType("vec2[]") => "vec2"
* ```
*/
export declare const itemType: (type: Type) => Type;
/**
* Takes a numeric term and a plain number, returns number wrapped in
* typed literal compatible with term.
*
* @param t -
* @param x -
*/
export declare const numberWithMatchingType: (t: Term<Prim | Int>, x: number) => import("../index.js").Lit<"float"> | import("../index.js").Lit<"int"> | import("../index.js").Lit<"uint"> | import("../index.js").Lit<"bool">;
export declare const matchingPrimFor: <T extends Prim>(t: Term<T>, x: FloatTerm) => Term<T>;
export declare const matchingBoolType: <T extends Prim | Int | IVec | UVec>(t: Term<T>) => Type;
//# sourceMappingURL=item.d.ts.map