typegpu
Version:
A thin layer between JS and WebGPU/WGSL that improves development experience and allows for faster iteration.
17 lines (16 loc) • 765 B
TypeScript
import { type ExecState, NormalState, type ResolutionCtx } from './types.ts';
export declare function provideInsideTgpuFn<T>(callback: () => T): T;
export declare function isInsideTgpuFn(): boolean;
/**
* Used to mock the context before all tests. For normal use-cases, use `provideCtx`
*/
export declare function INTERNAL_setCtx(ctx: ResolutionCtx | undefined): void;
export declare function provideCtx<T>(ctx: ResolutionCtx, callback: () => T): T;
export declare function getResolutionCtx(): ResolutionCtx | undefined;
/**
* Applicable when code is being executed outside of any
* execution-altering APIs.
*/
export declare const topLevelState: NormalState;
export declare function getExecMode(): ExecState;
export declare function inCodegenMode(): boolean;