@react-three/fiber 10.0.0-canary.8f5b4d3 → 10.0.0-canary.908b65b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/chunks/webgpu.cjs +37 -0
  2. package/dist/chunks/webgpu.mjs +21 -0
  3. package/dist/extension.cjs +13 -0
  4. package/dist/extension.d.cts +19 -0
  5. package/dist/extension.d.mts +19 -0
  6. package/dist/extension.d.ts +19 -0
  7. package/dist/extension.mjs +1 -0
  8. package/dist/index.cjs +97 -15309
  9. package/dist/index.d.cts +123 -3729
  10. package/dist/index.d.mts +123 -3729
  11. package/dist/index.d.ts +123 -3729
  12. package/dist/index.mjs +10 -15210
  13. package/dist/legacy.cjs +105 -15253
  14. package/dist/legacy.d.cts +115 -3733
  15. package/dist/legacy.d.mts +115 -3733
  16. package/dist/legacy.d.ts +115 -3733
  17. package/dist/legacy.mjs +21 -15170
  18. package/dist/shared/fiber.BdIbKbh7.mjs +16563 -0
  19. package/dist/shared/fiber.Biz9olEe.mjs +481 -0
  20. package/dist/shared/fiber.C6hitYDY.d.cts +48 -0
  21. package/dist/shared/fiber.C_MFx7We.d.cts +1237 -0
  22. package/dist/shared/fiber.C_MFx7We.d.mts +1237 -0
  23. package/dist/shared/fiber.C_MFx7We.d.ts +1237 -0
  24. package/dist/shared/fiber.CtivZ3IY.d.ts +2494 -0
  25. package/dist/shared/fiber.CvlK0a1Z.d.mts +2494 -0
  26. package/dist/shared/fiber.D4fD6H74.d.mts +48 -0
  27. package/dist/shared/fiber.DfiCufha.cjs +521 -0
  28. package/dist/shared/fiber.VTTQNnlj.d.cts +2494 -0
  29. package/dist/shared/fiber.YgTUGbja.d.ts +48 -0
  30. package/dist/shared/fiber.nDnBf1np.cjs +16661 -0
  31. package/dist/webgpu/index.cjs +100 -16123
  32. package/dist/webgpu/index.d.cts +133 -4093
  33. package/dist/webgpu/index.d.mts +133 -4093
  34. package/dist/webgpu/index.d.ts +133 -4093
  35. package/dist/webgpu/index.mjs +17 -16009
  36. package/package.json +15 -12
  37. package/readme.md +2 -2
  38. package/react-reconciler/constants.d.ts +0 -7
  39. package/react-reconciler/constants.js +0 -1
  40. package/react-reconciler/index.d.ts +0 -1044
  41. package/react-reconciler/index.js +0 -208
@@ -0,0 +1,48 @@
1
+ import { aO as FrameNextCallback } from './fiber.C_MFx7We.js';
2
+ import { UseFrameNextOptions, FrameNextControls } from '@pmndrs/scheduler';
3
+
4
+ /**
5
+ * Frame hook with phase-based ordering, priority, and FPS throttling.
6
+ *
7
+ * Always delivers full RootState — works both inside and outside Canvas context:
8
+ * - Inside Canvas: Full RootState (renderer, scene, camera, etc.)
9
+ * - Outside Canvas: The job registers immediately but the callback is held until a
10
+ * Canvas adopts it, then runs with full RootState. For hostless / standalone
11
+ * frame loops with no Canvas, use `@pmndrs/scheduler` directly.
12
+ *
13
+ * Returns a controls object for manual stepping, pausing, and resuming.
14
+ *
15
+ * @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
16
+ * @param priorityOrOptions - Either a priority number (backwards compat) or options object
17
+ * @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
18
+ *
19
+ * @example
20
+ * // Simple priority (backwards compat)
21
+ * useFrame((state, delta) => { ... }, 5)
22
+ *
23
+ * @example
24
+ * // With phase-based ordering
25
+ * useFrame((state, delta) => { ... }, { phase: 'physics' })
26
+ *
27
+ * @example
28
+ * // Outside Canvas - callback waits for a Canvas, then always has full state
29
+ * function UI() {
30
+ * useFrame((state, delta) => { syncUI(state.camera) });
31
+ * return <button>...</button>;
32
+ * }
33
+ *
34
+ * @example
35
+ * // Hostless / standalone loop (no Canvas) - use @pmndrs/scheduler directly
36
+ * import { getScheduler } from '@pmndrs/scheduler'
37
+ * getScheduler().register((state, delta) => { updateGame(delta) })
38
+ *
39
+ * @example
40
+ * // Scheduler-only access (no callback)
41
+ * const { scheduler } = useFrame()
42
+ * scheduler.pauseJob('some-job-id')
43
+ *
44
+ * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#useframe
45
+ */
46
+ declare function useFrame(callback?: FrameNextCallback, priorityOrOptions?: number | UseFrameNextOptions): FrameNextControls;
47
+
48
+ export { useFrame as u };