@react-three/fiber 10.0.0-canary.e881a4a → 10.0.0-canary.f49e56e
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.
- package/dist/index.cjs +2590 -2400
- package/dist/index.d.cts +68 -22
- package/dist/index.d.mts +68 -22
- package/dist/index.d.ts +68 -22
- package/dist/index.mjs +2592 -2402
- package/dist/legacy.cjs +2586 -2401
- package/dist/legacy.d.cts +67 -25
- package/dist/legacy.d.mts +67 -25
- package/dist/legacy.d.ts +67 -25
- package/dist/legacy.mjs +2588 -2403
- package/dist/webgpu/index.cjs +2636 -2421
- package/dist/webgpu/index.d.cts +89 -71
- package/dist/webgpu/index.d.mts +89 -71
- package/dist/webgpu/index.d.ts +89 -71
- package/dist/webgpu/index.mjs +2637 -2422
- package/package.json +4 -4
- package/readme.md +1 -1
- package/react-reconciler/constants.d.ts +0 -7
- package/react-reconciler/constants.js +0 -1
- package/react-reconciler/index.d.ts +0 -1044
- package/react-reconciler/index.js +0 -208
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as three_examples_jsm_inspector_Inspector_js from 'three/examples/jsm/inspector/Inspector.js';
|
|
1
2
|
import * as three_webgpu from 'three/webgpu';
|
|
2
3
|
import { CubeRenderTarget, RenderTarget, WebGPURenderer, Node, StorageTexture, Data3DTexture, CanvasTarget, ShaderNodeObject, Euler as Euler$2, Color as Color$2, ColorRepresentation as ColorRepresentation$1, Layers as Layers$1, Raycaster, Intersection as Intersection$1, BufferGeometry, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, Vector2 as Vector2$1, Vector3 as Vector3$1, Vector4 as Vector4$1, Matrix3 as Matrix3$1, Loader as Loader$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D, Frustum, OrthographicCamera } from 'three/webgpu';
|
|
3
4
|
import * as THREE$1 from 'three';
|
|
@@ -12,7 +13,6 @@ import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi, UseFr
|
|
|
12
13
|
export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
|
|
13
14
|
import { Options } from 'react-use-measure';
|
|
14
15
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
15
|
-
import { ThreeElement as ThreeElement$1, Euler as Euler$3 } from '@react-three/fiber';
|
|
16
16
|
import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
|
|
17
17
|
|
|
18
18
|
function _mergeNamespaces(n, m) {
|
|
@@ -48,6 +48,9 @@ function _mergeNamespaces(n, m) {
|
|
|
48
48
|
declare const R3F_BUILD_LEGACY = true;
|
|
49
49
|
declare const R3F_BUILD_WEBGPU = true;
|
|
50
50
|
|
|
51
|
+
/** Lazily load the three Inspector. Keeps it out of the eager module graph — see note above. */
|
|
52
|
+
declare function loadInspector(): Promise<typeof three_examples_jsm_inspector_Inspector_js.Inspector>;
|
|
53
|
+
|
|
51
54
|
var THREE = /*#__PURE__*/_mergeNamespaces({
|
|
52
55
|
__proto__: null,
|
|
53
56
|
CubeRenderTarget: CubeRenderTarget,
|
|
@@ -59,7 +62,8 @@ var THREE = /*#__PURE__*/_mergeNamespaces({
|
|
|
59
62
|
WebGLCubeRenderTarget: WebGLCubeRenderTarget,
|
|
60
63
|
WebGLRenderTarget: WebGLRenderTarget,
|
|
61
64
|
WebGLRenderer: WebGLRenderer,
|
|
62
|
-
WebGLRendererParameters: WebGLRendererParameters
|
|
65
|
+
WebGLRendererParameters: WebGLRendererParameters,
|
|
66
|
+
loadInspector: loadInspector
|
|
63
67
|
}, [three_webgpu]);
|
|
64
68
|
|
|
65
69
|
//* Utility Types ==============================
|
|
@@ -497,6 +501,18 @@ interface InternalState {
|
|
|
497
501
|
* @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
|
|
498
502
|
*/
|
|
499
503
|
canvasTarget?: CanvasTarget
|
|
504
|
+
/**
|
|
505
|
+
* Set when this root's canvas target has been resized and the backend's cached render pass
|
|
506
|
+
* descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
|
|
507
|
+
*
|
|
508
|
+
* Flushed by the canvas-target job in the `start` phase, which is the only place this root's
|
|
509
|
+
* target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
|
|
510
|
+
* whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
|
|
511
|
+
* invalidate some other canvas's descriptor instead.
|
|
512
|
+
*
|
|
513
|
+
* @see https://github.com/pmndrs/react-three-fiber/issues/3847
|
|
514
|
+
*/
|
|
515
|
+
canvasTargetSizeDirty?: boolean
|
|
500
516
|
/**
|
|
501
517
|
* Whether multi-canvas rendering is active.
|
|
502
518
|
* True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
|
|
@@ -706,12 +722,19 @@ type DefaultRendererProps = {
|
|
|
706
722
|
*/
|
|
707
723
|
interface CanvasSchedulerConfig {
|
|
708
724
|
/**
|
|
709
|
-
*
|
|
710
|
-
* Pass the `id` of another canvas.
|
|
725
|
+
* Run this Canvas root before the referenced Canvas root id(s).
|
|
711
726
|
*/
|
|
712
|
-
|
|
727
|
+
before?: string | string[]
|
|
713
728
|
/**
|
|
714
|
-
*
|
|
729
|
+
* Run this Canvas root after the referenced Canvas root id(s).
|
|
730
|
+
*/
|
|
731
|
+
after?: string | string[]
|
|
732
|
+
/**
|
|
733
|
+
* Numeric root order. Lower values run first.
|
|
734
|
+
*/
|
|
735
|
+
order?: number
|
|
736
|
+
/**
|
|
737
|
+
* Limit this Canvas's default render job (frames per second).
|
|
715
738
|
*/
|
|
716
739
|
fps?: number
|
|
717
740
|
}
|
|
@@ -1315,11 +1338,16 @@ declare global {
|
|
|
1315
1338
|
/** Pass record - stores TSL pass nodes for render pipeline */
|
|
1316
1339
|
type PassRecord = Record<string, any>
|
|
1317
1340
|
|
|
1341
|
+
/** State passed to pipeline callbacks after the active pipeline has been created */
|
|
1342
|
+
type RenderPipelineCallbackState = RootState & {
|
|
1343
|
+
renderPipeline: ThreeRenderPipeline
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1318
1346
|
/** Setup callback - runs first to configure MRT, create additional passes */
|
|
1319
|
-
type RenderPipelineSetupCallback = (state:
|
|
1347
|
+
type RenderPipelineSetupCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1320
1348
|
|
|
1321
1349
|
/** Main callback - runs second to configure outputNode, create effect passes */
|
|
1322
|
-
type RenderPipelineMainCallback = (state:
|
|
1350
|
+
type RenderPipelineMainCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1323
1351
|
|
|
1324
1352
|
/** Return type for useRenderPipeline hook */
|
|
1325
1353
|
interface UseRenderPipelineReturn {
|
|
@@ -1635,9 +1663,9 @@ type EnvironmentProps = {
|
|
|
1635
1663
|
blur?: number;
|
|
1636
1664
|
backgroundBlurriness?: number;
|
|
1637
1665
|
backgroundIntensity?: number;
|
|
1638
|
-
backgroundRotation?: Euler
|
|
1666
|
+
backgroundRotation?: Euler;
|
|
1639
1667
|
environmentIntensity?: number;
|
|
1640
|
-
environmentRotation?: Euler
|
|
1668
|
+
environmentRotation?: Euler;
|
|
1641
1669
|
map?: Texture$1;
|
|
1642
1670
|
preset?: PresetsType;
|
|
1643
1671
|
scene?: Scene | React$1.RefObject<Scene>;
|
|
@@ -1721,7 +1749,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
|
|
|
1721
1749
|
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;
|
|
1722
1750
|
declare module '@react-three/fiber' {
|
|
1723
1751
|
interface ThreeElements {
|
|
1724
|
-
groundProjectedEnvImpl: ThreeElement
|
|
1752
|
+
groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
|
|
1725
1753
|
}
|
|
1726
1754
|
}
|
|
1727
1755
|
/**
|
|
@@ -1821,6 +1849,24 @@ declare module '@react-three/fiber' {
|
|
|
1821
1849
|
*/
|
|
1822
1850
|
declare function Environment(props: EnvironmentProps): react_jsx_runtime.JSX.Element;
|
|
1823
1851
|
|
|
1852
|
+
/**
|
|
1853
|
+
* Moves every trace of interactivity from one object to its replacement, for reconstruction.
|
|
1854
|
+
*
|
|
1855
|
+
* When `args` or a `primitive`'s `object` changes, R3F builds a new three object and keeps the same
|
|
1856
|
+
* instance. Removing the old object from the interaction state and registering the new one from
|
|
1857
|
+
* scratch makes events *work* again (#3778), but it forgets what was in flight: a pointer resting on
|
|
1858
|
+
* the object fires a second `onPointerEnter` without ever having left, and an active pointer capture
|
|
1859
|
+
* is dropped mid-drag. Rewriting the references instead keeps the interaction continuous across a
|
|
1860
|
+
* swap the user never asked to see (#3744).
|
|
1861
|
+
*
|
|
1862
|
+
* Captures are re-keyed rather than released, so the DOM-level capture on `captureData.target` is
|
|
1863
|
+
* left alone — releasing and re-acquiring it is precisely the glitch being avoided.
|
|
1864
|
+
*
|
|
1865
|
+
* Visibility handlers are deliberately not transferred: that registry is keyed by `object.uuid`, so
|
|
1866
|
+
* the replacement re-registers itself through `applyProps`. The old entry is dropped here so it
|
|
1867
|
+
* cannot outlive the object it described.
|
|
1868
|
+
*/
|
|
1869
|
+
declare function swapInteractivity(store: RootStore, object: Object3D, newObject: Object3D): void;
|
|
1824
1870
|
declare function removeInteractivity(store: RootStore, object: Object3D): void;
|
|
1825
1871
|
declare function createEvents(store: RootStore): {
|
|
1826
1872
|
handlePointer: (name: string) => (event: DomEvent) => void;
|
|
@@ -1861,7 +1907,7 @@ declare namespace useLoader {
|
|
|
1861
1907
|
*
|
|
1862
1908
|
* @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
|
|
1863
1909
|
* @param priorityOrOptions - Either a priority number (backwards compat) or options object
|
|
1864
|
-
* @returns Controls object with step(), stepAll(), pause(), resume(), isPaused, id, scheduler
|
|
1910
|
+
* @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
|
|
1865
1911
|
*
|
|
1866
1912
|
* @example
|
|
1867
1913
|
* // Simple priority (backwards compat)
|
|
@@ -2157,7 +2203,10 @@ declare function addTail(callback: GlobalRenderCallback): () => void;
|
|
|
2157
2203
|
* Invalidates the view, requesting a frame to be rendered.
|
|
2158
2204
|
* In demand mode, this triggers the scheduler to run frames.
|
|
2159
2205
|
*
|
|
2160
|
-
*
|
|
2206
|
+
* With a state argument, only that root's jobs run on the requested frames; other
|
|
2207
|
+
* roots on 'demand' stay idle. Without one, every registered root is invalidated.
|
|
2208
|
+
*
|
|
2209
|
+
* @param state - Optional root state; targets the invalidation at that root
|
|
2161
2210
|
* @param frames - Number of frames to request (default: 1)
|
|
2162
2211
|
* @param stackFrames - If false, sets pendingFrames to frames. If true, adds to existing pendingFrames (default: false)
|
|
2163
2212
|
*
|
|
@@ -2168,14 +2217,16 @@ declare function invalidate(state?: RootState, frames?: number, stackFrames?: bo
|
|
|
2168
2217
|
* Advances the frameloop and runs render effects.
|
|
2169
2218
|
* Useful for when manually rendering via `frameloop="never"`.
|
|
2170
2219
|
*
|
|
2220
|
+
* With a state argument, only that root is stepped. Without one, every
|
|
2221
|
+
* registered root is stepped for backwards compatibility.
|
|
2222
|
+
*
|
|
2171
2223
|
* @param timestamp - The timestamp to use for this frame
|
|
2172
2224
|
* @param runGlobalEffects - Ignored (kept for backwards compat, global effects always run)
|
|
2173
|
-
* @param state -
|
|
2174
|
-
* @param frame - Ignored (kept for backwards compat)
|
|
2225
|
+
* @param state - Optional root state; targets the manual step at that root
|
|
2175
2226
|
*
|
|
2176
2227
|
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
|
|
2177
2228
|
*/
|
|
2178
|
-
declare function advance(timestamp: number): void;
|
|
2229
|
+
declare function advance(timestamp: number, runGlobalEffects?: boolean, state?: RootState): void;
|
|
2179
2230
|
|
|
2180
2231
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2181
2232
|
declare function ReactReconciler<
|
|
@@ -3246,11 +3297,6 @@ declare function flushSync<R>(fn: () => R): R;
|
|
|
3246
3297
|
declare const context: React$1.Context<RootStore>;
|
|
3247
3298
|
declare const createStore: (invalidate: (state?: RootState, frames?: number, stackFrames?: boolean) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState, frame?: XRFrame) => void) => RootStore;
|
|
3248
3299
|
|
|
3249
|
-
/**
|
|
3250
|
-
* Safely flush async effects when testing, simulating a legacy root.
|
|
3251
|
-
* @deprecated Import from React instead. import { act } from 'react'
|
|
3252
|
-
*/
|
|
3253
|
-
declare const act: typeof React$1.act;
|
|
3254
3300
|
/**
|
|
3255
3301
|
* An SSR-friendly useLayoutEffect.
|
|
3256
3302
|
*
|
|
@@ -3734,5 +3780,5 @@ declare function isOnce(value: unknown): value is {
|
|
|
3734
3780
|
*/
|
|
3735
3781
|
declare function Canvas(props: CanvasProps): react_jsx_runtime.JSX.Element;
|
|
3736
3782
|
|
|
3737
|
-
export { Block, Canvas, Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal, ErrorBoundary, FROM_REF, IsObject, ONCE, Portal, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, REACT_INTERNAL_PROPS, RESERVED_PROPS, three_d as ReactThreeFiber, Texture, _roots,
|
|
3783
|
+
export { Block, Canvas, Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal, ErrorBoundary, FROM_REF, IsObject, ONCE, Portal, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, REACT_INTERNAL_PROPS, RESERVED_PROPS, three_d as ReactThreeFiber, Texture, _roots, addAfterEffect, addEffect, addTail, advance, applyProps, attach, buildGraph, calculateDpr, context, createEvents, createPointerEvents, createPortal, createRoot, createStore, detach, diffProps, dispose, createPointerEvents as events, extend, findInitialRoot, flushSync, fromRef, getInstanceProps, getPrimary, getPrimaryIds, getRootState, getUuidPrefix, hasConstructor, hasPrimary, invalidate, invalidateInstance, is, isColorRepresentation, isCopyable, isFromRef, isObject3D, isOnce, isOrthographicCamera, isRef, isRenderer, isTexture, isVectorLike, once, prepare, presetsObj, reconciler, registerPrimary, removeInteractivity, resolve, swapInteractivity, unmountComponentAtNode, unregisterPrimary, updateCamera, updateFrustum, useBridge, useEnvironment, useFrame, useGraph, useInstanceHandle, useIsomorphicLayoutEffect, useLoader, useMutableCallback, useRenderTarget, useStore, useTexture, useTextures, useThree, waitForPrimary };
|
|
3738
3784
|
export type { Act, Args, ArgsProp, AttachFnType, AttachType, BackgroundConfig, BackgroundProp, BaseRendererProps, Bridge, BufferLike, BufferRecord, BufferStore, Camera, CameraProps, CanvasProps, CanvasSchedulerConfig, Catalogue, Color, ColorManagementConfig, ComputeFunction, ConstructorRepresentation, DefaultGLProps, DefaultRendererProps, Disposable, DisposeOptions, DomEvent, Dpr, ElementProps, EnvironmentLoaderProps, EnvironmentProps, EquConfig, Euler, EventHandlers, EventManager, EventProps, Events, Extensions, FiberRoot, FilterFunction, FrameCallback, FrameNextCallback, FrameNextState, FrameState, Frameloop, GLProps, GLTFLike, GeometryProps, GeometryTransformProps, GlobalEffectType, GlobalRenderCallback, HostConfig, InferLoadResult, InjectState, InputLike, Instance, InstanceProps, InternalState, Intersection, IntersectionEvent, IsAllOptional, IsOptional, Layers, LegacyInternalState, LegacyRenderer, LegacyRootState, LoaderInstance, LoaderLike, LoaderResult, MappedTextureType, MathProps, MathRepresentation, MathType, MathTypes, Matrix3, Matrix4, Mutable, MutableOrReadonlyParameters, NodeProps, NonFunctionKeys, ObjectMap, OffscreenCanvas$1 as OffscreenCanvas, Overwrite, Performance, PointerCaptureTarget, PointerState, PresetsType, PrimaryCanvasEntry, Properties, Quaternion, R3FRenderer, RaycastableRepresentation, ReactProps, ReconcilerRoot, RenderCallback, RenderProps, RenderTargetOptions, Renderer, RendererConfigExtended, RendererFactory, RendererProps, Root, RootState, RootStore, SetBlock, Size, StorageLike, StorageRecord, StorageStore, Subscription, TSLNodeInput, TextureInput, TextureResult, ThreeCamera, ThreeElement, ThreeElements, ThreeElementsImpl, ThreeEvent, ThreeExports, ThreeToJSXElements, UnblockProps, UseTextureOptions, UseTexturesReturn, Vector2, Vector3, Vector4, VectorRepresentation, Viewport, VisibilityEntry, WebGLDefaultProps, WebGLProps, WebGLShadowConfig, XRManager, XRPointerConfig };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as three_examples_jsm_inspector_Inspector_js from 'three/examples/jsm/inspector/Inspector.js';
|
|
1
2
|
import * as three_webgpu from 'three/webgpu';
|
|
2
3
|
import { CubeRenderTarget, RenderTarget, WebGPURenderer, Node, StorageTexture, Data3DTexture, CanvasTarget, ShaderNodeObject, Euler as Euler$2, Color as Color$2, ColorRepresentation as ColorRepresentation$1, Layers as Layers$1, Raycaster, Intersection as Intersection$1, BufferGeometry, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, Vector2 as Vector2$1, Vector3 as Vector3$1, Vector4 as Vector4$1, Matrix3 as Matrix3$1, Loader as Loader$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D, Frustum, OrthographicCamera } from 'three/webgpu';
|
|
3
4
|
import * as THREE$1 from 'three';
|
|
@@ -12,7 +13,6 @@ import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi, UseFr
|
|
|
12
13
|
export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
|
|
13
14
|
import { Options } from 'react-use-measure';
|
|
14
15
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
15
|
-
import { ThreeElement as ThreeElement$1, Euler as Euler$3 } from '@react-three/fiber';
|
|
16
16
|
import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
|
|
17
17
|
|
|
18
18
|
function _mergeNamespaces(n, m) {
|
|
@@ -48,6 +48,9 @@ function _mergeNamespaces(n, m) {
|
|
|
48
48
|
declare const R3F_BUILD_LEGACY = true;
|
|
49
49
|
declare const R3F_BUILD_WEBGPU = true;
|
|
50
50
|
|
|
51
|
+
/** Lazily load the three Inspector. Keeps it out of the eager module graph — see note above. */
|
|
52
|
+
declare function loadInspector(): Promise<typeof three_examples_jsm_inspector_Inspector_js.Inspector>;
|
|
53
|
+
|
|
51
54
|
var THREE = /*#__PURE__*/_mergeNamespaces({
|
|
52
55
|
__proto__: null,
|
|
53
56
|
CubeRenderTarget: CubeRenderTarget,
|
|
@@ -59,7 +62,8 @@ var THREE = /*#__PURE__*/_mergeNamespaces({
|
|
|
59
62
|
WebGLCubeRenderTarget: WebGLCubeRenderTarget,
|
|
60
63
|
WebGLRenderTarget: WebGLRenderTarget,
|
|
61
64
|
WebGLRenderer: WebGLRenderer,
|
|
62
|
-
WebGLRendererParameters: WebGLRendererParameters
|
|
65
|
+
WebGLRendererParameters: WebGLRendererParameters,
|
|
66
|
+
loadInspector: loadInspector
|
|
63
67
|
}, [three_webgpu]);
|
|
64
68
|
|
|
65
69
|
//* Utility Types ==============================
|
|
@@ -497,6 +501,18 @@ interface InternalState {
|
|
|
497
501
|
* @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
|
|
498
502
|
*/
|
|
499
503
|
canvasTarget?: CanvasTarget
|
|
504
|
+
/**
|
|
505
|
+
* Set when this root's canvas target has been resized and the backend's cached render pass
|
|
506
|
+
* descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
|
|
507
|
+
*
|
|
508
|
+
* Flushed by the canvas-target job in the `start` phase, which is the only place this root's
|
|
509
|
+
* target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
|
|
510
|
+
* whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
|
|
511
|
+
* invalidate some other canvas's descriptor instead.
|
|
512
|
+
*
|
|
513
|
+
* @see https://github.com/pmndrs/react-three-fiber/issues/3847
|
|
514
|
+
*/
|
|
515
|
+
canvasTargetSizeDirty?: boolean
|
|
500
516
|
/**
|
|
501
517
|
* Whether multi-canvas rendering is active.
|
|
502
518
|
* True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
|
|
@@ -706,12 +722,19 @@ type DefaultRendererProps = {
|
|
|
706
722
|
*/
|
|
707
723
|
interface CanvasSchedulerConfig {
|
|
708
724
|
/**
|
|
709
|
-
*
|
|
710
|
-
* Pass the `id` of another canvas.
|
|
725
|
+
* Run this Canvas root before the referenced Canvas root id(s).
|
|
711
726
|
*/
|
|
712
|
-
|
|
727
|
+
before?: string | string[]
|
|
713
728
|
/**
|
|
714
|
-
*
|
|
729
|
+
* Run this Canvas root after the referenced Canvas root id(s).
|
|
730
|
+
*/
|
|
731
|
+
after?: string | string[]
|
|
732
|
+
/**
|
|
733
|
+
* Numeric root order. Lower values run first.
|
|
734
|
+
*/
|
|
735
|
+
order?: number
|
|
736
|
+
/**
|
|
737
|
+
* Limit this Canvas's default render job (frames per second).
|
|
715
738
|
*/
|
|
716
739
|
fps?: number
|
|
717
740
|
}
|
|
@@ -1315,11 +1338,16 @@ declare global {
|
|
|
1315
1338
|
/** Pass record - stores TSL pass nodes for render pipeline */
|
|
1316
1339
|
type PassRecord = Record<string, any>
|
|
1317
1340
|
|
|
1341
|
+
/** State passed to pipeline callbacks after the active pipeline has been created */
|
|
1342
|
+
type RenderPipelineCallbackState = RootState & {
|
|
1343
|
+
renderPipeline: ThreeRenderPipeline
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1318
1346
|
/** Setup callback - runs first to configure MRT, create additional passes */
|
|
1319
|
-
type RenderPipelineSetupCallback = (state:
|
|
1347
|
+
type RenderPipelineSetupCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1320
1348
|
|
|
1321
1349
|
/** Main callback - runs second to configure outputNode, create effect passes */
|
|
1322
|
-
type RenderPipelineMainCallback = (state:
|
|
1350
|
+
type RenderPipelineMainCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1323
1351
|
|
|
1324
1352
|
/** Return type for useRenderPipeline hook */
|
|
1325
1353
|
interface UseRenderPipelineReturn {
|
|
@@ -1635,9 +1663,9 @@ type EnvironmentProps = {
|
|
|
1635
1663
|
blur?: number;
|
|
1636
1664
|
backgroundBlurriness?: number;
|
|
1637
1665
|
backgroundIntensity?: number;
|
|
1638
|
-
backgroundRotation?: Euler
|
|
1666
|
+
backgroundRotation?: Euler;
|
|
1639
1667
|
environmentIntensity?: number;
|
|
1640
|
-
environmentRotation?: Euler
|
|
1668
|
+
environmentRotation?: Euler;
|
|
1641
1669
|
map?: Texture$1;
|
|
1642
1670
|
preset?: PresetsType;
|
|
1643
1671
|
scene?: Scene | React$1.RefObject<Scene>;
|
|
@@ -1721,7 +1749,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
|
|
|
1721
1749
|
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;
|
|
1722
1750
|
declare module '@react-three/fiber' {
|
|
1723
1751
|
interface ThreeElements {
|
|
1724
|
-
groundProjectedEnvImpl: ThreeElement
|
|
1752
|
+
groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
|
|
1725
1753
|
}
|
|
1726
1754
|
}
|
|
1727
1755
|
/**
|
|
@@ -1821,6 +1849,24 @@ declare module '@react-three/fiber' {
|
|
|
1821
1849
|
*/
|
|
1822
1850
|
declare function Environment(props: EnvironmentProps): react_jsx_runtime.JSX.Element;
|
|
1823
1851
|
|
|
1852
|
+
/**
|
|
1853
|
+
* Moves every trace of interactivity from one object to its replacement, for reconstruction.
|
|
1854
|
+
*
|
|
1855
|
+
* When `args` or a `primitive`'s `object` changes, R3F builds a new three object and keeps the same
|
|
1856
|
+
* instance. Removing the old object from the interaction state and registering the new one from
|
|
1857
|
+
* scratch makes events *work* again (#3778), but it forgets what was in flight: a pointer resting on
|
|
1858
|
+
* the object fires a second `onPointerEnter` without ever having left, and an active pointer capture
|
|
1859
|
+
* is dropped mid-drag. Rewriting the references instead keeps the interaction continuous across a
|
|
1860
|
+
* swap the user never asked to see (#3744).
|
|
1861
|
+
*
|
|
1862
|
+
* Captures are re-keyed rather than released, so the DOM-level capture on `captureData.target` is
|
|
1863
|
+
* left alone — releasing and re-acquiring it is precisely the glitch being avoided.
|
|
1864
|
+
*
|
|
1865
|
+
* Visibility handlers are deliberately not transferred: that registry is keyed by `object.uuid`, so
|
|
1866
|
+
* the replacement re-registers itself through `applyProps`. The old entry is dropped here so it
|
|
1867
|
+
* cannot outlive the object it described.
|
|
1868
|
+
*/
|
|
1869
|
+
declare function swapInteractivity(store: RootStore, object: Object3D, newObject: Object3D): void;
|
|
1824
1870
|
declare function removeInteractivity(store: RootStore, object: Object3D): void;
|
|
1825
1871
|
declare function createEvents(store: RootStore): {
|
|
1826
1872
|
handlePointer: (name: string) => (event: DomEvent) => void;
|
|
@@ -1861,7 +1907,7 @@ declare namespace useLoader {
|
|
|
1861
1907
|
*
|
|
1862
1908
|
* @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
|
|
1863
1909
|
* @param priorityOrOptions - Either a priority number (backwards compat) or options object
|
|
1864
|
-
* @returns Controls object with step(), stepAll(), pause(), resume(), isPaused, id, scheduler
|
|
1910
|
+
* @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
|
|
1865
1911
|
*
|
|
1866
1912
|
* @example
|
|
1867
1913
|
* // Simple priority (backwards compat)
|
|
@@ -2157,7 +2203,10 @@ declare function addTail(callback: GlobalRenderCallback): () => void;
|
|
|
2157
2203
|
* Invalidates the view, requesting a frame to be rendered.
|
|
2158
2204
|
* In demand mode, this triggers the scheduler to run frames.
|
|
2159
2205
|
*
|
|
2160
|
-
*
|
|
2206
|
+
* With a state argument, only that root's jobs run on the requested frames; other
|
|
2207
|
+
* roots on 'demand' stay idle. Without one, every registered root is invalidated.
|
|
2208
|
+
*
|
|
2209
|
+
* @param state - Optional root state; targets the invalidation at that root
|
|
2161
2210
|
* @param frames - Number of frames to request (default: 1)
|
|
2162
2211
|
* @param stackFrames - If false, sets pendingFrames to frames. If true, adds to existing pendingFrames (default: false)
|
|
2163
2212
|
*
|
|
@@ -2168,14 +2217,16 @@ declare function invalidate(state?: RootState, frames?: number, stackFrames?: bo
|
|
|
2168
2217
|
* Advances the frameloop and runs render effects.
|
|
2169
2218
|
* Useful for when manually rendering via `frameloop="never"`.
|
|
2170
2219
|
*
|
|
2220
|
+
* With a state argument, only that root is stepped. Without one, every
|
|
2221
|
+
* registered root is stepped for backwards compatibility.
|
|
2222
|
+
*
|
|
2171
2223
|
* @param timestamp - The timestamp to use for this frame
|
|
2172
2224
|
* @param runGlobalEffects - Ignored (kept for backwards compat, global effects always run)
|
|
2173
|
-
* @param state -
|
|
2174
|
-
* @param frame - Ignored (kept for backwards compat)
|
|
2225
|
+
* @param state - Optional root state; targets the manual step at that root
|
|
2175
2226
|
*
|
|
2176
2227
|
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
|
|
2177
2228
|
*/
|
|
2178
|
-
declare function advance(timestamp: number): void;
|
|
2229
|
+
declare function advance(timestamp: number, runGlobalEffects?: boolean, state?: RootState): void;
|
|
2179
2230
|
|
|
2180
2231
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2181
2232
|
declare function ReactReconciler<
|
|
@@ -3246,11 +3297,6 @@ declare function flushSync<R>(fn: () => R): R;
|
|
|
3246
3297
|
declare const context: React$1.Context<RootStore>;
|
|
3247
3298
|
declare const createStore: (invalidate: (state?: RootState, frames?: number, stackFrames?: boolean) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState, frame?: XRFrame) => void) => RootStore;
|
|
3248
3299
|
|
|
3249
|
-
/**
|
|
3250
|
-
* Safely flush async effects when testing, simulating a legacy root.
|
|
3251
|
-
* @deprecated Import from React instead. import { act } from 'react'
|
|
3252
|
-
*/
|
|
3253
|
-
declare const act: typeof React$1.act;
|
|
3254
3300
|
/**
|
|
3255
3301
|
* An SSR-friendly useLayoutEffect.
|
|
3256
3302
|
*
|
|
@@ -3734,5 +3780,5 @@ declare function isOnce(value: unknown): value is {
|
|
|
3734
3780
|
*/
|
|
3735
3781
|
declare function Canvas(props: CanvasProps): react_jsx_runtime.JSX.Element;
|
|
3736
3782
|
|
|
3737
|
-
export { Block, Canvas, Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal, ErrorBoundary, FROM_REF, IsObject, ONCE, Portal, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, REACT_INTERNAL_PROPS, RESERVED_PROPS, three_d as ReactThreeFiber, Texture, _roots,
|
|
3783
|
+
export { Block, Canvas, Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal, ErrorBoundary, FROM_REF, IsObject, ONCE, Portal, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, REACT_INTERNAL_PROPS, RESERVED_PROPS, three_d as ReactThreeFiber, Texture, _roots, addAfterEffect, addEffect, addTail, advance, applyProps, attach, buildGraph, calculateDpr, context, createEvents, createPointerEvents, createPortal, createRoot, createStore, detach, diffProps, dispose, createPointerEvents as events, extend, findInitialRoot, flushSync, fromRef, getInstanceProps, getPrimary, getPrimaryIds, getRootState, getUuidPrefix, hasConstructor, hasPrimary, invalidate, invalidateInstance, is, isColorRepresentation, isCopyable, isFromRef, isObject3D, isOnce, isOrthographicCamera, isRef, isRenderer, isTexture, isVectorLike, once, prepare, presetsObj, reconciler, registerPrimary, removeInteractivity, resolve, swapInteractivity, unmountComponentAtNode, unregisterPrimary, updateCamera, updateFrustum, useBridge, useEnvironment, useFrame, useGraph, useInstanceHandle, useIsomorphicLayoutEffect, useLoader, useMutableCallback, useRenderTarget, useStore, useTexture, useTextures, useThree, waitForPrimary };
|
|
3738
3784
|
export type { Act, Args, ArgsProp, AttachFnType, AttachType, BackgroundConfig, BackgroundProp, BaseRendererProps, Bridge, BufferLike, BufferRecord, BufferStore, Camera, CameraProps, CanvasProps, CanvasSchedulerConfig, Catalogue, Color, ColorManagementConfig, ComputeFunction, ConstructorRepresentation, DefaultGLProps, DefaultRendererProps, Disposable, DisposeOptions, DomEvent, Dpr, ElementProps, EnvironmentLoaderProps, EnvironmentProps, EquConfig, Euler, EventHandlers, EventManager, EventProps, Events, Extensions, FiberRoot, FilterFunction, FrameCallback, FrameNextCallback, FrameNextState, FrameState, Frameloop, GLProps, GLTFLike, GeometryProps, GeometryTransformProps, GlobalEffectType, GlobalRenderCallback, HostConfig, InferLoadResult, InjectState, InputLike, Instance, InstanceProps, InternalState, Intersection, IntersectionEvent, IsAllOptional, IsOptional, Layers, LegacyInternalState, LegacyRenderer, LegacyRootState, LoaderInstance, LoaderLike, LoaderResult, MappedTextureType, MathProps, MathRepresentation, MathType, MathTypes, Matrix3, Matrix4, Mutable, MutableOrReadonlyParameters, NodeProps, NonFunctionKeys, ObjectMap, OffscreenCanvas$1 as OffscreenCanvas, Overwrite, Performance, PointerCaptureTarget, PointerState, PresetsType, PrimaryCanvasEntry, Properties, Quaternion, R3FRenderer, RaycastableRepresentation, ReactProps, ReconcilerRoot, RenderCallback, RenderProps, RenderTargetOptions, Renderer, RendererConfigExtended, RendererFactory, RendererProps, Root, RootState, RootStore, SetBlock, Size, StorageLike, StorageRecord, StorageStore, Subscription, TSLNodeInput, TextureInput, TextureResult, ThreeCamera, ThreeElement, ThreeElements, ThreeElementsImpl, ThreeEvent, ThreeExports, ThreeToJSXElements, UnblockProps, UseTextureOptions, UseTexturesReturn, Vector2, Vector3, Vector4, VectorRepresentation, Viewport, VisibilityEntry, WebGLDefaultProps, WebGLProps, WebGLShadowConfig, XRManager, XRPointerConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as three_examples_jsm_inspector_Inspector_js from 'three/examples/jsm/inspector/Inspector.js';
|
|
1
2
|
import * as three_webgpu from 'three/webgpu';
|
|
2
3
|
import { CubeRenderTarget, RenderTarget, WebGPURenderer, Node, StorageTexture, Data3DTexture, CanvasTarget, ShaderNodeObject, Euler as Euler$2, Color as Color$2, ColorRepresentation as ColorRepresentation$1, Layers as Layers$1, Raycaster, Intersection as Intersection$1, BufferGeometry, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, Vector2 as Vector2$1, Vector3 as Vector3$1, Vector4 as Vector4$1, Matrix3 as Matrix3$1, Loader as Loader$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D, Frustum, OrthographicCamera } from 'three/webgpu';
|
|
3
4
|
import * as THREE$1 from 'three';
|
|
@@ -12,7 +13,6 @@ import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi, UseFr
|
|
|
12
13
|
export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
|
|
13
14
|
import { Options } from 'react-use-measure';
|
|
14
15
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
15
|
-
import { ThreeElement as ThreeElement$1, Euler as Euler$3 } from '@react-three/fiber';
|
|
16
16
|
import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
|
|
17
17
|
|
|
18
18
|
function _mergeNamespaces(n, m) {
|
|
@@ -48,6 +48,9 @@ function _mergeNamespaces(n, m) {
|
|
|
48
48
|
declare const R3F_BUILD_LEGACY = true;
|
|
49
49
|
declare const R3F_BUILD_WEBGPU = true;
|
|
50
50
|
|
|
51
|
+
/** Lazily load the three Inspector. Keeps it out of the eager module graph — see note above. */
|
|
52
|
+
declare function loadInspector(): Promise<typeof three_examples_jsm_inspector_Inspector_js.Inspector>;
|
|
53
|
+
|
|
51
54
|
var THREE = /*#__PURE__*/_mergeNamespaces({
|
|
52
55
|
__proto__: null,
|
|
53
56
|
CubeRenderTarget: CubeRenderTarget,
|
|
@@ -59,7 +62,8 @@ var THREE = /*#__PURE__*/_mergeNamespaces({
|
|
|
59
62
|
WebGLCubeRenderTarget: WebGLCubeRenderTarget,
|
|
60
63
|
WebGLRenderTarget: WebGLRenderTarget,
|
|
61
64
|
WebGLRenderer: WebGLRenderer,
|
|
62
|
-
WebGLRendererParameters: WebGLRendererParameters
|
|
65
|
+
WebGLRendererParameters: WebGLRendererParameters,
|
|
66
|
+
loadInspector: loadInspector
|
|
63
67
|
}, [three_webgpu]);
|
|
64
68
|
|
|
65
69
|
//* Utility Types ==============================
|
|
@@ -497,6 +501,18 @@ interface InternalState {
|
|
|
497
501
|
* @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
|
|
498
502
|
*/
|
|
499
503
|
canvasTarget?: CanvasTarget
|
|
504
|
+
/**
|
|
505
|
+
* Set when this root's canvas target has been resized and the backend's cached render pass
|
|
506
|
+
* descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
|
|
507
|
+
*
|
|
508
|
+
* Flushed by the canvas-target job in the `start` phase, which is the only place this root's
|
|
509
|
+
* target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
|
|
510
|
+
* whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
|
|
511
|
+
* invalidate some other canvas's descriptor instead.
|
|
512
|
+
*
|
|
513
|
+
* @see https://github.com/pmndrs/react-three-fiber/issues/3847
|
|
514
|
+
*/
|
|
515
|
+
canvasTargetSizeDirty?: boolean
|
|
500
516
|
/**
|
|
501
517
|
* Whether multi-canvas rendering is active.
|
|
502
518
|
* True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
|
|
@@ -706,12 +722,19 @@ type DefaultRendererProps = {
|
|
|
706
722
|
*/
|
|
707
723
|
interface CanvasSchedulerConfig {
|
|
708
724
|
/**
|
|
709
|
-
*
|
|
710
|
-
* Pass the `id` of another canvas.
|
|
725
|
+
* Run this Canvas root before the referenced Canvas root id(s).
|
|
711
726
|
*/
|
|
712
|
-
|
|
727
|
+
before?: string | string[]
|
|
713
728
|
/**
|
|
714
|
-
*
|
|
729
|
+
* Run this Canvas root after the referenced Canvas root id(s).
|
|
730
|
+
*/
|
|
731
|
+
after?: string | string[]
|
|
732
|
+
/**
|
|
733
|
+
* Numeric root order. Lower values run first.
|
|
734
|
+
*/
|
|
735
|
+
order?: number
|
|
736
|
+
/**
|
|
737
|
+
* Limit this Canvas's default render job (frames per second).
|
|
715
738
|
*/
|
|
716
739
|
fps?: number
|
|
717
740
|
}
|
|
@@ -1315,11 +1338,16 @@ declare global {
|
|
|
1315
1338
|
/** Pass record - stores TSL pass nodes for render pipeline */
|
|
1316
1339
|
type PassRecord = Record<string, any>
|
|
1317
1340
|
|
|
1341
|
+
/** State passed to pipeline callbacks after the active pipeline has been created */
|
|
1342
|
+
type RenderPipelineCallbackState = RootState & {
|
|
1343
|
+
renderPipeline: ThreeRenderPipeline
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1318
1346
|
/** Setup callback - runs first to configure MRT, create additional passes */
|
|
1319
|
-
type RenderPipelineSetupCallback = (state:
|
|
1347
|
+
type RenderPipelineSetupCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1320
1348
|
|
|
1321
1349
|
/** Main callback - runs second to configure outputNode, create effect passes */
|
|
1322
|
-
type RenderPipelineMainCallback = (state:
|
|
1350
|
+
type RenderPipelineMainCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1323
1351
|
|
|
1324
1352
|
/** Return type for useRenderPipeline hook */
|
|
1325
1353
|
interface UseRenderPipelineReturn {
|
|
@@ -1635,9 +1663,9 @@ type EnvironmentProps = {
|
|
|
1635
1663
|
blur?: number;
|
|
1636
1664
|
backgroundBlurriness?: number;
|
|
1637
1665
|
backgroundIntensity?: number;
|
|
1638
|
-
backgroundRotation?: Euler
|
|
1666
|
+
backgroundRotation?: Euler;
|
|
1639
1667
|
environmentIntensity?: number;
|
|
1640
|
-
environmentRotation?: Euler
|
|
1668
|
+
environmentRotation?: Euler;
|
|
1641
1669
|
map?: Texture$1;
|
|
1642
1670
|
preset?: PresetsType;
|
|
1643
1671
|
scene?: Scene | React$1.RefObject<Scene>;
|
|
@@ -1721,7 +1749,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
|
|
|
1721
1749
|
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;
|
|
1722
1750
|
declare module '@react-three/fiber' {
|
|
1723
1751
|
interface ThreeElements {
|
|
1724
|
-
groundProjectedEnvImpl: ThreeElement
|
|
1752
|
+
groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
|
|
1725
1753
|
}
|
|
1726
1754
|
}
|
|
1727
1755
|
/**
|
|
@@ -1821,6 +1849,24 @@ declare module '@react-three/fiber' {
|
|
|
1821
1849
|
*/
|
|
1822
1850
|
declare function Environment(props: EnvironmentProps): react_jsx_runtime.JSX.Element;
|
|
1823
1851
|
|
|
1852
|
+
/**
|
|
1853
|
+
* Moves every trace of interactivity from one object to its replacement, for reconstruction.
|
|
1854
|
+
*
|
|
1855
|
+
* When `args` or a `primitive`'s `object` changes, R3F builds a new three object and keeps the same
|
|
1856
|
+
* instance. Removing the old object from the interaction state and registering the new one from
|
|
1857
|
+
* scratch makes events *work* again (#3778), but it forgets what was in flight: a pointer resting on
|
|
1858
|
+
* the object fires a second `onPointerEnter` without ever having left, and an active pointer capture
|
|
1859
|
+
* is dropped mid-drag. Rewriting the references instead keeps the interaction continuous across a
|
|
1860
|
+
* swap the user never asked to see (#3744).
|
|
1861
|
+
*
|
|
1862
|
+
* Captures are re-keyed rather than released, so the DOM-level capture on `captureData.target` is
|
|
1863
|
+
* left alone — releasing and re-acquiring it is precisely the glitch being avoided.
|
|
1864
|
+
*
|
|
1865
|
+
* Visibility handlers are deliberately not transferred: that registry is keyed by `object.uuid`, so
|
|
1866
|
+
* the replacement re-registers itself through `applyProps`. The old entry is dropped here so it
|
|
1867
|
+
* cannot outlive the object it described.
|
|
1868
|
+
*/
|
|
1869
|
+
declare function swapInteractivity(store: RootStore, object: Object3D, newObject: Object3D): void;
|
|
1824
1870
|
declare function removeInteractivity(store: RootStore, object: Object3D): void;
|
|
1825
1871
|
declare function createEvents(store: RootStore): {
|
|
1826
1872
|
handlePointer: (name: string) => (event: DomEvent) => void;
|
|
@@ -1861,7 +1907,7 @@ declare namespace useLoader {
|
|
|
1861
1907
|
*
|
|
1862
1908
|
* @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
|
|
1863
1909
|
* @param priorityOrOptions - Either a priority number (backwards compat) or options object
|
|
1864
|
-
* @returns Controls object with step(), stepAll(), pause(), resume(), isPaused, id, scheduler
|
|
1910
|
+
* @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
|
|
1865
1911
|
*
|
|
1866
1912
|
* @example
|
|
1867
1913
|
* // Simple priority (backwards compat)
|
|
@@ -2157,7 +2203,10 @@ declare function addTail(callback: GlobalRenderCallback): () => void;
|
|
|
2157
2203
|
* Invalidates the view, requesting a frame to be rendered.
|
|
2158
2204
|
* In demand mode, this triggers the scheduler to run frames.
|
|
2159
2205
|
*
|
|
2160
|
-
*
|
|
2206
|
+
* With a state argument, only that root's jobs run on the requested frames; other
|
|
2207
|
+
* roots on 'demand' stay idle. Without one, every registered root is invalidated.
|
|
2208
|
+
*
|
|
2209
|
+
* @param state - Optional root state; targets the invalidation at that root
|
|
2161
2210
|
* @param frames - Number of frames to request (default: 1)
|
|
2162
2211
|
* @param stackFrames - If false, sets pendingFrames to frames. If true, adds to existing pendingFrames (default: false)
|
|
2163
2212
|
*
|
|
@@ -2168,14 +2217,16 @@ declare function invalidate(state?: RootState, frames?: number, stackFrames?: bo
|
|
|
2168
2217
|
* Advances the frameloop and runs render effects.
|
|
2169
2218
|
* Useful for when manually rendering via `frameloop="never"`.
|
|
2170
2219
|
*
|
|
2220
|
+
* With a state argument, only that root is stepped. Without one, every
|
|
2221
|
+
* registered root is stepped for backwards compatibility.
|
|
2222
|
+
*
|
|
2171
2223
|
* @param timestamp - The timestamp to use for this frame
|
|
2172
2224
|
* @param runGlobalEffects - Ignored (kept for backwards compat, global effects always run)
|
|
2173
|
-
* @param state -
|
|
2174
|
-
* @param frame - Ignored (kept for backwards compat)
|
|
2225
|
+
* @param state - Optional root state; targets the manual step at that root
|
|
2175
2226
|
*
|
|
2176
2227
|
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
|
|
2177
2228
|
*/
|
|
2178
|
-
declare function advance(timestamp: number): void;
|
|
2229
|
+
declare function advance(timestamp: number, runGlobalEffects?: boolean, state?: RootState): void;
|
|
2179
2230
|
|
|
2180
2231
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2181
2232
|
declare function ReactReconciler<
|
|
@@ -3246,11 +3297,6 @@ declare function flushSync<R>(fn: () => R): R;
|
|
|
3246
3297
|
declare const context: React$1.Context<RootStore>;
|
|
3247
3298
|
declare const createStore: (invalidate: (state?: RootState, frames?: number, stackFrames?: boolean) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState, frame?: XRFrame) => void) => RootStore;
|
|
3248
3299
|
|
|
3249
|
-
/**
|
|
3250
|
-
* Safely flush async effects when testing, simulating a legacy root.
|
|
3251
|
-
* @deprecated Import from React instead. import { act } from 'react'
|
|
3252
|
-
*/
|
|
3253
|
-
declare const act: typeof React$1.act;
|
|
3254
3300
|
/**
|
|
3255
3301
|
* An SSR-friendly useLayoutEffect.
|
|
3256
3302
|
*
|
|
@@ -3734,5 +3780,5 @@ declare function isOnce(value: unknown): value is {
|
|
|
3734
3780
|
*/
|
|
3735
3781
|
declare function Canvas(props: CanvasProps): react_jsx_runtime.JSX.Element;
|
|
3736
3782
|
|
|
3737
|
-
export { Block, Canvas, Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal, ErrorBoundary, FROM_REF, IsObject, ONCE, Portal, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, REACT_INTERNAL_PROPS, RESERVED_PROPS, three_d as ReactThreeFiber, Texture, _roots,
|
|
3783
|
+
export { Block, Canvas, Environment, EnvironmentCube, EnvironmentMap, EnvironmentPortal, ErrorBoundary, FROM_REF, IsObject, ONCE, Portal, R3F_BUILD_LEGACY, R3F_BUILD_WEBGPU, REACT_INTERNAL_PROPS, RESERVED_PROPS, three_d as ReactThreeFiber, Texture, _roots, addAfterEffect, addEffect, addTail, advance, applyProps, attach, buildGraph, calculateDpr, context, createEvents, createPointerEvents, createPortal, createRoot, createStore, detach, diffProps, dispose, createPointerEvents as events, extend, findInitialRoot, flushSync, fromRef, getInstanceProps, getPrimary, getPrimaryIds, getRootState, getUuidPrefix, hasConstructor, hasPrimary, invalidate, invalidateInstance, is, isColorRepresentation, isCopyable, isFromRef, isObject3D, isOnce, isOrthographicCamera, isRef, isRenderer, isTexture, isVectorLike, once, prepare, presetsObj, reconciler, registerPrimary, removeInteractivity, resolve, swapInteractivity, unmountComponentAtNode, unregisterPrimary, updateCamera, updateFrustum, useBridge, useEnvironment, useFrame, useGraph, useInstanceHandle, useIsomorphicLayoutEffect, useLoader, useMutableCallback, useRenderTarget, useStore, useTexture, useTextures, useThree, waitForPrimary };
|
|
3738
3784
|
export type { Act, Args, ArgsProp, AttachFnType, AttachType, BackgroundConfig, BackgroundProp, BaseRendererProps, Bridge, BufferLike, BufferRecord, BufferStore, Camera, CameraProps, CanvasProps, CanvasSchedulerConfig, Catalogue, Color, ColorManagementConfig, ComputeFunction, ConstructorRepresentation, DefaultGLProps, DefaultRendererProps, Disposable, DisposeOptions, DomEvent, Dpr, ElementProps, EnvironmentLoaderProps, EnvironmentProps, EquConfig, Euler, EventHandlers, EventManager, EventProps, Events, Extensions, FiberRoot, FilterFunction, FrameCallback, FrameNextCallback, FrameNextState, FrameState, Frameloop, GLProps, GLTFLike, GeometryProps, GeometryTransformProps, GlobalEffectType, GlobalRenderCallback, HostConfig, InferLoadResult, InjectState, InputLike, Instance, InstanceProps, InternalState, Intersection, IntersectionEvent, IsAllOptional, IsOptional, Layers, LegacyInternalState, LegacyRenderer, LegacyRootState, LoaderInstance, LoaderLike, LoaderResult, MappedTextureType, MathProps, MathRepresentation, MathType, MathTypes, Matrix3, Matrix4, Mutable, MutableOrReadonlyParameters, NodeProps, NonFunctionKeys, ObjectMap, OffscreenCanvas$1 as OffscreenCanvas, Overwrite, Performance, PointerCaptureTarget, PointerState, PresetsType, PrimaryCanvasEntry, Properties, Quaternion, R3FRenderer, RaycastableRepresentation, ReactProps, ReconcilerRoot, RenderCallback, RenderProps, RenderTargetOptions, Renderer, RendererConfigExtended, RendererFactory, RendererProps, Root, RootState, RootStore, SetBlock, Size, StorageLike, StorageRecord, StorageStore, Subscription, TSLNodeInput, TextureInput, TextureResult, ThreeCamera, ThreeElement, ThreeElements, ThreeElementsImpl, ThreeEvent, ThreeExports, ThreeToJSXElements, UnblockProps, UseTextureOptions, UseTexturesReturn, Vector2, Vector3, Vector4, VectorRepresentation, Viewport, VisibilityEntry, WebGLDefaultProps, WebGLProps, WebGLShadowConfig, XRManager, XRPointerConfig };
|