API Reference

Advanced API

Scheduler helpers and user-context APIs from advanced entrypoints.


Reference for advanced exports split between core and adapter layers.

Entrypoints

Entrypoint Exports
@motion-core/motion-gpu/advanced Core + scheduler helper utilities
@motion-core/motion-gpu/svelte/advanced Svelte runtime API + scheduler helpers + user context APIs
@motion-core/motion-gpu/react/advanced React runtime API + scheduler helpers + user context APIs
@motion-core/motion-gpu/vue/advanced Vue runtime API + scheduler helpers + user context APIs

Scheduler helpers

applySchedulerPreset(
  scheduler: MotionGPUScheduler,
  preset: SchedulerPreset,
  options?: ApplySchedulerPresetOptions
): SchedulerPresetConfig
applySchedulerPreset(
  scheduler: MotionGPUScheduler,
  preset: SchedulerPreset,
  options?: ApplySchedulerPresetOptions
): SchedulerPresetConfig

SchedulerPreset:

'performance' | 'balanced' | 'debug'
'performance' | 'balanced' | 'debug'

ApplySchedulerPresetOptions:

Field Type Notes
diagnosticsEnabled boolean Must match profilingEnabled in runtime
profilingEnabled boolean Must match diagnosticsEnabled in runtime
profilingWindow number Finite, > 0, rounded down

SchedulerPresetConfig:

Field Type
diagnosticsEnabled boolean
profilingEnabled boolean
profilingWindow number
captureSchedulerDebugSnapshot(
  scheduler: MotionGPUScheduler
): SchedulerDebugSnapshot
captureSchedulerDebugSnapshot(
  scheduler: MotionGPUScheduler
): SchedulerDebugSnapshot

SchedulerDebugSnapshot:

Field Type
diagnosticsEnabled boolean
profilingEnabled boolean
profilingWindow number
schedule FrameScheduleSnapshot
lastRunTimings FrameRunTimings null
profilingSnapshot FrameProfilingSnapshot null

Adapter advanced exports

Available from @motion-core/motion-gpu/svelte/advanced, @motion-core/motion-gpu/react/advanced, and @motion-core/motion-gpu/vue/advanced:

  • useMotionGPUUserContext
  • setMotionGPUUserContext

React-only advanced export:

  • useSetMotionGPUUserContext

For detailed signatures: Hooks API.

Related docs