@thi.ng/shader-ast
Version:
DSL to define shader code in TypeScript and cross-compile to GLSL, JS and other targets
15 lines • 1.13 kB
TypeScript
import type { Fn, Maybe } from "@thi.ng/api";
import type { FnBody1 } from "../api/function.js";
import type { Branch, ControlFlow, ForLoop, Sym, Term, Ternary, WhileLoop } from "../api/nodes.js";
import type { BoolTerm } from "../api/terms.js";
import type { Type } from "../api/types.js";
export declare const ifThen: (test: BoolTerm, truthy: Term<any>[], falsey?: Term<any>[]) => Branch;
export declare const ternary: <A extends Type, B extends A>(test: BoolTerm, t: Term<A>, f: Term<B>) => Ternary<A>;
export declare function forLoop<T extends Type>(test: Fn<Sym<T>, BoolTerm>, body: FnBody1<T>): ForLoop;
export declare function forLoop<T extends Type>(init: Maybe<Sym<T>>, test: Fn<Sym<T>, BoolTerm>, body: FnBody1<T>): ForLoop;
export declare function forLoop<T extends Type>(init: Maybe<Sym<T>>, test: Fn<Sym<T>, BoolTerm>, iter: Fn<Sym<T>, Term<any>>, body: FnBody1<T>): ForLoop;
export declare const whileLoop: (test: BoolTerm, body: Term<any>[]) => WhileLoop;
export declare const brk: ControlFlow;
export declare const cont: ControlFlow;
export declare const discard: ControlFlow;
//# sourceMappingURL=controlflow.d.ts.map