@react-three/fiber 10.0.0-canary.14007b4 → 10.0.0-canary.1998a73

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 (35) hide show
  1. package/dist/extension.cjs +2 -1
  2. package/dist/extension.d.cts +9 -46
  3. package/dist/extension.d.mts +9 -46
  4. package/dist/extension.d.ts +9 -46
  5. package/dist/extension.mjs +1 -1
  6. package/dist/index.cjs +2 -2
  7. package/dist/index.d.cts +7 -8
  8. package/dist/index.d.mts +7 -8
  9. package/dist/index.d.ts +7 -8
  10. package/dist/index.mjs +3 -3
  11. package/dist/legacy.cjs +2 -2
  12. package/dist/legacy.d.cts +4 -4
  13. package/dist/legacy.d.mts +4 -4
  14. package/dist/legacy.d.ts +4 -4
  15. package/dist/legacy.mjs +4 -4
  16. package/dist/shared/{fiber.DAg-9ieU.d.ts → fiber.11sXr8Eb.d.cts} +49 -101
  17. package/dist/shared/{fiber.C_v1rkNg.mjs → fiber.B0oukOFO.mjs} +38 -3
  18. package/dist/shared/fiber.BU0vBHc9.d.mts +48 -0
  19. package/dist/shared/{fiber.Ch4JrXS2.mjs → fiber.CT-cCVjA.mjs} +6091 -5146
  20. package/dist/shared/{fiber.BGL2rpse.cjs → fiber.Cn-vxHMl.cjs} +6100 -5155
  21. package/dist/shared/fiber.Cx-UAmMb.d.ts +48 -0
  22. package/dist/shared/fiber.DAl4H27x.d.cts +48 -0
  23. package/dist/shared/{fiber.Ddgoyqql.d.mts → fiber.DNehrxK5.d.ts} +49 -101
  24. package/dist/shared/{fiber.Bw8YnGg5.d.ts → fiber.I5Q4dVvl.d.cts} +81 -4
  25. package/dist/shared/{fiber.Bw8YnGg5.d.cts → fiber.I5Q4dVvl.d.mts} +81 -4
  26. package/dist/shared/{fiber.Bw8YnGg5.d.mts → fiber.I5Q4dVvl.d.ts} +81 -4
  27. package/dist/shared/{fiber.DiPB625B.d.cts → fiber.TWXdbcWP.d.mts} +49 -101
  28. package/dist/shared/{fiber.B6zNSmwj.cjs → fiber.khFlPHPf.cjs} +40 -2
  29. package/dist/webgpu/index.cjs +2 -2
  30. package/dist/webgpu/index.d.cts +4 -5
  31. package/dist/webgpu/index.d.mts +4 -5
  32. package/dist/webgpu/index.d.ts +4 -5
  33. package/dist/webgpu/index.mjs +4 -4
  34. package/package.json +6 -6
  35. package/readme.md +1 -1
@@ -0,0 +1,48 @@
1
+ import { a3 as FrameNextCallback } from './fiber.I5Q4dVvl.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 };
@@ -0,0 +1,48 @@
1
+ import { a3 as FrameNextCallback } from './fiber.I5Q4dVvl.cjs';
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 };
@@ -2,10 +2,9 @@ import * as React$1 from 'react';
2
2
  import { ReactNode, Component, RefObject, JSX } from 'react';
3
3
  import { Options } from 'react-use-measure';
4
4
  import * as THREE from 'three';
5
- import { Color as Color$1, ColorRepresentation, Euler as Euler$1, Loader, RenderTargetOptions as RenderTargetOptions$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D } from 'three';
6
- import { n as Properties, a as Size, F as Frameloop, c as Performance, D as Dpr, d as RootStore, k as EventManager, a6 as RootState, i as ComputeFunction, p as IsAllOptional, g as EventHandlers, u as ObjectMap, a5 as InternalState, M as Mutable, O as Overwrite, f as DomEvent, J as ThreeCore, B as Bridge, U as UnblockProps, w as Disposable, q as ThreeCamera, v as EquConfig } from './fiber.Bw8YnGg5.mjs';
5
+ import { ColorRepresentation, Euler as Euler$1, Loader, RenderTargetOptions as RenderTargetOptions$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D } from 'three';
6
+ import { J as Properties, c as Size, F as Frameloop, e as Performance, D as Dpr, g as RootStore, p as EventManager, f as RootState, n as ComputeFunction, C as ConstructorRepresentation, _ as ObjectMap, I as InternalState, M as Mutable, O as Overwrite, y as Args, l as EventHandlers, B as InstanceProps, k as DomEvent, G as Instance, x as Catalogue, v as Root, a6 as ThreeCore, W as Bridge, Z as UnblockProps, a0 as Disposable, Q as ThreeCamera, $ as EquConfig } from './fiber.I5Q4dVvl.js';
7
7
  import { WebGPURenderer, WebGPURendererParameters } from 'three/webgpu';
8
- import * as react_jsx_runtime from 'react/jsx-runtime';
9
8
 
10
9
  //* Base Renderer Types =====================================
11
10
 
@@ -156,8 +155,11 @@ interface RenderProps<TCanvas extends HTMLCanvasElement | OffscreenCanvas$1> {
156
155
  /** Dimensions to fit the renderer to. Will measure canvas dimensions if omitted */
157
156
  size?: Size
158
157
  /**
159
- * Enables shadows (by default PCFsoft). Can accept `gl.shadowMap` options for fine-tuning,
160
- * but also strings: 'basic' | 'percentage' | 'soft' | 'variance'.
158
+ * Enables shadows (`true` uses `THREE.PCFShadowMap`). Can accept `renderer.shadowMap` options for
159
+ * fine-tuning, but also strings: 'basic' | 'percentage' | 'soft' | 'variance'.
160
+ *
161
+ * `'soft'` is a deprecated alias of `'percentage'`: both map to `THREE.PCFShadowMap`, because three.js
162
+ * deprecated `PCFSoftShadowMap` and made `PCFShadowMap` soft. Using `'soft'` logs a deprecation notice.
161
163
  * @see https://threejs.org/docs/#api/en/renderers/WebGLRenderer.shadowMap
162
164
  */
163
165
  shadows?: boolean | 'basic' | 'percentage' | 'soft' | 'variance' | Partial<THREE.WebGLShadowMap>
@@ -235,83 +237,6 @@ type InjectState = Partial<
235
237
  }
236
238
  >
237
239
 
238
- //* Reconciler Types ==============================
239
-
240
- // FiberRoot is an opaque internal React type - we define it locally
241
- // to avoid bundling @types/react-reconciler which causes absolute path issues
242
- type FiberRoot = any
243
-
244
- interface Root {
245
- fiber: FiberRoot
246
- store: RootStore
247
- }
248
-
249
- type AttachFnType<O = any> = (parent: any, self: O) => () => void
250
- type AttachType<O = any> = string | AttachFnType<O>
251
-
252
- type ConstructorRepresentation<T = any> = new (...args: any[]) => T
253
-
254
- interface Catalogue {
255
- [name: string]: ConstructorRepresentation
256
- }
257
-
258
- // TODO: handle constructor overloads
259
- // https://github.com/pmndrs/react-three-fiber/pull/2931
260
- // https://github.com/microsoft/TypeScript/issues/37079
261
- type Args<T> = T extends ConstructorRepresentation
262
- ? T extends typeof Color$1
263
- ? [r: number, g: number, b: number] | [color: ColorRepresentation]
264
- : ConstructorParameters<T>
265
- : any[]
266
-
267
- type ArgsProp<P> = P extends ConstructorRepresentation
268
- ? IsAllOptional<ConstructorParameters<P>> extends true
269
- ? { args?: Args<P> }
270
- : { args: Args<P> }
271
- : { args: unknown[] }
272
-
273
- type InstanceProps<T = any, P = any> = ArgsProp<P> & {
274
- object?: T
275
- dispose?: null
276
- attach?: AttachType<T>
277
- }
278
-
279
- interface Instance<O = any> {
280
- root: RootStore
281
- type: string
282
- parent: Instance | null
283
- children: Instance[]
284
- props: InstanceProps<O> & Record<string, unknown>
285
- object: O & { __r3f?: Instance<O> }
286
- eventCount: number
287
- handlers: Partial<EventHandlers>
288
- attach?: AttachType<O>
289
- previousAttach?: any
290
- isHidden: boolean
291
- /** Set of props that have been applied via once() */
292
- appliedOnce?: Set<string>
293
- }
294
-
295
- interface HostConfig {
296
- type: string
297
- props: Instance['props']
298
- container: RootStore
299
- instance: Instance
300
- textInstance: void
301
- suspenseInstance: Instance
302
- hydratableInstance: never
303
- formInstance: never
304
- publicInstance: Instance['object']
305
- hostContext: {}
306
- childSet: never
307
- timeoutHandle: number | undefined
308
- noTimeout: -1
309
- TransitionStatus: null
310
- }
311
- declare global {
312
- var IS_REACT_ACT_ENVIRONMENT: boolean | undefined
313
- }
314
-
315
240
  //* Loop Types ==============================
316
241
 
317
242
  type GlobalRenderCallback = (timestamp: number) => void
@@ -618,8 +543,14 @@ type ThreeElement<T extends ConstructorRepresentation> = Mutable<
618
543
  Overwrite<ElementProps<T>, Omit<InstanceProps<InstanceType<T>, T>, 'object'>>
619
544
  >
620
545
 
546
+ /**
547
+ * Every constructor export of a three namespace as an uncapitalized JSX element. Non-constructor
548
+ * exports (constants, functions, nested namespaces) are dropped from the keys rather than mapped
549
+ * to `never`: a single `never`-valued key in `JSX.IntrinsicElements` collapses the props of any
550
+ * tag typed `React.ElementType` (#3898).
551
+ */
621
552
  type ThreeToJSXElements<T extends Record<string, any>> = {
622
- [K in keyof T & string as Uncapitalize<K>]: T[K] extends ConstructorRepresentation ? ThreeElement<T[K]> : never
553
+ [K in keyof T & string as T[K] extends ConstructorRepresentation ? Uncapitalize<K> : never]: ThreeElement<T[K]>
623
554
  }
624
555
 
625
556
  /** Method names of Object3D, excluded from the `primitive` element's typed props. */
@@ -875,7 +806,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
875
806
  * </EnvironmentPortal>
876
807
  * ```
877
808
  */
878
- declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): react_jsx_runtime.JSX.Element;
809
+ declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): React$1.JSX.Element;
879
810
  /**
880
811
  * Sets up a global environment map for PBR materials and backgrounds.
881
812
  * Affects scene.environment and optionally scene.background unless a custom scene is passed.
@@ -971,7 +902,7 @@ declare function EnvironmentPortal({ children, near, far, resolution, frames, ma
971
902
  * />
972
903
  * ```
973
904
  */
974
- declare function Environment(props: EnvironmentProps): react_jsx_runtime.JSX.Element;
905
+ declare function Environment(props: EnvironmentProps): React$1.JSX.Element;
975
906
 
976
907
  /**
977
908
  * Moves every trace of interactivity from one object to its replacement, for reconstruction.
@@ -1089,7 +1020,7 @@ declare const Texture: ({ children, input, onLoad, cache, }: {
1089
1020
  input: Parameters<typeof useTexture>[0];
1090
1021
  onLoad?: Parameters<typeof useTexture>[1];
1091
1022
  cache?: boolean;
1092
- }) => react_jsx_runtime.JSX.Element;
1023
+ }) => React$1.JSX.Element;
1093
1024
 
1094
1025
  /** Accepted shapes for a registry read: a single key, a list of keys, or a name→key map. */
1095
1026
  type TextureInput = string | string[] | Record<string, string>;
@@ -1876,7 +1807,8 @@ declare namespace ReactReconciler {
1876
1807
  type LanePriority = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17;
1877
1808
 
1878
1809
  type Lanes = number;
1879
- type Lane = number;
1810
+
1811
+ type Lane = number & { __LaneBrand: any };
1880
1812
 
1881
1813
  type Flags = number;
1882
1814
 
@@ -2207,7 +2139,6 @@ declare namespace ReactReconciler {
2207
2139
  onCaughtError: (error: Error, info: BaseErrorInfo) => void,
2208
2140
  onRecoverableError: (error: Error, info: BaseErrorInfo) => void,
2209
2141
  onDefaultTransitionIndicator: () => void,
2210
- transitionCallbacks: null | TransitionTracingCallbacks,
2211
2142
  ): OpaqueRoot;
2212
2143
 
2213
2144
  createPortal(
@@ -2217,8 +2148,6 @@ declare namespace ReactReconciler {
2217
2148
  key?: string | null,
2218
2149
  ): ReactPortal;
2219
2150
 
2220
- registerMutableSourceForHydration(root: FiberRoot, mutableSource: MutableSource): void;
2221
-
2222
2151
  createComponentSelector(component: React$AbstractComponent<never, unknown>): ComponentSelector;
2223
2152
 
2224
2153
  createHasPseudoClassSelector(selectors: Selector[]): HasPseudoClassSelector;
@@ -2253,8 +2182,12 @@ declare namespace ReactReconciler {
2253
2182
  isStrictMode: boolean,
2254
2183
  concurrentUpdatesByDefaultOverride: null | boolean,
2255
2184
  identifierPrefix: string,
2256
- onRecoverableError: (error: Error) => void,
2185
+ onUncaughtError: (error: Error, info: BaseErrorInfo & { errorBoundary?: Component }) => void,
2186
+ onCaughtError: (error: Error, info: BaseErrorInfo) => void,
2187
+ onRecoverableError: (error: Error, info: BaseErrorInfo) => void,
2188
+ onDefaultTransitionIndicator: () => void,
2257
2189
  transitionCallbacks: null | TransitionTracingCallbacks,
2190
+ formState: unknown,
2258
2191
  ): OpaqueRoot;
2259
2192
 
2260
2193
  updateContainer(
@@ -2264,17 +2197,27 @@ declare namespace ReactReconciler {
2264
2197
  callback?: (() => void) | null,
2265
2198
  ): Lane;
2266
2199
 
2200
+ updateContainerSync(
2201
+ element: ReactNode,
2202
+ container: OpaqueRoot,
2203
+ parentComponent?: Component<any, any> | null,
2204
+ callback?: (() => void) | null,
2205
+ ): Lane;
2206
+
2267
2207
  batchedUpdates<A, R>(fn: (a: A) => R, a: A): R;
2268
2208
 
2269
2209
  deferredUpdates<A>(fn: () => A): A;
2270
2210
 
2271
2211
  discreteUpdates<A, B, C, D, R>(fn: (arg0: A, arg1: B, arg2: C, arg3: D) => R, a: A, b: B, c: C, d: D): R;
2272
2212
 
2273
- flushControlled(fn: () => any): void;
2274
-
2275
2213
  flushSync(): void;
2276
2214
  flushSync<R>(fn: () => R): R;
2277
2215
 
2216
+ flushSyncFromReconciler(): void;
2217
+ flushSyncFromReconciler<R>(fn: () => R): R;
2218
+
2219
+ flushSyncWork(): boolean;
2220
+
2278
2221
  isAlreadyRendering(): boolean;
2279
2222
 
2280
2223
  flushPassiveEffects(): boolean;
@@ -2283,16 +2226,10 @@ declare namespace ReactReconciler {
2283
2226
 
2284
2227
  attemptSynchronousHydration(fiber: Fiber): void;
2285
2228
 
2286
- attemptDiscreteHydration(fiber: Fiber): void;
2287
-
2288
2229
  attemptContinuousHydration(fiber: Fiber): void;
2289
2230
 
2290
2231
  attemptHydrationAtCurrentPriority(fiber: Fiber): void;
2291
2232
 
2292
- getCurrentUpdatePriority(): LanePriority;
2293
-
2294
- runWithPriority<T>(priority: LanePriority, fn: () => T): T;
2295
-
2296
2233
  findHostInstance(component: any): PublicInstance | null;
2297
2234
 
2298
2235
  findHostInstanceWithWarning(component: any, methodName: string): PublicInstance | null;
@@ -2305,6 +2242,17 @@ declare namespace ReactReconciler {
2305
2242
 
2306
2243
  injectIntoDevTools(devToolsConfig: DevToolsConfig<Instance, TextInstance, any>): boolean;
2307
2244
  }
2245
+
2246
+ function defaultOnUncaughtError(error: Error): void;
2247
+ function defaultOnCaughtError(error: Error): void;
2248
+ function defaultOnRecoverableError(error: Error): void;
2249
+
2250
+ function startHostTransition(
2251
+ formFiber: Fiber,
2252
+ pendingState: unknown,
2253
+ action: ((formData: FormData) => void) | null,
2254
+ formData: FormData,
2255
+ ): void;
2308
2256
  }
2309
2257
 
2310
2258
  declare function extend<T extends ConstructorRepresentation>(objects: T): React$1.ExoticComponent<ThreeElement<T>>;
@@ -2848,5 +2796,5 @@ declare function isOnce(value: unknown): value is {
2848
2796
  [ONCE]: any[] | true;
2849
2797
  };
2850
2798
 
2851
- export { getThree as B, hasThree as D, whenThree as F, _roots as a$, swapInteractivity as aB, removeInteractivity as aC, createEvents as aD, useInstanceHandle as aE, useGraph as aF, useLoader as aG, IsObject as aH, useTexture as aK, Texture as aL, useTextures as aQ, useEnvironment as aS, addEffect as aT, addAfterEffect as aU, addTail as aV, invalidate as aW, advance as aX, extend as aY, reconciler as aZ, isRenderer as a_, registerPrimary as ao, getPrimary as ap, waitForPrimary as aq, hasPrimary as ar, unregisterPrimary as as, getPrimaryIds as at, EnvironmentMap as av, EnvironmentCube as aw, EnvironmentPortal as ax, Environment as ay, presetsObj as az, unmountComponentAtNode as b0, createPortal as b1, Portal as b2, flushSync as b3, createStore as b4, useIsomorphicLayoutEffect as b5, useMutableCallback as b6, useBridge as b7, Block as b8, ErrorBoundary as b9, isVectorLike as bA, isCopyable as bB, hasConstructor as bC, FROM_REF as bD, fromRef as bF, isFromRef as bG, ONCE as bH, once as bI, isOnce as bK, REACT_INTERNAL_PROPS as ba, findInitialRoot as bb, getRootState as bc, buildGraph as bd, dispose as be, getInstanceProps as bf, prepare as bg, invalidateInstance as bh, RESERVED_PROPS as bi, resolve as bj, attach as bk, detach as bl, diffProps as bm, applyProps as bn, calculateDpr as bo, getUuidPrefix as bp, updateCamera as bq, updateFrustum as br, is as bs, isOrthographicCamera as bt, isRef as bu, isColorRepresentation as bv, isObject3D as bw, isTexture as bx, isLayers as by, isUniform as bz, createPointerEvents as w };
2852
- export type { CameraProps as $, WebGLShadowConfig as A, Color as C, Euler as E, GeometryTransformProps as G, OffscreenCanvas$1 as H, BaseRendererProps as I, RendererFactory as J, Renderer as K, Layers as L, MutableOrReadonlyParameters as M, NodeProps as N, Object3DMethod as O, ColorManagementConfig as P, Quaternion as Q, RaycastableRepresentation as R, DefaultGLProps as S, TSLNodeInput as T, GLProps as U, VectorRepresentation as V, WebGLProps as W, DefaultRendererProps as X, CanvasSchedulerConfig as Y, RendererConfigExtended as Z, RendererProps as _, MathRepresentation as a, RenderProps as a0, InjectState as a1, FiberRoot as a2, Root as a3, AttachFnType as a4, AttachType as a5, Catalogue as a6, Args as a7, ArgsProp as a8, InstanceProps as a9, PresetsType as aA, MappedTextureType as aI, UseTextureOptions as aJ, TextureInput as aM, TextureResult as aN, DisposeOptions as aO, UseTexturesReturn as aP, EnvironmentLoaderProps as aR, Instance as aa, HostConfig as ab, GlobalRenderCallback as ac, GlobalEffectType as ad, BackgroundConfig as ae, BackgroundProp as af, InputLike as ag, LoaderLike as ah, GLTFLike as ai, LoaderInstance as aj, InferLoadResult as ak, LoaderResult as al, Extensions as am, PrimaryCanvasEntry as an, EnvironmentProps as au, MathTypes as b, FromRefMarker as bE, OnceValue as bJ, MathType as c, MathProps as d, Vector2 as e, Vector3 as f, Vector4 as g, Matrix3 as h, Matrix4 as i, EventProps as j, GeometryProps as k, ReactProps as l, ConstructorRepresentation as m, ElementProps as n, ThreeElement as o, ThreeToJSXElements as p, ThreeElementsOf as q, ElementOf as r, CanvasProps as s, LegacyRootState as t, ReconcilerRoot as u, RenderTargetOptions as v, LegacyInternalState as x, LegacyRenderer as y, WebGLDefaultProps as z };
2799
+ export { REACT_INTERNAL_PROPS as a$, Texture as aA, useTextures as aF, useEnvironment as aH, addEffect as aI, addAfterEffect as aJ, addTail as aK, invalidate as aL, advance as aM, extend as aN, reconciler as aO, isRenderer as aP, _roots as aQ, unmountComponentAtNode as aR, createPortal as aS, Portal as aT, flushSync as aU, createStore as aV, useIsomorphicLayoutEffect as aW, useMutableCallback as aX, useBridge as aY, Block as aZ, ErrorBoundary as a_, registerPrimary as ad, getPrimary as ae, waitForPrimary as af, hasPrimary as ag, unregisterPrimary as ah, getPrimaryIds as ai, EnvironmentMap as ak, EnvironmentCube as al, EnvironmentPortal as am, Environment as an, presetsObj as ao, swapInteractivity as aq, removeInteractivity as ar, createEvents as as, useInstanceHandle as at, useGraph as au, useLoader as av, IsObject as aw, useTexture as az, findInitialRoot as b0, getRootState as b1, buildGraph as b2, dispose as b3, getInstanceProps as b4, prepare as b5, invalidateInstance as b6, RESERVED_PROPS as b7, resolve as b8, attach as b9, detach as ba, diffProps as bb, applyProps as bc, calculateDpr as bd, getUuidPrefix as be, updateCamera as bf, updateFrustum as bg, is as bh, isOrthographicCamera as bi, isRef as bj, isColorRepresentation as bk, isObject3D as bl, isTexture as bm, isLayers as bn, isUniform as bo, isVectorLike as bp, isCopyable as bq, hasConstructor as br, FROM_REF as bs, fromRef as bu, isFromRef as bv, ONCE as bw, once as bx, isOnce as bz, createPointerEvents as u, getThree as v, hasThree as w, whenThree as x };
2800
+ export type { InputLike as $, Renderer as A, BaseRendererProps as B, Color as C, ColorManagementConfig as D, Euler as E, DefaultGLProps as F, GeometryTransformProps as G, GLProps as H, DefaultRendererProps as I, CanvasSchedulerConfig as J, RendererConfigExtended as K, Layers as L, MutableOrReadonlyParameters as M, NodeProps as N, Object3DMethod as O, RendererProps as P, Quaternion as Q, RaycastableRepresentation as R, CameraProps as S, TSLNodeInput as T, RenderProps as U, VectorRepresentation as V, InjectState as W, GlobalRenderCallback as X, GlobalEffectType as Y, BackgroundConfig as Z, BackgroundProp as _, MathRepresentation as a, LoaderLike as a0, GLTFLike as a1, LoaderInstance as a2, InferLoadResult as a3, LoaderResult as a4, Extensions as a5, WebGLDefaultProps as a6, WebGLProps as a7, WebGLShadowConfig as a8, LegacyRenderer as a9, TextureInput as aB, TextureResult as aC, DisposeOptions as aD, UseTexturesReturn as aE, EnvironmentLoaderProps as aG, LegacyInternalState as aa, LegacyRootState as ab, PrimaryCanvasEntry as ac, EnvironmentProps as aj, PresetsType as ap, MappedTextureType as ax, UseTextureOptions as ay, MathTypes as b, FromRefMarker as bt, OnceValue as by, MathType as c, MathProps as d, Vector2 as e, Vector3 as f, Vector4 as g, Matrix3 as h, Matrix4 as i, EventProps as j, GeometryProps as k, ReactProps as l, ElementProps as m, ThreeElement as n, ThreeToJSXElements as o, ThreeElementsOf as p, ElementOf as q, RenderTargetOptions as r, ReconcilerRoot as s, CanvasProps as t, OffscreenCanvas$1 as y, RendererFactory as z };
@@ -1,7 +1,7 @@
1
1
  import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi } from '@pmndrs/scheduler';
2
- import * as React from 'react';
3
2
  import * as THREE from 'three';
4
- import { WebGLRenderer, WebGLRenderTarget } from 'three';
3
+ import { WebGLRenderer, WebGLRenderTarget, Color, ColorRepresentation } from 'three';
4
+ import * as React from 'react';
5
5
  import * as ThreeWebGPU from 'three/webgpu';
6
6
  import { WebGPURenderer, RenderTarget, CanvasTarget } from 'three/webgpu';
7
7
  import { StoreApi } from 'zustand';
@@ -654,6 +654,83 @@ interface RootState {
654
654
 
655
655
  type RootStore = UseBoundStoreWithEqualityFn<StoreApi<RootState>>
656
656
 
657
+ //* Reconciler Types ==============================
658
+
659
+ // FiberRoot is an opaque internal React type - we define it locally
660
+ // to avoid bundling @types/react-reconciler which causes absolute path issues
661
+ type FiberRoot = any
662
+
663
+ interface Root {
664
+ fiber: FiberRoot
665
+ store: RootStore
666
+ }
667
+
668
+ type AttachFnType<O = any> = (parent: any, self: O) => () => void
669
+ type AttachType<O = any> = string | AttachFnType<O>
670
+
671
+ type ConstructorRepresentation<T = any> = new (...args: any[]) => T
672
+
673
+ interface Catalogue {
674
+ [name: string]: ConstructorRepresentation
675
+ }
676
+
677
+ // TODO: handle constructor overloads
678
+ // https://github.com/pmndrs/react-three-fiber/pull/2931
679
+ // https://github.com/microsoft/TypeScript/issues/37079
680
+ type Args<T> = T extends ConstructorRepresentation
681
+ ? T extends typeof Color
682
+ ? [r: number, g: number, b: number] | [color: ColorRepresentation]
683
+ : ConstructorParameters<T>
684
+ : any[]
685
+
686
+ type ArgsProp<P> = P extends ConstructorRepresentation
687
+ ? IsAllOptional<ConstructorParameters<P>> extends true
688
+ ? { args?: Args<P> }
689
+ : { args: Args<P> }
690
+ : { args: unknown[] }
691
+
692
+ type InstanceProps<T = any, P = any> = ArgsProp<P> & {
693
+ object?: T
694
+ dispose?: null
695
+ attach?: AttachType<T>
696
+ }
697
+
698
+ interface Instance<O = any> {
699
+ root: RootStore
700
+ type: string
701
+ parent: Instance | null
702
+ children: Instance[]
703
+ props: InstanceProps<O> & Record<string, unknown>
704
+ object: O & { __r3f?: Instance<O> }
705
+ eventCount: number
706
+ handlers: Partial<EventHandlers>
707
+ attach?: AttachType<O>
708
+ previousAttach?: any
709
+ isHidden: boolean
710
+ /** Set of props that have been applied via once() */
711
+ appliedOnce?: Set<string>
712
+ }
713
+
714
+ interface HostConfig {
715
+ type: string
716
+ props: Instance['props']
717
+ container: RootStore
718
+ instance: Instance
719
+ textInstance: void
720
+ suspenseInstance: Instance
721
+ hydratableInstance: never
722
+ formInstance: never
723
+ publicInstance: Instance['object']
724
+ hostContext: {}
725
+ childSet: never
726
+ timeoutHandle: number | undefined
727
+ noTimeout: -1
728
+ TransitionStatus: null
729
+ }
730
+ declare global {
731
+ var IS_REACT_ACT_ENVIRONMENT: boolean | undefined
732
+ }
733
+
657
734
  interface RootExtension {
658
735
  /** Unique name. Registering the same name again replaces the entry (HMR-safe); roots it already
659
736
  * set up are not set up a second time, but get the new entry's dispose and hmr. */
@@ -697,5 +774,5 @@ declare function useThree<T = RootState>(selector?: (state: RootState) => T, equ
697
774
 
698
775
  declare const context: React.Context<RootStore>;
699
776
 
700
- export { useStore as a2, context as a3, useThree as a7, registerRootExtension as r, setRenderOverride as s };
701
- export type { ForRegisteredRenderer as $, Act as A, Bridge as B, Camera as C, Dpr as D, Events as E, Frameloop as F, FrameCallback as G, ThreeNamespace as H, Intersection as I, ThreeCore as J, OcclusionSupport as K, WebGPUSupport as L, Mutable as M, NonFunctionKeys as N, Overwrite as O, PointerState as P, RendererSupport as Q, RootExtension as R, Subscription as S, ThreeEvent as T, UnblockProps as U, Viewport as V, WebGLSupport as W, XRManager as X, RendererProvider as Y, Register as Z, RegisteredRenderer as _, Size as a, R3FRenderTarget as a0, R3FRendererSupport as a1, R3FRenderer as a4, InternalState as a5, RootState as a6, RenderCallback as b, Performance as c, RootStore as d, IntersectionEvent as e, DomEvent as f, EventHandlers as g, FilterFunction as h, ComputeFunction as i, XRPointerConfig as j, EventManager as k, PointerCaptureTarget as l, VisibilityEntry as m, Properties as n, IsOptional as o, IsAllOptional as p, ThreeCamera as q, SetBlock as t, ObjectMap as u, EquConfig as v, Disposable as w, FrameNextState as x, FrameState as y, FrameNextCallback as z };
777
+ export { useStore as ag, useThree as ah, context as ai, registerRootExtension as r, setRenderOverride as s };
778
+ export type { EquConfig as $, AttachFnType as A, InstanceProps as B, ConstructorRepresentation as C, Dpr as D, Events as E, Frameloop as F, Instance as G, HostConfig as H, InternalState as I, Properties as J, IsOptional as K, IsAllOptional as L, Mutable as M, NonFunctionKeys as N, Overwrite as O, PointerState as P, ThreeCamera as Q, R3FRenderTarget as R, Subscription as S, ThreeEvent as T, Act as U, Viewport as V, Bridge as W, XRManager as X, SetBlock as Y, UnblockProps as Z, ObjectMap as _, RootExtension as a, Disposable as a0, FrameNextState as a1, FrameState as a2, FrameNextCallback as a3, FrameCallback as a4, ThreeNamespace as a5, ThreeCore as a6, OcclusionSupport as a7, WebGLSupport as a8, WebGPUSupport as a9, RendererSupport as aa, RendererProvider as ab, Register as ac, RegisteredRenderer as ad, ForRegisteredRenderer as ae, R3FRendererSupport as af, R3FRenderer as b, Size as c, RenderCallback as d, Performance as e, RootState as f, RootStore as g, Intersection as h, Camera as i, IntersectionEvent as j, DomEvent as k, EventHandlers as l, FilterFunction as m, ComputeFunction as n, XRPointerConfig as o, EventManager as p, PointerCaptureTarget as q, VisibilityEntry as t, FiberRoot as u, Root as v, AttachType as w, Catalogue as x, Args as y, ArgsProp as z };
@@ -1,7 +1,7 @@
1
1
  import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi } from '@pmndrs/scheduler';
2
- import * as React from 'react';
3
2
  import * as THREE from 'three';
4
- import { WebGLRenderer, WebGLRenderTarget } from 'three';
3
+ import { WebGLRenderer, WebGLRenderTarget, Color, ColorRepresentation } from 'three';
4
+ import * as React from 'react';
5
5
  import * as ThreeWebGPU from 'three/webgpu';
6
6
  import { WebGPURenderer, RenderTarget, CanvasTarget } from 'three/webgpu';
7
7
  import { StoreApi } from 'zustand';
@@ -654,6 +654,83 @@ interface RootState {
654
654
 
655
655
  type RootStore = UseBoundStoreWithEqualityFn<StoreApi<RootState>>
656
656
 
657
+ //* Reconciler Types ==============================
658
+
659
+ // FiberRoot is an opaque internal React type - we define it locally
660
+ // to avoid bundling @types/react-reconciler which causes absolute path issues
661
+ type FiberRoot = any
662
+
663
+ interface Root {
664
+ fiber: FiberRoot
665
+ store: RootStore
666
+ }
667
+
668
+ type AttachFnType<O = any> = (parent: any, self: O) => () => void
669
+ type AttachType<O = any> = string | AttachFnType<O>
670
+
671
+ type ConstructorRepresentation<T = any> = new (...args: any[]) => T
672
+
673
+ interface Catalogue {
674
+ [name: string]: ConstructorRepresentation
675
+ }
676
+
677
+ // TODO: handle constructor overloads
678
+ // https://github.com/pmndrs/react-three-fiber/pull/2931
679
+ // https://github.com/microsoft/TypeScript/issues/37079
680
+ type Args<T> = T extends ConstructorRepresentation
681
+ ? T extends typeof Color
682
+ ? [r: number, g: number, b: number] | [color: ColorRepresentation]
683
+ : ConstructorParameters<T>
684
+ : any[]
685
+
686
+ type ArgsProp<P> = P extends ConstructorRepresentation
687
+ ? IsAllOptional<ConstructorParameters<P>> extends true
688
+ ? { args?: Args<P> }
689
+ : { args: Args<P> }
690
+ : { args: unknown[] }
691
+
692
+ type InstanceProps<T = any, P = any> = ArgsProp<P> & {
693
+ object?: T
694
+ dispose?: null
695
+ attach?: AttachType<T>
696
+ }
697
+
698
+ interface Instance<O = any> {
699
+ root: RootStore
700
+ type: string
701
+ parent: Instance | null
702
+ children: Instance[]
703
+ props: InstanceProps<O> & Record<string, unknown>
704
+ object: O & { __r3f?: Instance<O> }
705
+ eventCount: number
706
+ handlers: Partial<EventHandlers>
707
+ attach?: AttachType<O>
708
+ previousAttach?: any
709
+ isHidden: boolean
710
+ /** Set of props that have been applied via once() */
711
+ appliedOnce?: Set<string>
712
+ }
713
+
714
+ interface HostConfig {
715
+ type: string
716
+ props: Instance['props']
717
+ container: RootStore
718
+ instance: Instance
719
+ textInstance: void
720
+ suspenseInstance: Instance
721
+ hydratableInstance: never
722
+ formInstance: never
723
+ publicInstance: Instance['object']
724
+ hostContext: {}
725
+ childSet: never
726
+ timeoutHandle: number | undefined
727
+ noTimeout: -1
728
+ TransitionStatus: null
729
+ }
730
+ declare global {
731
+ var IS_REACT_ACT_ENVIRONMENT: boolean | undefined
732
+ }
733
+
657
734
  interface RootExtension {
658
735
  /** Unique name. Registering the same name again replaces the entry (HMR-safe); roots it already
659
736
  * set up are not set up a second time, but get the new entry's dispose and hmr. */
@@ -697,5 +774,5 @@ declare function useThree<T = RootState>(selector?: (state: RootState) => T, equ
697
774
 
698
775
  declare const context: React.Context<RootStore>;
699
776
 
700
- export { useStore as a2, context as a3, useThree as a7, registerRootExtension as r, setRenderOverride as s };
701
- export type { ForRegisteredRenderer as $, Act as A, Bridge as B, Camera as C, Dpr as D, Events as E, Frameloop as F, FrameCallback as G, ThreeNamespace as H, Intersection as I, ThreeCore as J, OcclusionSupport as K, WebGPUSupport as L, Mutable as M, NonFunctionKeys as N, Overwrite as O, PointerState as P, RendererSupport as Q, RootExtension as R, Subscription as S, ThreeEvent as T, UnblockProps as U, Viewport as V, WebGLSupport as W, XRManager as X, RendererProvider as Y, Register as Z, RegisteredRenderer as _, Size as a, R3FRenderTarget as a0, R3FRendererSupport as a1, R3FRenderer as a4, InternalState as a5, RootState as a6, RenderCallback as b, Performance as c, RootStore as d, IntersectionEvent as e, DomEvent as f, EventHandlers as g, FilterFunction as h, ComputeFunction as i, XRPointerConfig as j, EventManager as k, PointerCaptureTarget as l, VisibilityEntry as m, Properties as n, IsOptional as o, IsAllOptional as p, ThreeCamera as q, SetBlock as t, ObjectMap as u, EquConfig as v, Disposable as w, FrameNextState as x, FrameState as y, FrameNextCallback as z };
777
+ export { useStore as ag, useThree as ah, context as ai, registerRootExtension as r, setRenderOverride as s };
778
+ export type { EquConfig as $, AttachFnType as A, InstanceProps as B, ConstructorRepresentation as C, Dpr as D, Events as E, Frameloop as F, Instance as G, HostConfig as H, InternalState as I, Properties as J, IsOptional as K, IsAllOptional as L, Mutable as M, NonFunctionKeys as N, Overwrite as O, PointerState as P, ThreeCamera as Q, R3FRenderTarget as R, Subscription as S, ThreeEvent as T, Act as U, Viewport as V, Bridge as W, XRManager as X, SetBlock as Y, UnblockProps as Z, ObjectMap as _, RootExtension as a, Disposable as a0, FrameNextState as a1, FrameState as a2, FrameNextCallback as a3, FrameCallback as a4, ThreeNamespace as a5, ThreeCore as a6, OcclusionSupport as a7, WebGLSupport as a8, WebGPUSupport as a9, RendererSupport as aa, RendererProvider as ab, Register as ac, RegisteredRenderer as ad, ForRegisteredRenderer as ae, R3FRendererSupport as af, R3FRenderer as b, Size as c, RenderCallback as d, Performance as e, RootState as f, RootStore as g, Intersection as h, Camera as i, IntersectionEvent as j, DomEvent as k, EventHandlers as l, FilterFunction as m, ComputeFunction as n, XRPointerConfig as o, EventManager as p, PointerCaptureTarget as q, VisibilityEntry as t, FiberRoot as u, Root as v, AttachType as w, Catalogue as x, Args as y, ArgsProp as z };