UNPKG

typegpu

Version:

A thin layer between JS and WebGPU/WGSL that improves development experience and allows for faster iteration.

17 lines (16 loc) 786 B
import { type MapValueToSnippet, type ResolvedSnippet } from '../../data/snippet.ts'; import { type BaseData } from '../../data/wgslTypes.ts'; import { type DualFn, type ResolutionCtx } from '../../types.ts'; import type { AnyFn } from './fnTypes.ts'; type MapValueToDataType<T> = { [K in keyof T]: BaseData; }; interface CallableSchemaOptions<T extends AnyFn> { readonly name: string; readonly schema: () => BaseData; readonly normalImpl: T; readonly codegenImpl: (ctx: ResolutionCtx, args: MapValueToSnippet<Parameters<T>>) => ResolvedSnippet; readonly argTypes: (...inArgTypes: MapValueToDataType<Parameters<T>>) => (BaseData | BaseData[])[]; } export declare function callableSchema<T extends AnyFn>(options: CallableSchemaOptions<T>): DualFn<T>; export {};