UNPKG

typegpu

Version:

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

38 lines (37 loc) 909 B
import type { Block, FuncParameter } from 'tinyest'; export interface RawMetadataV1 { v: 1; name: string; ast: { params: FuncParameter[]; body: Block; externalNames: string[]; }; externals: Record<string, unknown> | (() => Record<string, unknown>); } export interface RawMetadataV2 { v: 2; name: string; ast: { params: FuncParameter[]; body: Block; }; externals: { [key: string]: () => unknown; }; } /** * Holds all function info collected by typegpu-unplugin */ export type RawMetadata = RawMetadataV1 | RawMetadataV2; /** * Holds normalized function metadata required for WGSL generation */ export interface Metadata { ast: { params: FuncParameter[]; body: Block; }; externals: () => Record<string, unknown>; } export declare function normalizeMetadata(meta: RawMetadata): Metadata;