UNPKG

@motion-core/motion-gpu

Version:

Framework-agnostic WebGPU runtime for fullscreen WGSL shaders with explicit Svelte, React, and Vue adapter entrypoints.

29 lines 1.66 kB
import type { CurrentReadable } from '../core/current-value.js'; import { type SetMotionGPUUserContextOptions } from '../core/motiongpu-context.js'; import { type MotionGPUUserNamespace } from './motiongpu-context.js'; export type { SetMotionGPUUserContextOptions } from '../core/motiongpu-context.js'; /** * Internal shape of the user context store. */ type UserContextStore = Record<MotionGPUUserNamespace, unknown>; /** * Returns a read-only view of the entire motiongpu user context store. */ export declare function useMotionGPUUserContext<UC extends UserContextStore = UserContextStore>(): CurrentReadable<UC>; /** * Reads a namespaced user context value as a reactive readable store. */ export declare function useMotionGPUUserContext<UC extends UserContextStore = UserContextStore, K extends keyof UC & MotionGPUUserNamespace = keyof UC & MotionGPUUserNamespace>(namespace: K): CurrentReadable<UC[K] | undefined>; /** * Returns a stable setter bound to the active MotionGPU user context store. * * @returns Setter function that preserves namespace write semantics. */ export declare function useSetMotionGPUUserContext(): <UCT = unknown>(namespace: MotionGPUUserNamespace, value: UCT | (() => UCT), options?: SetMotionGPUUserContextOptions) => UCT | undefined; /** * Sets a namespaced user context value with explicit write semantics. * * Returns the effective value stored under the namespace. */ export declare function setMotionGPUUserContext<UCT = unknown>(namespace: MotionGPUUserNamespace, value: UCT | (() => UCT), options?: SetMotionGPUUserContextOptions): UCT | undefined; //# sourceMappingURL=use-motiongpu-user-context.d.ts.map