UNPKG

@thi.ng/shader-ast

Version:

DSL to define shader code in TypeScript and cross-compile to GLSL, JS and other targets

72 lines 2.4 kB
import type { Lit, Term } from "../api/nodes.js"; import type { BoolTerm, FloatTerm, IntTerm, UintTerm } from "../api/terms.js"; import { type BVec, type IVec, type UVec, type Vec } from "../api/types.js"; /** * Returns true if given `t` is a {@link Term}-like object. * * @param t - */ export declare const isTerm: (t: any) => t is Term<any>; /** * Returns true, if given term evaluates to a boolean value. */ export declare const isBool: (t: Term<any>) => t is BoolTerm; /** * Returns true, if given term evaluates to a float value. */ export declare const isFloat: (t: Term<any>) => t is FloatTerm; /** * Returns true, if given term evaluates to a signed integer value. */ export declare const isInt: (t: Term<any>) => t is IntTerm; /** * Returns true, if given term evaluates to an unsigned integer value. */ export declare const isUint: (t: Term<any>) => t is UintTerm; /** * Returns true, if given term is a literal. */ export declare const isLit: (t: Term<any>) => t is Lit<any>; /** * Returns true, if given term is a float literal. */ export declare const isLitFloat: (t: Term<any>) => t is Lit<"float">; /** * Returns true, if given term is a signed integer literal. */ export declare const isLitInt: (t: Term<any>) => t is Lit<"int">; /** * Returns true, if given term is a numeric literal (float, int, uint). */ export declare const isLitNumeric: (t: Term<any>) => t is Lit<"float" | "int" | "uint">; /** * Returns true if t is a numeric literal with a JS number as value (not an * expression). * * @param t - */ export declare const isLitNumericConst: (t: Term<any>) => t is Lit<"float" | "int" | "uint">; /** * Returns true if `t` is a vector literal with a JS array as value (not an * expression). * * @param t - */ export declare const isLitVecConst: (t: Term<any>) => t is Lit<Vec | IVec | UVec | BVec>; /** * Returns true, if `t` is a {@link isLitNumericConst} of value `n` or if * {@link isLitVecConst} and all vector components are `n`. * * @param t * @param n */ export declare const isLitNumOrVecConst: (t: Term<any>, n: number) => any; /** * Returns true, if given term evaluates to a vector value (vec, ivec, bvec). */ export declare const isVec: (t: Term<any>) => boolean; /** * Returns true, if given term evaluates to a matrix value. */ export declare const isMat: (t: Term<any>) => boolean; //# sourceMappingURL=checks.d.ts.map