@react-three/fiber 10.0.0-canary.4a21acb → 10.0.0-canary.4f316e6
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 +2617 -2423
- package/dist/index.d.cts +202 -36
- package/dist/index.d.mts +202 -36
- package/dist/index.d.ts +202 -36
- package/dist/index.mjs +2619 -2425
- package/dist/legacy.cjs +2610 -2420
- package/dist/legacy.d.cts +201 -39
- package/dist/legacy.d.mts +201 -39
- package/dist/legacy.d.ts +201 -39
- package/dist/legacy.mjs +2612 -2422
- package/dist/webgpu/index.cjs +2663 -2443
- package/dist/webgpu/index.d.cts +226 -100
- package/dist/webgpu/index.d.mts +226 -100
- package/dist/webgpu/index.d.ts +226 -100
- package/dist/webgpu/index.mjs +2667 -2447
- 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 ==============================
|
|
@@ -359,6 +363,33 @@ type BufferRecord = Record<string, BufferLike>
|
|
|
359
363
|
*/
|
|
360
364
|
type BufferStore = Record<string, BufferLike | BufferRecord>
|
|
361
365
|
|
|
366
|
+
//* Node Types (useNodes) ========================================
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Structural shape of a TSL node as stored on `state.nodes`.
|
|
370
|
+
*
|
|
371
|
+
* Deliberately minimal rather than three's nominal `Node`: in @types/three several node classes
|
|
372
|
+
* TSL hands back (OperatorNode, ConstNode, ...) do not extend `Node` cleanly, so a `Node` bound
|
|
373
|
+
* would reject values `useNodes` creators legitimately return. This is the same shape
|
|
374
|
+
* `useNodes` already constrains creators to (`TSLNodeLike`).
|
|
375
|
+
*/
|
|
376
|
+
interface NodeLike {
|
|
377
|
+
uuid?: string
|
|
378
|
+
nodeType?: string | null
|
|
379
|
+
/** label method for chaining - sets the node's label and returns self */
|
|
380
|
+
label?: ((label: string) => NodeLike) | string
|
|
381
|
+
setName?: (name: string) => this
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/** Flat record of TSL nodes (no nested scopes) */
|
|
385
|
+
type NodeRecord = Record<string, NodeLike>
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* Node store that can contain both root-level nodes and scoped node objects.
|
|
389
|
+
* Structure: { wobble: OperatorNode, fx: { blur: ShaderCallable } }
|
|
390
|
+
*/
|
|
391
|
+
type NodeStore = Record<string, NodeLike | NodeRecord>
|
|
392
|
+
|
|
362
393
|
//* Storage Types (useGPUStorage) ========================================
|
|
363
394
|
|
|
364
395
|
/**
|
|
@@ -492,11 +523,28 @@ interface InternalState {
|
|
|
492
523
|
/** Container for child attachment (scene for root, original container for portals) */
|
|
493
524
|
container?: THREE$1.Object3D
|
|
494
525
|
/**
|
|
495
|
-
* CanvasTarget
|
|
496
|
-
*
|
|
526
|
+
* The CanvasTarget this root sizes and renders through.
|
|
527
|
+
*
|
|
528
|
+
* A primary (`<Canvas id>`) owns the renderer's default target -- the one three itself built
|
|
529
|
+
* around the canvas element -- so sizing it is sizing the renderer. A secondary owns a target
|
|
530
|
+
* R3F created for its own element. Either way there is exactly one target per canvas element,
|
|
531
|
+
* and the canvas-target job makes it the renderer's active one before this root renders.
|
|
532
|
+
* Absent on WebGL and on an id-less WebGPU canvas, where the renderer is sized directly.
|
|
497
533
|
* @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
|
|
498
534
|
*/
|
|
499
535
|
canvasTarget?: CanvasTarget
|
|
536
|
+
/**
|
|
537
|
+
* Set when this root's canvas target has been resized and the backend's cached render pass
|
|
538
|
+
* descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
|
|
539
|
+
*
|
|
540
|
+
* Flushed by the canvas-target job in the `start` phase, which is the only place this root's
|
|
541
|
+
* target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
|
|
542
|
+
* whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
|
|
543
|
+
* invalidate some other canvas's descriptor instead.
|
|
544
|
+
*
|
|
545
|
+
* @see https://github.com/pmndrs/react-three-fiber/issues/3847
|
|
546
|
+
*/
|
|
547
|
+
canvasTargetSizeDirty?: boolean
|
|
500
548
|
/**
|
|
501
549
|
* Whether multi-canvas rendering is active.
|
|
502
550
|
* True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
|
|
@@ -606,7 +654,7 @@ interface RootState {
|
|
|
606
654
|
/** Global TSL uniform nodes - root-level uniforms + scoped sub-objects. Use useUniforms() hook */
|
|
607
655
|
uniforms: UniformStore
|
|
608
656
|
/** Global TSL nodes - root-level nodes + scoped sub-objects. Use useNodes() hook */
|
|
609
|
-
nodes:
|
|
657
|
+
nodes: NodeStore
|
|
610
658
|
/** Global TSL buffer nodes - root-level buffers + scoped sub-objects. Use useBuffers() hook */
|
|
611
659
|
buffers: BufferStore
|
|
612
660
|
/** Global GPU storage (textures, etc.) - root-level storage + scoped sub-objects. Use useGPUStorage() hook */
|
|
@@ -618,7 +666,7 @@ interface RootState {
|
|
|
618
666
|
/** WebGPU RenderPipeline instance - use useRenderPipeline() hook */
|
|
619
667
|
renderPipeline: ThreeRenderPipeline | null
|
|
620
668
|
/** Global TSL pass nodes for render pipeline - use useRenderPipeline() hook */
|
|
621
|
-
passes:
|
|
669
|
+
passes: PassRecord
|
|
622
670
|
/** Internal version counter for HMR - incremented by rebuildNodes/rebuildUniforms to bust memoization */
|
|
623
671
|
_hmrVersion: number
|
|
624
672
|
/** Internal: whether setSize() has taken ownership of canvas dimensions */
|
|
@@ -706,12 +754,19 @@ type DefaultRendererProps = {
|
|
|
706
754
|
*/
|
|
707
755
|
interface CanvasSchedulerConfig {
|
|
708
756
|
/**
|
|
709
|
-
*
|
|
710
|
-
|
|
757
|
+
* Run this Canvas root before the referenced Canvas root id(s).
|
|
758
|
+
*/
|
|
759
|
+
before?: string | string[]
|
|
760
|
+
/**
|
|
761
|
+
* Run this Canvas root after the referenced Canvas root id(s).
|
|
711
762
|
*/
|
|
712
|
-
after?: string
|
|
763
|
+
after?: string | string[]
|
|
713
764
|
/**
|
|
714
|
-
*
|
|
765
|
+
* Numeric root order. Lower values run first.
|
|
766
|
+
*/
|
|
767
|
+
order?: number
|
|
768
|
+
/**
|
|
769
|
+
* Limit this Canvas's default render job (frames per second).
|
|
715
770
|
*/
|
|
716
771
|
fps?: number
|
|
717
772
|
}
|
|
@@ -1159,7 +1214,33 @@ declare global {
|
|
|
1159
1214
|
* ergonomics. The result is three's structural type, so members stay in sync with the
|
|
1160
1215
|
* installed three instead of needing to be mirrored by hand.
|
|
1161
1216
|
*/
|
|
1162
|
-
type UniformNode<T = unknown> = three_webgpu.UniformNode<
|
|
1217
|
+
type UniformNode<T = unknown> = three_webgpu.UniformNode<UniformNodeTypeFor<T>, T>
|
|
1218
|
+
|
|
1219
|
+
/**
|
|
1220
|
+
* three's node type name for a uniform value type, mirroring the `uniform()` overloads.
|
|
1221
|
+
* A `UniformNode<number>` is a `Node<'float'>`, so TSL math (`.mul`, `.add`, ...) accepts it.
|
|
1222
|
+
* Unknown or unlisted value types resolve to `unknown`, which TSL math rejects: narrow with
|
|
1223
|
+
* `as UniformNode<number>` (or the matching value type) at the call site.
|
|
1224
|
+
*/
|
|
1225
|
+
type UniformNodeTypeFor<T> = T extends number
|
|
1226
|
+
? 'float'
|
|
1227
|
+
: T extends boolean
|
|
1228
|
+
? 'bool'
|
|
1229
|
+
: T extends three_webgpu.Color
|
|
1230
|
+
? 'color'
|
|
1231
|
+
: T extends three_webgpu.Vector2
|
|
1232
|
+
? 'vec2'
|
|
1233
|
+
: T extends three_webgpu.Vector3
|
|
1234
|
+
? 'vec3'
|
|
1235
|
+
: T extends three_webgpu.Vector4
|
|
1236
|
+
? 'vec4'
|
|
1237
|
+
: T extends three_webgpu.Matrix2
|
|
1238
|
+
? 'mat2'
|
|
1239
|
+
: T extends three_webgpu.Matrix3
|
|
1240
|
+
? 'mat3'
|
|
1241
|
+
: T extends three_webgpu.Matrix4
|
|
1242
|
+
? 'mat4'
|
|
1243
|
+
: unknown
|
|
1163
1244
|
|
|
1164
1245
|
/**
|
|
1165
1246
|
* ShaderCallable - the return type of Fn()
|
|
@@ -1312,30 +1393,97 @@ declare global {
|
|
|
1312
1393
|
*/
|
|
1313
1394
|
type ThreeRenderPipeline = three_webgpu.RenderPipeline
|
|
1314
1395
|
|
|
1315
|
-
/**
|
|
1316
|
-
|
|
1396
|
+
/**
|
|
1397
|
+
* The pass `useRenderPipeline` creates for you: three's own `PassNode`, as returned by
|
|
1398
|
+
* `pass(scene, camera)` from `three/tsl`. Referenced from three so members like
|
|
1399
|
+
* `getTextureNode`, `setMRT` and `dispose` track the installed version.
|
|
1400
|
+
*/
|
|
1401
|
+
type ScenePassNode = three_webgpu.PassNode
|
|
1402
|
+
|
|
1403
|
+
/**
|
|
1404
|
+
* Pass record - stores TSL pass nodes for render pipeline.
|
|
1405
|
+
*
|
|
1406
|
+
* `scenePass` is the only key the library owns. It is optional here because this is also the
|
|
1407
|
+
* shape of `state.passes`, which is `{}` before the pipeline exists and again after `reset()`
|
|
1408
|
+
* or `clearPasses()`. Inside the callbacks it is always present; see
|
|
1409
|
+
* {@link RenderPipelineCallbackState}.
|
|
1410
|
+
*
|
|
1411
|
+
* Every other key is user-registered, via a callback's return value. Those are TSL nodes of
|
|
1412
|
+
* any kind, not only passes: texture reads of an MRT attachment, effect nodes, extra
|
|
1413
|
+
* `pass()` instances. `Node` is the common base, so that is the bound. Narrow at the call
|
|
1414
|
+
* site when you need a member, e.g. `passes.velocity as TextureNode`.
|
|
1415
|
+
*/
|
|
1416
|
+
interface PassRecord {
|
|
1417
|
+
scenePass?: ScenePassNode
|
|
1418
|
+
[key: string]: three_webgpu.Node
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* State passed to pipeline callbacks after the active pipeline has been created.
|
|
1423
|
+
*
|
|
1424
|
+
* `passes.scenePass` is required here: the hook installs the default scene pass before either
|
|
1425
|
+
* callback runs, so callbacks can use it without a guard or a cast.
|
|
1426
|
+
*
|
|
1427
|
+
* `renderer` is narrowed to `WebGPURenderer` and `isLegacy` to `false`: the hook throws under
|
|
1428
|
+
* the legacy renderer before either callback can run, so a callback never sees WebGL.
|
|
1429
|
+
*/
|
|
1430
|
+
type RenderPipelineCallbackState = RootState & {
|
|
1431
|
+
renderPipeline: ThreeRenderPipeline
|
|
1432
|
+
passes: PassRecord & { scenePass: ScenePassNode }
|
|
1433
|
+
renderer: three_webgpu.WebGPURenderer
|
|
1434
|
+
isLegacy: false
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* What a callback may return to register entries into `state.passes`.
|
|
1439
|
+
*
|
|
1440
|
+
* `scenePass` is reserved. The hook owns that entry and its lifecycle: it caches the pass it
|
|
1441
|
+
* created, and `rebuild()` / `reset()` dispose that cached pass. A callback overwriting the
|
|
1442
|
+
* store entry would leave the store pointing at a node the hook never disposes, and the hook
|
|
1443
|
+
* disposing a pass nothing references. So returning it is a type error.
|
|
1444
|
+
*/
|
|
1445
|
+
type RegisteredPasses = Record<string, three_webgpu.Node> & { scenePass?: never }
|
|
1317
1446
|
|
|
1318
1447
|
/** Setup callback - runs first to configure MRT, create additional passes */
|
|
1319
|
-
type RenderPipelineSetupCallback = (state:
|
|
1448
|
+
type RenderPipelineSetupCallback = (state: RenderPipelineCallbackState) => RegisteredPasses | void
|
|
1320
1449
|
|
|
1321
1450
|
/** Main callback - runs second to configure outputNode, create effect passes */
|
|
1322
|
-
type RenderPipelineMainCallback = (state:
|
|
1451
|
+
type RenderPipelineMainCallback = (state: RenderPipelineCallbackState) => RegisteredPasses | void
|
|
1323
1452
|
|
|
1324
|
-
/**
|
|
1325
|
-
interface
|
|
1453
|
+
/** The imperative half of useRenderPipeline's return value, present in every state */
|
|
1454
|
+
interface UseRenderPipelineActions {
|
|
1326
1455
|
/** Current passes from state */
|
|
1327
1456
|
passes: PassRecord
|
|
1328
|
-
/** RenderPipeline instance (null if not initialized) */
|
|
1329
|
-
renderPipeline: ThreeRenderPipeline | null
|
|
1330
1457
|
/** Clear all passes from state */
|
|
1331
1458
|
clearPasses: () => void
|
|
1332
1459
|
/** Reset RenderPipeline entirely (clears PP + passes) */
|
|
1333
1460
|
reset: () => void
|
|
1334
1461
|
/** Re-run setup/main callbacks with current closure values */
|
|
1335
1462
|
rebuild: () => void
|
|
1336
|
-
/** True when RenderPipeline is configured and ready */
|
|
1337
|
-
isReady: boolean
|
|
1338
1463
|
}
|
|
1464
|
+
|
|
1465
|
+
/**
|
|
1466
|
+
* Return type for useRenderPipeline hook, discriminated on `isReady`.
|
|
1467
|
+
*
|
|
1468
|
+
* `if (isReady)` narrows `renderPipeline` to non-null, which is what the docs already tell
|
|
1469
|
+
* callers to check. `passes.scenePass` deliberately stays optional in the ready branch:
|
|
1470
|
+
* `clearPasses()` empties the record while leaving the pipeline in place.
|
|
1471
|
+
*/
|
|
1472
|
+
type UseRenderPipelineReturn = UseRenderPipelineActions &
|
|
1473
|
+
(
|
|
1474
|
+
| {
|
|
1475
|
+
/** True when RenderPipeline is configured and ready */
|
|
1476
|
+
isReady: true
|
|
1477
|
+
/** RenderPipeline instance */
|
|
1478
|
+
renderPipeline: ThreeRenderPipeline
|
|
1479
|
+
}
|
|
1480
|
+
| {
|
|
1481
|
+
/** False until the pipeline has been created */
|
|
1482
|
+
isReady: false
|
|
1483
|
+
/** Not initialized yet, or torn down by reset() */
|
|
1484
|
+
renderPipeline: null
|
|
1485
|
+
}
|
|
1486
|
+
)
|
|
1339
1487
|
}
|
|
1340
1488
|
|
|
1341
1489
|
type MutableOrReadonlyParameters<T extends (...args: any) => any> = Parameters<T> | Readonly<Parameters<T>>
|
|
@@ -1635,9 +1783,9 @@ type EnvironmentProps = {
|
|
|
1635
1783
|
blur?: number;
|
|
1636
1784
|
backgroundBlurriness?: number;
|
|
1637
1785
|
backgroundIntensity?: number;
|
|
1638
|
-
backgroundRotation?: Euler
|
|
1786
|
+
backgroundRotation?: Euler;
|
|
1639
1787
|
environmentIntensity?: number;
|
|
1640
|
-
environmentRotation?: Euler
|
|
1788
|
+
environmentRotation?: Euler;
|
|
1641
1789
|
map?: Texture$1;
|
|
1642
1790
|
preset?: PresetsType;
|
|
1643
1791
|
scene?: Scene | React$1.RefObject<Scene>;
|
|
@@ -1721,7 +1869,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
|
|
|
1721
1869
|
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
1870
|
declare module '@react-three/fiber' {
|
|
1723
1871
|
interface ThreeElements {
|
|
1724
|
-
groundProjectedEnvImpl: ThreeElement
|
|
1872
|
+
groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
|
|
1725
1873
|
}
|
|
1726
1874
|
}
|
|
1727
1875
|
/**
|
|
@@ -1821,6 +1969,24 @@ declare module '@react-three/fiber' {
|
|
|
1821
1969
|
*/
|
|
1822
1970
|
declare function Environment(props: EnvironmentProps): react_jsx_runtime.JSX.Element;
|
|
1823
1971
|
|
|
1972
|
+
/**
|
|
1973
|
+
* Moves every trace of interactivity from one object to its replacement, for reconstruction.
|
|
1974
|
+
*
|
|
1975
|
+
* When `args` or a `primitive`'s `object` changes, R3F builds a new three object and keeps the same
|
|
1976
|
+
* instance. Removing the old object from the interaction state and registering the new one from
|
|
1977
|
+
* scratch makes events *work* again (#3778), but it forgets what was in flight: a pointer resting on
|
|
1978
|
+
* the object fires a second `onPointerEnter` without ever having left, and an active pointer capture
|
|
1979
|
+
* is dropped mid-drag. Rewriting the references instead keeps the interaction continuous across a
|
|
1980
|
+
* swap the user never asked to see (#3744).
|
|
1981
|
+
*
|
|
1982
|
+
* Captures are re-keyed rather than released, so the DOM-level capture on `captureData.target` is
|
|
1983
|
+
* left alone — releasing and re-acquiring it is precisely the glitch being avoided.
|
|
1984
|
+
*
|
|
1985
|
+
* Visibility handlers are deliberately not transferred: that registry is keyed by `object.uuid`, so
|
|
1986
|
+
* the replacement re-registers itself through `applyProps`. The old entry is dropped here so it
|
|
1987
|
+
* cannot outlive the object it described.
|
|
1988
|
+
*/
|
|
1989
|
+
declare function swapInteractivity(store: RootStore, object: Object3D, newObject: Object3D): void;
|
|
1824
1990
|
declare function removeInteractivity(store: RootStore, object: Object3D): void;
|
|
1825
1991
|
declare function createEvents(store: RootStore): {
|
|
1826
1992
|
handlePointer: (name: string) => (event: DomEvent) => void;
|
|
@@ -1861,7 +2027,7 @@ declare namespace useLoader {
|
|
|
1861
2027
|
*
|
|
1862
2028
|
* @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
|
|
1863
2029
|
* @param priorityOrOptions - Either a priority number (backwards compat) or options object
|
|
1864
|
-
* @returns Controls object with step(), stepAll(), pause(), resume(), isPaused, id, scheduler
|
|
2030
|
+
* @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
|
|
1865
2031
|
*
|
|
1866
2032
|
* @example
|
|
1867
2033
|
* // Simple priority (backwards compat)
|
|
@@ -2157,7 +2323,10 @@ declare function addTail(callback: GlobalRenderCallback): () => void;
|
|
|
2157
2323
|
* Invalidates the view, requesting a frame to be rendered.
|
|
2158
2324
|
* In demand mode, this triggers the scheduler to run frames.
|
|
2159
2325
|
*
|
|
2160
|
-
*
|
|
2326
|
+
* With a state argument, only that root's jobs run on the requested frames; other
|
|
2327
|
+
* roots on 'demand' stay idle. Without one, every registered root is invalidated.
|
|
2328
|
+
*
|
|
2329
|
+
* @param state - Optional root state; targets the invalidation at that root
|
|
2161
2330
|
* @param frames - Number of frames to request (default: 1)
|
|
2162
2331
|
* @param stackFrames - If false, sets pendingFrames to frames. If true, adds to existing pendingFrames (default: false)
|
|
2163
2332
|
*
|
|
@@ -2168,14 +2337,16 @@ declare function invalidate(state?: RootState, frames?: number, stackFrames?: bo
|
|
|
2168
2337
|
* Advances the frameloop and runs render effects.
|
|
2169
2338
|
* Useful for when manually rendering via `frameloop="never"`.
|
|
2170
2339
|
*
|
|
2340
|
+
* With a state argument, only that root is stepped. Without one, every
|
|
2341
|
+
* registered root is stepped for backwards compatibility.
|
|
2342
|
+
*
|
|
2171
2343
|
* @param timestamp - The timestamp to use for this frame
|
|
2172
2344
|
* @param runGlobalEffects - Ignored (kept for backwards compat, global effects always run)
|
|
2173
|
-
* @param state -
|
|
2174
|
-
* @param frame - Ignored (kept for backwards compat)
|
|
2345
|
+
* @param state - Optional root state; targets the manual step at that root
|
|
2175
2346
|
*
|
|
2176
2347
|
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
|
|
2177
2348
|
*/
|
|
2178
|
-
declare function advance(timestamp: number): void;
|
|
2349
|
+
declare function advance(timestamp: number, runGlobalEffects?: boolean, state?: RootState): void;
|
|
2179
2350
|
|
|
2180
2351
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2181
2352
|
declare function ReactReconciler<
|
|
@@ -3246,11 +3417,6 @@ declare function flushSync<R>(fn: () => R): R;
|
|
|
3246
3417
|
declare const context: React$1.Context<RootStore>;
|
|
3247
3418
|
declare const createStore: (invalidate: (state?: RootState, frames?: number, stackFrames?: boolean) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState, frame?: XRFrame) => void) => RootStore;
|
|
3248
3419
|
|
|
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
3420
|
/**
|
|
3255
3421
|
* An SSR-friendly useLayoutEffect.
|
|
3256
3422
|
*
|
|
@@ -3734,5 +3900,5 @@ declare function isOnce(value: unknown): value is {
|
|
|
3734
3900
|
*/
|
|
3735
3901
|
declare function Canvas(props: CanvasProps): react_jsx_runtime.JSX.Element;
|
|
3736
3902
|
|
|
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,
|
|
3738
|
-
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 };
|
|
3903
|
+
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 };
|
|
3904
|
+
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, NodeLike, NodeProps, NodeRecord, NodeStore, 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 };
|