import { UniformFormat } from "../../types.js"; import { PropType } from "../filters/prop-types.js"; import type { UniformTypes, UniformValue } from "../utils/uniform-types.js"; type Binding = unknown; export type UniformInfo = { format?: UniformFormat; } & PropType; type BindingKeys = { [K in keyof T]: T[K] extends UniformValue ? never : K; }[keyof T]; type UniformKeys = { [K in keyof T]: T[K] extends UniformValue ? K : never; }[keyof T]; export type PickBindings = { [K in BindingKeys>]: T[K]; }; export type PickUniforms = { [K in UniformKeys>]: T[K]; }; /** * A shader module definition object * @note `UniformsT` & `BindingsT` are deduced from `PropsT` by default. If * a custom type for `UniformsT` is used, `BindingsT` should be also be provided. */ export type ShaderModule = Record, UniformsT extends Record = PickUniforms, BindingsT extends Record = PickBindings> = { /** Used for type inference not for values */ props?: Required; /** Used for type inference, not currently used for values */ uniforms?: UniformsT; /** Used for type inference, not currently used for values */ bindings?: BindingsT; name: string; fs?: string; vs?: string; /** Uniform shader types @note: Both order and types MUST match uniform block declarations in shader */ uniformTypes?: Required>; /** Uniform JS prop types */ uniformPropTypes?: Record; /** Default uniform values */ defaultUniforms?: Required; /** Function that maps props to uniforms & bindings */ getUniforms?: (props?: Partial, prevUniforms?: UniformsT) => Partial; defines?: Record; /** Injections */ inject?: Record; dependencies?: ShaderModule[]; /** Information on deprecated properties */ deprecations?: ShaderModuleDeprecation[]; /** Internal */ normalized?: boolean; }; /** Use to generate deprecations when shader module is used */ export type ShaderModuleDeprecation = { type: string; regex?: RegExp; new: string; old: string; deprecated?: boolean; }; export {}; //# sourceMappingURL=shader-module.d.ts.map