typegpu
Version:
A thin layer between JS and WebGPU/WGSL that improves development experience and allows for faster iteration.
27 lines (26 loc) • 1.08 kB
TypeScript
import { type Snippet } from '../../data/snippet.ts';
import { $internal, $repr } from '../../shared/symbols.ts';
import { type BaseData } from '../../data/wgslTypes.ts';
import type { FunctionArgumentAccess } from '../../types.ts';
/**
* Routes `(input) => { input.x }` style property access to the correct WGSL
* expression: positional args get a direct snippet, struct fields get
* `structArgName.fieldName`.
*/
export declare class EntryInputRouter implements BaseData {
readonly [$internal]: Record<string, unknown>;
readonly type: "entry-input-router";
readonly [$repr]: never;
readonly structArg: FunctionArgumentAccess | undefined;
/** Maps schemaKey → { WGSL arg name, type } */
readonly positionalArgsMap: Map<string, FunctionArgumentAccess>;
constructor(structArg: FunctionArgumentAccess | undefined, positionalArgs: {
schemaKey: string;
arg: FunctionArgumentAccess;
}[]);
toString(): string;
accessProp(propName: string): Snippet | {
target: Snippet;
prop: string;
} | undefined;
}