@react-three/fiber 10.0.0-canary.2b511a5 → 10.0.0-canary.39882dd
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 +2803 -3282
- package/dist/index.d.cts +356 -825
- package/dist/index.d.mts +356 -825
- package/dist/index.d.ts +356 -825
- package/dist/index.mjs +2607 -3085
- package/dist/legacy.cjs +2620 -3110
- package/dist/legacy.d.cts +356 -828
- package/dist/legacy.d.mts +356 -828
- package/dist/legacy.d.ts +356 -828
- package/dist/legacy.mjs +2738 -3227
- package/dist/webgpu/index.cjs +2962 -3275
- package/dist/webgpu/index.d.cts +483 -878
- package/dist/webgpu/index.d.mts +483 -878
- package/dist/webgpu/index.d.ts +483 -878
- package/dist/webgpu/index.mjs +3199 -3515
- package/package.json +6 -5
- package/readme.md +3 -4
- 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/legacy.d.cts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as THREE$1 from 'three';
|
|
2
|
-
import { WebGLRenderTarget, Color as Color$1, ColorRepresentation, Euler as Euler$1, Loader, RenderTargetOptions as RenderTargetOptions$1, Layers as Layers$1, Raycaster, Intersection as Intersection$1, BufferGeometry, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, Node as Node$1, Vector2 as Vector2$1, Vector3 as Vector3$1, Vector4 as Vector4$1, Matrix3 as Matrix3$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D, Frustum, OrthographicCamera } from 'three';
|
|
2
|
+
import { WebGLCubeRenderTarget, WebGLRenderTarget, Color as Color$1, ColorRepresentation, Euler as Euler$1, Loader, RenderTargetOptions as RenderTargetOptions$1, Layers as Layers$1, Raycaster, Intersection as Intersection$1, BufferGeometry, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, Node as Node$1, Vector2 as Vector2$1, Vector3 as Vector3$1, Vector4 as Vector4$1, Matrix3 as Matrix3$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D, Frustum, OrthographicCamera } from 'three';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import { ReactNode, Component, RefObject, JSX } from 'react';
|
|
5
5
|
import * as three_webgpu from 'three/webgpu';
|
|
6
|
-
import { WebGPURenderer as WebGPURenderer$1,
|
|
6
|
+
import { WebGPURenderer as WebGPURenderer$1, Node, StorageTexture, Data3DTexture, CanvasTarget, ShaderNodeObject } from 'three/webgpu';
|
|
7
7
|
import { StoreApi } from 'zustand';
|
|
8
8
|
import { UseBoundStoreWithEqualityFn } from 'zustand/traditional';
|
|
9
|
+
import { FrameTimingState, FrameCallback as FrameCallback$1, SchedulerApi, UseFrameNextOptions, FrameNextControls } from '@pmndrs/scheduler';
|
|
10
|
+
export { AddPhaseOptions, FrameControls, FrameNextControls, FrameTimingState, RootOptions, Scheduler, SchedulerApi, UseFrameNextOptions, UseFrameOptions, getScheduler } from '@pmndrs/scheduler';
|
|
9
11
|
import { Options } from 'react-use-measure';
|
|
10
12
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
11
|
-
import { ThreeElement as ThreeElement$1, Euler as Euler$2 } from '@react-three/fiber';
|
|
12
13
|
import { GroundedSkybox } from 'three/examples/jsm/objects/GroundedSkybox.js';
|
|
13
14
|
|
|
14
15
|
function _mergeNamespaces(n, m) {
|
|
@@ -37,23 +38,28 @@ function _mergeNamespaces(n, m) {
|
|
|
37
38
|
declare const R3F_BUILD_LEGACY = true;
|
|
38
39
|
declare const R3F_BUILD_WEBGPU = false;
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
type Inspector = never;
|
|
42
|
+
/** Not available on the legacy (WebGL-only) entry. */
|
|
43
|
+
declare function loadInspector(): Promise<never>;
|
|
43
44
|
declare const WebGPURenderer: {
|
|
44
45
|
new (): {};
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
declare const RenderTarget: any;
|
|
48
49
|
|
|
50
|
+
declare const CubeRenderTarget: any;
|
|
51
|
+
|
|
49
52
|
var THREE = /*#__PURE__*/_mergeNamespaces({
|
|
50
53
|
__proto__: null,
|
|
54
|
+
CubeRenderTarget: CubeRenderTarget,
|
|
55
|
+
CubeRenderTargetCompat: WebGLCubeRenderTarget,
|
|
51
56
|
Inspector: Inspector,
|
|
52
57
|
R3F_BUILD_LEGACY: R3F_BUILD_LEGACY,
|
|
53
58
|
R3F_BUILD_WEBGPU: R3F_BUILD_WEBGPU,
|
|
54
59
|
RenderTarget: RenderTarget,
|
|
55
60
|
RenderTargetCompat: WebGLRenderTarget,
|
|
56
|
-
WebGPURenderer: WebGPURenderer
|
|
61
|
+
WebGPURenderer: WebGPURenderer,
|
|
62
|
+
loadInspector: loadInspector
|
|
57
63
|
}, [THREE$1]);
|
|
58
64
|
|
|
59
65
|
//* Utility Types ==============================
|
|
@@ -148,6 +154,8 @@ interface IntersectionEvent<TSourceEvent> extends Intersection {
|
|
|
148
154
|
unprojectedPoint: THREE$1.Vector3
|
|
149
155
|
/** Normalized event coordinates */
|
|
150
156
|
pointer: THREE$1.Vector2
|
|
157
|
+
/** pointerId of the original event for multiple pointer events */
|
|
158
|
+
pointerId: number
|
|
151
159
|
/** Delta between first click and this event */
|
|
152
160
|
delta: number
|
|
153
161
|
/** The ray that pierced it */
|
|
@@ -224,6 +232,18 @@ interface EventHandlers {
|
|
|
224
232
|
type FilterFunction = (items: THREE$1.Intersection[], state: RootState) => THREE$1.Intersection[]
|
|
225
233
|
type ComputeFunction = (event: DomEvent, root: RootState, previous?: RootState) => void
|
|
226
234
|
|
|
235
|
+
/** Configuration for XR pointer registration (controllers/hands) */
|
|
236
|
+
interface XRPointerConfig {
|
|
237
|
+
/** Ray origin (updated each frame by XR system) */
|
|
238
|
+
ray: THREE$1.Ray
|
|
239
|
+
/** Optional: custom compute function for this pointer */
|
|
240
|
+
compute?: (state: RootState) => void
|
|
241
|
+
/** Pointer type identifier */
|
|
242
|
+
type: 'controller' | 'hand' | 'gaze'
|
|
243
|
+
/** Which hand (for controller/hand types) */
|
|
244
|
+
handedness?: 'left' | 'right'
|
|
245
|
+
}
|
|
246
|
+
|
|
227
247
|
interface EventManager<TTarget> {
|
|
228
248
|
/** Determines if the event layer is active */
|
|
229
249
|
enabled: boolean
|
|
@@ -243,8 +263,21 @@ interface EventManager<TTarget> {
|
|
|
243
263
|
disconnect?: () => void
|
|
244
264
|
/** Triggers a onPointerMove with the last known event. This can be useful to enable raycasting without
|
|
245
265
|
* explicit user interaction, for instance when the camera moves a hoverable object underneath the cursor.
|
|
266
|
+
* @param pointerId - Optional pointer ID to update specific pointer only
|
|
246
267
|
*/
|
|
247
|
-
update?: () => void
|
|
268
|
+
update?: (pointerId?: number) => void
|
|
269
|
+
/** Defer pointer move raycasting to frame start (default: true) */
|
|
270
|
+
frameTimedRaycasts?: boolean
|
|
271
|
+
/** Always fire raycaster immediately on scroll events (default: true) */
|
|
272
|
+
alwaysFireOnScroll?: boolean
|
|
273
|
+
/** Automatically re-raycast every frame to detect hover changes from moving objects/camera (default: false) */
|
|
274
|
+
updateOnFrame?: boolean
|
|
275
|
+
/** Flush deferred pointer raycasts. Called by scheduler at frame start (input phase). */
|
|
276
|
+
flush?: () => void
|
|
277
|
+
/** Register an XR pointer (controller/hand). Returns assigned pointerId */
|
|
278
|
+
registerPointer?: (config: XRPointerConfig) => number
|
|
279
|
+
/** Unregister an XR pointer */
|
|
280
|
+
unregisterPointer?: (pointerId: number) => void
|
|
248
281
|
}
|
|
249
282
|
|
|
250
283
|
interface PointerCaptureTarget {
|
|
@@ -264,227 +297,94 @@ interface VisibilityEntry {
|
|
|
264
297
|
}
|
|
265
298
|
|
|
266
299
|
//* Scheduler Types (useFrame) ==============================
|
|
300
|
+
//
|
|
301
|
+
// The generic, framework-agnostic scheduler types now live in @pmndrs/scheduler.
|
|
302
|
+
// This file re-exports them and layers r3f's RootState-aware frame state on top,
|
|
303
|
+
// so existing `#types` imports across the codebase keep resolving unchanged.
|
|
267
304
|
|
|
268
305
|
|
|
269
306
|
|
|
270
|
-
//
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Options for useFrame hook
|
|
274
|
-
*/
|
|
275
|
-
interface UseFrameNextOptions {
|
|
276
|
-
/** Optional stable id for the job. Auto-generated if not provided */
|
|
277
|
-
id?: string
|
|
278
|
-
/** Named phase to run in. Default: 'update' */
|
|
279
|
-
phase?: string
|
|
280
|
-
/** Run before this phase or job id */
|
|
281
|
-
before?: string | string[]
|
|
282
|
-
/** Run after this phase or job id */
|
|
283
|
-
after?: string | string[]
|
|
284
|
-
/** Priority within phase. Higher runs first. Default: 0 */
|
|
285
|
-
priority?: number
|
|
286
|
-
/** Max frames per second for this job */
|
|
287
|
-
fps?: number
|
|
288
|
-
/** If true, skip frames when behind. If false, try to catch up. Default: true */
|
|
289
|
-
drop?: boolean
|
|
290
|
-
/** Enable/disable without unregistering. Default: true */
|
|
291
|
-
enabled?: boolean
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/** Alias for UseFrameNextOptions */
|
|
295
|
-
type UseFrameOptions = UseFrameNextOptions
|
|
307
|
+
// Frame State (r3f-specific) --------------------------------
|
|
296
308
|
|
|
297
309
|
/**
|
|
298
|
-
*
|
|
310
|
+
* State passed to useFrame callbacks (extends RootState with timing).
|
|
299
311
|
*/
|
|
300
|
-
interface
|
|
301
|
-
/** Insert this phase before the specified phase */
|
|
302
|
-
before?: string
|
|
303
|
-
/** Insert this phase after the specified phase */
|
|
304
|
-
after?: string
|
|
305
|
-
}
|
|
312
|
+
interface FrameNextState extends RootState, FrameTimingState {}
|
|
306
313
|
|
|
307
|
-
|
|
314
|
+
/** Alias for FrameNextState */
|
|
315
|
+
type FrameState = FrameNextState
|
|
308
316
|
|
|
309
|
-
|
|
310
|
-
* Timing-only state for independent/outside mode (no RootState)
|
|
311
|
-
*/
|
|
312
|
-
interface FrameTimingState {
|
|
313
|
-
/** High-resolution timestamp from RAF (ms) */
|
|
314
|
-
time: number
|
|
315
|
-
/** Time since last frame in seconds (for legacy compatibility with THREE.Clock) */
|
|
316
|
-
delta: number
|
|
317
|
-
/** Elapsed time since first frame in seconds (for legacy compatibility with THREE.Clock) */
|
|
318
|
-
elapsed: number
|
|
319
|
-
/** Incrementing frame counter */
|
|
320
|
-
frame: number
|
|
321
|
-
}
|
|
317
|
+
// Callback Types (r3f-specific) --------------------------------
|
|
322
318
|
|
|
323
319
|
/**
|
|
324
|
-
*
|
|
320
|
+
* Callback function for useFrame. Receives the full r3f RootState plus timing.
|
|
325
321
|
*/
|
|
326
|
-
|
|
322
|
+
type FrameNextCallback = FrameCallback$1<RootState>
|
|
327
323
|
|
|
328
|
-
/** Alias for
|
|
329
|
-
type
|
|
324
|
+
/** Alias for FrameNextCallback */
|
|
325
|
+
type FrameCallback = FrameNextCallback
|
|
330
326
|
|
|
331
|
-
|
|
327
|
+
//* Buffer Types (useBuffers) ========================================
|
|
332
328
|
|
|
333
329
|
/**
|
|
334
|
-
*
|
|
330
|
+
* Buffer-like types for GPU compute and storage operations.
|
|
331
|
+
* Includes raw CPU arrays, Three.js buffer attributes, and TSL buffer nodes.
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* ```tsx
|
|
335
|
+
* const { positions, velocities } = useBuffers(() => ({
|
|
336
|
+
* positions: instancedArray(count, 'vec3'), // StorageBufferNode
|
|
337
|
+
* velocities: new Float32Array(count * 3), // TypedArray
|
|
338
|
+
* }), 'particles')
|
|
339
|
+
* ```
|
|
335
340
|
*/
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
341
|
+
type BufferLike =
|
|
342
|
+
| Float32Array
|
|
343
|
+
| Uint32Array
|
|
344
|
+
| Int32Array
|
|
345
|
+
| Float64Array
|
|
346
|
+
| Uint8Array
|
|
347
|
+
| Int8Array
|
|
348
|
+
| Uint16Array
|
|
349
|
+
| Int16Array
|
|
350
|
+
| THREE$1.BufferAttribute // Base class for all buffer attributes
|
|
351
|
+
| Node // TSL buffer nodes (instancedArray, storage)
|
|
342
352
|
|
|
343
|
-
|
|
353
|
+
/** Flat record of buffer-like values (no nested scopes) */
|
|
354
|
+
type BufferRecord = Record<string, BufferLike>
|
|
344
355
|
|
|
345
356
|
/**
|
|
346
|
-
*
|
|
357
|
+
* Buffer store that can contain both root-level buffers and scoped buffer objects.
|
|
358
|
+
* Structure: { positions: Float32Array, particles: { vel: StorageBufferNode } }
|
|
347
359
|
*/
|
|
348
|
-
type
|
|
349
|
-
|
|
350
|
-
/** Alias for FrameNextCallback */
|
|
351
|
-
type FrameCallback = FrameNextCallback
|
|
360
|
+
type BufferStore = Record<string, BufferLike | BufferRecord>
|
|
352
361
|
|
|
353
|
-
|
|
362
|
+
//* Storage Types (useGPUStorage) ========================================
|
|
354
363
|
|
|
355
364
|
/**
|
|
356
|
-
*
|
|
365
|
+
* GPU storage types for texture-based storage operations.
|
|
366
|
+
* Includes Three.js storage textures and TSL storage texture nodes.
|
|
367
|
+
*
|
|
368
|
+
* @example
|
|
369
|
+
* ```tsx
|
|
370
|
+
* const { heightMap } = useGPUStorage(() => ({
|
|
371
|
+
* heightMap: new StorageTexture(512, 512),
|
|
372
|
+
* }), 'terrain')
|
|
373
|
+
* ```
|
|
357
374
|
*/
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
scheduler: SchedulerApi
|
|
363
|
-
/** Manually step this job only (bypasses FPS limiting) */
|
|
364
|
-
step(timestamp?: number): void
|
|
365
|
-
/** Manually step ALL jobs in the scheduler */
|
|
366
|
-
stepAll(timestamp?: number): void
|
|
367
|
-
/** Pause this job (set enabled=false) */
|
|
368
|
-
pause(): void
|
|
369
|
-
/** Resume this job (set enabled=true) */
|
|
370
|
-
resume(): void
|
|
371
|
-
/** Reactive paused state - automatically triggers re-render when changed */
|
|
372
|
-
isPaused: boolean
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
/** Alias for FrameNextControls */
|
|
376
|
-
type FrameControls = FrameNextControls
|
|
375
|
+
type StorageLike =
|
|
376
|
+
| StorageTexture // GPU storage texture
|
|
377
|
+
| Data3DTexture // 3D texture (can be used as storage)
|
|
378
|
+
| Node // TSL storage texture nodes (storageTexture)
|
|
377
379
|
|
|
378
|
-
|
|
380
|
+
/** Flat record of storage-like values (no nested scopes) */
|
|
381
|
+
type StorageRecord = Record<string, StorageLike>
|
|
379
382
|
|
|
380
383
|
/**
|
|
381
|
-
*
|
|
384
|
+
* Storage store that can contain both root-level storage and scoped storage objects.
|
|
385
|
+
* Structure: { heightMap: StorageTexture, terrain: { normal: StorageTextureNode } }
|
|
382
386
|
*/
|
|
383
|
-
|
|
384
|
-
//* Phase Management --------------------------------
|
|
385
|
-
|
|
386
|
-
/** Add a named phase to the scheduler */
|
|
387
|
-
addPhase(name: string, options?: AddPhaseOptions): void
|
|
388
|
-
/** Get the ordered list of phase names */
|
|
389
|
-
readonly phases: string[]
|
|
390
|
-
/** Check if a phase exists */
|
|
391
|
-
hasPhase(name: string): boolean
|
|
392
|
-
|
|
393
|
-
//* Root Management --------------------------------
|
|
394
|
-
|
|
395
|
-
/** Register a root (Canvas) with the scheduler. Returns unsubscribe function. */
|
|
396
|
-
registerRoot(id: string, options?: RootOptions): () => void
|
|
397
|
-
/** Unregister a root */
|
|
398
|
-
unregisterRoot(id: string): void
|
|
399
|
-
/** Generate a unique root ID */
|
|
400
|
-
generateRootId(): string
|
|
401
|
-
/** Get the number of registered roots */
|
|
402
|
-
getRootCount(): number
|
|
403
|
-
/** Check if any root is registered and ready */
|
|
404
|
-
readonly isReady: boolean
|
|
405
|
-
/** Subscribe to root-ready event. Fires immediately if already ready. Returns unsubscribe. */
|
|
406
|
-
onRootReady(callback: () => void): () => void
|
|
407
|
-
|
|
408
|
-
//* Job Registration --------------------------------
|
|
409
|
-
|
|
410
|
-
/** Register a job with the scheduler (returns unsubscribe function) */
|
|
411
|
-
register(
|
|
412
|
-
callback: FrameNextCallback,
|
|
413
|
-
options?: {
|
|
414
|
-
id?: string
|
|
415
|
-
rootId?: string
|
|
416
|
-
phase?: string
|
|
417
|
-
before?: string | string[]
|
|
418
|
-
after?: string | string[]
|
|
419
|
-
priority?: number
|
|
420
|
-
fps?: number
|
|
421
|
-
drop?: boolean
|
|
422
|
-
enabled?: boolean
|
|
423
|
-
},
|
|
424
|
-
): () => void
|
|
425
|
-
/** Update a job's options */
|
|
426
|
-
updateJob(
|
|
427
|
-
id: string,
|
|
428
|
-
options: {
|
|
429
|
-
priority?: number
|
|
430
|
-
fps?: number
|
|
431
|
-
drop?: boolean
|
|
432
|
-
enabled?: boolean
|
|
433
|
-
phase?: string
|
|
434
|
-
before?: string | string[]
|
|
435
|
-
after?: string | string[]
|
|
436
|
-
},
|
|
437
|
-
): void
|
|
438
|
-
/** Unregister a job by ID */
|
|
439
|
-
unregister(id: string, rootId?: string): void
|
|
440
|
-
/** Get the number of registered jobs */
|
|
441
|
-
getJobCount(): number
|
|
442
|
-
/** Get all job IDs */
|
|
443
|
-
getJobIds(): string[]
|
|
444
|
-
|
|
445
|
-
//* Global Jobs (for legacy addEffect/addAfterEffect) --------------------------------
|
|
446
|
-
|
|
447
|
-
/** Register a global job (runs once per frame, not per-root). Returns unsubscribe function. */
|
|
448
|
-
registerGlobal(phase: 'before' | 'after', id: string, callback: (timestamp: number) => void): () => void
|
|
449
|
-
|
|
450
|
-
//* Idle Callbacks (for legacy addTail) --------------------------------
|
|
451
|
-
|
|
452
|
-
/** Register an idle callback (fires when loop stops). Returns unsubscribe function. */
|
|
453
|
-
onIdle(callback: (timestamp: number) => void): () => void
|
|
454
|
-
|
|
455
|
-
//* Frame Loop Control --------------------------------
|
|
456
|
-
|
|
457
|
-
/** Start the scheduler loop */
|
|
458
|
-
start(): void
|
|
459
|
-
/** Stop the scheduler loop */
|
|
460
|
-
stop(): void
|
|
461
|
-
/** Check if the scheduler is running */
|
|
462
|
-
readonly isRunning: boolean
|
|
463
|
-
/** Get/set the frameloop mode ('always', 'demand', 'never') */
|
|
464
|
-
frameloop: Frameloop
|
|
465
|
-
/** Independent mode - runs without Canvas, callbacks receive timing-only state */
|
|
466
|
-
independent: boolean
|
|
467
|
-
|
|
468
|
-
//* Manual Stepping --------------------------------
|
|
469
|
-
|
|
470
|
-
/** Manually step all jobs once (for frameloop='never' or testing) */
|
|
471
|
-
step(timestamp?: number): void
|
|
472
|
-
/** Manually step a single job by ID */
|
|
473
|
-
stepJob(id: string, timestamp?: number): void
|
|
474
|
-
/** Request frame(s) to be rendered (for frameloop='demand') */
|
|
475
|
-
invalidate(frames?: number): void
|
|
476
|
-
|
|
477
|
-
//* Per-Job Control --------------------------------
|
|
478
|
-
|
|
479
|
-
/** Check if a job is paused */
|
|
480
|
-
isJobPaused(id: string): boolean
|
|
481
|
-
/** Pause a job */
|
|
482
|
-
pauseJob(id: string): void
|
|
483
|
-
/** Resume a job */
|
|
484
|
-
resumeJob(id: string): void
|
|
485
|
-
/** Subscribe to job state changes (for reactive isPaused). Returns unsubscribe function. */
|
|
486
|
-
subscribeJobState(id: string, listener: () => void): () => void
|
|
487
|
-
}
|
|
387
|
+
type StorageStore = Record<string, StorageLike | StorageRecord>
|
|
488
388
|
|
|
489
389
|
//* Renderer Types ========================================
|
|
490
390
|
|
|
@@ -499,6 +399,18 @@ type Subscription = {
|
|
|
499
399
|
store: RootStore
|
|
500
400
|
}
|
|
501
401
|
|
|
402
|
+
/** Per-pointer state for multi-touch and XR support */
|
|
403
|
+
type PointerState = {
|
|
404
|
+
/** Objects currently hovered by this pointer */
|
|
405
|
+
hovered: Map<string, ThreeEvent<DomEvent>>
|
|
406
|
+
/** Objects capturing this pointer */
|
|
407
|
+
captured: Map<THREE$1.Object3D, PointerCaptureTarget>
|
|
408
|
+
/** Initial click position [x, y] */
|
|
409
|
+
initialClick: [x: number, y: number]
|
|
410
|
+
/** Objects hit on initial click */
|
|
411
|
+
initialHits: THREE$1.Object3D[]
|
|
412
|
+
}
|
|
413
|
+
|
|
502
414
|
type Dpr = number | [min: number, max: number]
|
|
503
415
|
|
|
504
416
|
interface Size {
|
|
@@ -540,12 +452,21 @@ interface Performance {
|
|
|
540
452
|
|
|
541
453
|
interface InternalState {
|
|
542
454
|
interaction: THREE$1.Object3D[]
|
|
543
|
-
hovered: Map<string, ThreeEvent<DomEvent>>
|
|
544
455
|
subscribers: Subscription[]
|
|
456
|
+
/** Per-pointer state (hover, capture, click tracking) - replaces hovered, capturedMap, initialClick, initialHits */
|
|
457
|
+
pointerMap: Map<number, PointerState>
|
|
458
|
+
/** Pointers needing raycast this frame (used with frameTimedRaycasts) */
|
|
459
|
+
pointerDirty: Map<number, DomEvent>
|
|
460
|
+
/** Last event received (for events.update() compatibility) */
|
|
461
|
+
lastEvent: React$1.RefObject<DomEvent | null>
|
|
462
|
+
/** @deprecated Use pointerMap.get(pointerId).hovered instead */
|
|
463
|
+
hovered: Map<string, ThreeEvent<DomEvent>>
|
|
464
|
+
/** @deprecated Use pointerMap.get(pointerId).captured instead */
|
|
545
465
|
capturedMap: Map<number, Map<THREE$1.Object3D, PointerCaptureTarget>>
|
|
466
|
+
/** @deprecated Use pointerMap.get(pointerId).initialClick instead */
|
|
546
467
|
initialClick: [x: number, y: number]
|
|
468
|
+
/** @deprecated Use pointerMap.get(pointerId).initialHits instead */
|
|
547
469
|
initialHits: THREE$1.Object3D[]
|
|
548
|
-
lastEvent: React$1.RefObject<DomEvent | null>
|
|
549
470
|
/** Visibility event registry (onFramed, onOccluded, onVisible) */
|
|
550
471
|
visibilityRegistry: Map<string, VisibilityEntry>
|
|
551
472
|
/** Whether occlusion queries are enabled (WebGPU only) */
|
|
@@ -576,9 +497,21 @@ interface InternalState {
|
|
|
576
497
|
* @see https://threejs.org/docs/#api/en/renderers/common/CanvasTarget
|
|
577
498
|
*/
|
|
578
499
|
canvasTarget?: CanvasTarget
|
|
500
|
+
/**
|
|
501
|
+
* Set when this root's canvas target has been resized and the backend's cached render pass
|
|
502
|
+
* descriptor (which holds a depth-stencil view built once per canvas) is therefore stale.
|
|
503
|
+
*
|
|
504
|
+
* Flushed by the canvas-target job in the `start` phase, which is the only place this root's
|
|
505
|
+
* target is guaranteed to be the renderer's active one — `backend.updateSize()` operates on
|
|
506
|
+
* whatever `getCanvasTarget()` returns, so calling it from the resize subscription would
|
|
507
|
+
* invalidate some other canvas's descriptor instead.
|
|
508
|
+
*
|
|
509
|
+
* @see https://github.com/pmndrs/react-three-fiber/issues/3847
|
|
510
|
+
*/
|
|
511
|
+
canvasTargetSizeDirty?: boolean
|
|
579
512
|
/**
|
|
580
513
|
* Whether multi-canvas rendering is active.
|
|
581
|
-
* True when any canvas uses `
|
|
514
|
+
* True when any canvas uses `renderer={{ primaryCanvas: 'id' }}` to share a renderer.
|
|
582
515
|
* When true, setCanvasTarget is called before each render.
|
|
583
516
|
*/
|
|
584
517
|
isMultiCanvas?: boolean
|
|
@@ -676,8 +609,8 @@ interface RootState {
|
|
|
676
609
|
setSize: (width?: number, height?: number, top?: number, left?: number) => void
|
|
677
610
|
/** Shortcut to manual setting the pixel ratio */
|
|
678
611
|
setDpr: (dpr: Dpr) => void
|
|
679
|
-
/** Shortcut to setting frameloop flags */
|
|
680
|
-
setFrameloop: (frameloop
|
|
612
|
+
/** Shortcut to setting frameloop flags. No args resets to 'always'. */
|
|
613
|
+
setFrameloop: (frameloop?: Frameloop) => void
|
|
681
614
|
/** Set error state to propagate to error boundary */
|
|
682
615
|
setError: (error: Error | null) => void
|
|
683
616
|
/** Current error state (null when no error) */
|
|
@@ -686,11 +619,17 @@ interface RootState {
|
|
|
686
619
|
uniforms: UniformStore
|
|
687
620
|
/** Global TSL nodes - root-level nodes + scoped sub-objects. Use useNodes() hook */
|
|
688
621
|
nodes: Record<string, any>
|
|
689
|
-
/** Global TSL
|
|
690
|
-
|
|
691
|
-
/**
|
|
692
|
-
|
|
693
|
-
/** Global
|
|
622
|
+
/** Global TSL buffer nodes - root-level buffers + scoped sub-objects. Use useBuffers() hook */
|
|
623
|
+
buffers: BufferStore
|
|
624
|
+
/** Global GPU storage (textures, etc.) - root-level storage + scoped sub-objects. Use useGPUStorage() hook */
|
|
625
|
+
gpuStorage: StorageStore
|
|
626
|
+
/** Global Texture registry (key → Texture, usually keyed by URL) - use useTextures() hook for access + lifecycle */
|
|
627
|
+
textures: Map<string, THREE$1.Texture>
|
|
628
|
+
/** Internal: refcount per texture key, driven by mounted useTexture consumers (registry enrollment is on by default) */
|
|
629
|
+
_textureRefs: Map<string, number>
|
|
630
|
+
/** WebGPU RenderPipeline instance - use useRenderPipeline() hook */
|
|
631
|
+
renderPipeline: ThreeRenderPipeline | null
|
|
632
|
+
/** Global TSL pass nodes for render pipeline - use useRenderPipeline() hook */
|
|
694
633
|
passes: Record<string, any>
|
|
695
634
|
/** Internal version counter for HMR - incremented by rebuildNodes/rebuildUniforms to bust memoization */
|
|
696
635
|
_hmrVersion: number
|
|
@@ -740,6 +679,20 @@ interface Renderer {
|
|
|
740
679
|
render: (scene: THREE$1.Scene, camera: THREE$1.Camera) => any
|
|
741
680
|
}
|
|
742
681
|
|
|
682
|
+
//* Color Management Config ==============================
|
|
683
|
+
|
|
684
|
+
/**
|
|
685
|
+
* Color management configuration shared by both WebGL and WebGPU renderers.
|
|
686
|
+
*/
|
|
687
|
+
interface ColorManagementConfig {
|
|
688
|
+
/**
|
|
689
|
+
* Color space assigned to 8-bit input textures (color maps).
|
|
690
|
+
* Defaults to sRGB. Most textures are authored in sRGB.
|
|
691
|
+
* @default THREE.SRGBColorSpace
|
|
692
|
+
*/
|
|
693
|
+
textureColorSpace?: THREE$1.ColorSpace
|
|
694
|
+
}
|
|
695
|
+
|
|
743
696
|
//* WebGL Renderer Props ==============================
|
|
744
697
|
|
|
745
698
|
type DefaultGLProps = Omit<THREE$1.WebGLRendererParameters, 'canvas'> & {
|
|
@@ -750,7 +703,7 @@ type GLProps =
|
|
|
750
703
|
| Renderer
|
|
751
704
|
| ((defaultProps: DefaultGLProps) => Renderer)
|
|
752
705
|
| ((defaultProps: DefaultGLProps) => Promise<Renderer>)
|
|
753
|
-
| Partial<Properties<THREE$1.WebGLRenderer> | THREE$1.WebGLRendererParameters>
|
|
706
|
+
| (Partial<Properties<THREE$1.WebGLRenderer> | THREE$1.WebGLRendererParameters> & ColorManagementConfig)
|
|
754
707
|
|
|
755
708
|
//* WebGPU Renderer Props ==============================
|
|
756
709
|
|
|
@@ -765,20 +718,27 @@ type DefaultRendererProps = {
|
|
|
765
718
|
*/
|
|
766
719
|
interface CanvasSchedulerConfig {
|
|
767
720
|
/**
|
|
768
|
-
*
|
|
769
|
-
|
|
721
|
+
* Run this Canvas root before the referenced Canvas root id(s).
|
|
722
|
+
*/
|
|
723
|
+
before?: string | string[]
|
|
724
|
+
/**
|
|
725
|
+
* Run this Canvas root after the referenced Canvas root id(s).
|
|
726
|
+
*/
|
|
727
|
+
after?: string | string[]
|
|
728
|
+
/**
|
|
729
|
+
* Numeric root order. Lower values run first.
|
|
770
730
|
*/
|
|
771
|
-
|
|
731
|
+
order?: number
|
|
772
732
|
/**
|
|
773
|
-
* Limit this
|
|
733
|
+
* Limit this Canvas's default render job (frames per second).
|
|
774
734
|
*/
|
|
775
735
|
fps?: number
|
|
776
736
|
}
|
|
777
737
|
|
|
778
738
|
/**
|
|
779
|
-
* Extended renderer configuration for multi-canvas support.
|
|
739
|
+
* Extended renderer configuration for multi-canvas support and color management.
|
|
780
740
|
*/
|
|
781
|
-
interface RendererConfigExtended {
|
|
741
|
+
interface RendererConfigExtended extends ColorManagementConfig {
|
|
782
742
|
/** Share renderer from another canvas (WebGPU only) */
|
|
783
743
|
primaryCanvas?: string
|
|
784
744
|
/** Canvas-level scheduler options */
|
|
@@ -843,8 +803,6 @@ interface RenderProps<TCanvas extends HTMLCanvasElement | OffscreenCanvas$1> {
|
|
|
843
803
|
* @see https://threejs.org/docs/#api/en/renderers/WebGLRenderer.shadowMap
|
|
844
804
|
*/
|
|
845
805
|
shadows?: boolean | 'basic' | 'percentage' | 'soft' | 'variance' | Partial<THREE$1.WebGLShadowMap>
|
|
846
|
-
/** Color space assigned to 8-bit input textures (color maps). Defaults to sRGB. Most textures are authored in sRGB. */
|
|
847
|
-
textureColorSpace?: THREE$1.ColorSpace
|
|
848
806
|
/** Creates an orthographic camera */
|
|
849
807
|
orthographic?: boolean
|
|
850
808
|
/**
|
|
@@ -970,8 +928,6 @@ interface Instance<O = any> {
|
|
|
970
928
|
attach?: AttachType<O>
|
|
971
929
|
previousAttach?: any
|
|
972
930
|
isHidden: boolean
|
|
973
|
-
/** Deferred ref props to apply in commitMount */
|
|
974
|
-
deferredRefs?: Array<{ prop: string; ref: React$1.RefObject<any> }>
|
|
975
931
|
/** Set of props that have been applied via once() */
|
|
976
932
|
appliedOnce?: Set<string>
|
|
977
933
|
}
|
|
@@ -1097,7 +1053,7 @@ interface CanvasProps
|
|
|
1097
1053
|
*/
|
|
1098
1054
|
resize?: Options
|
|
1099
1055
|
/** The target where events are being subscribed to, default: the div that wraps canvas */
|
|
1100
|
-
eventSource?: HTMLElement | React$1.RefObject<HTMLElement>
|
|
1056
|
+
eventSource?: HTMLElement | React$1.RefObject<HTMLElement | null>
|
|
1101
1057
|
/** The event prefix that is cast into canvas pointer x/y events, default: "offset" */
|
|
1102
1058
|
eventPrefix?: 'offset' | 'client' | 'page' | 'layer' | 'screen'
|
|
1103
1059
|
/** Enable/disable automatic HMR refresh for TSL nodes and uniforms, default: true in dev */
|
|
@@ -1208,10 +1164,21 @@ type RenderTargetOptions = RenderTargetOptions$1
|
|
|
1208
1164
|
//* Global Types ==============================
|
|
1209
1165
|
|
|
1210
1166
|
declare global {
|
|
1211
|
-
/**
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1167
|
+
/**
|
|
1168
|
+
* Uniform node type.
|
|
1169
|
+
*
|
|
1170
|
+
* This is three's own `UniformNode`, not a re-declaration of it. It previously was a
|
|
1171
|
+
* hand-rolled `interface UniformNode<T> extends Node { value: T }`, which shadowed the real
|
|
1172
|
+
* exported type globally — so R3F's ~58 references resolved to an approximation that was
|
|
1173
|
+
* missing members three actually ships (`setName` among them) and had drifted to the wrong
|
|
1174
|
+
* arity when three made `UniformNode` two-parameter.
|
|
1175
|
+
*
|
|
1176
|
+
* three's signature is `UniformNode<TNodeType, TValue>`. R3F only ever varies the value type,
|
|
1177
|
+
* so the node type is fixed to `unknown` and the single parameter is kept for call-site
|
|
1178
|
+
* ergonomics. The result is three's structural type, so members stay in sync with the
|
|
1179
|
+
* installed three instead of needing to be mirrored by hand.
|
|
1180
|
+
*/
|
|
1181
|
+
type UniformNode<T = unknown> = three_webgpu.UniformNode<unknown, T>
|
|
1215
1182
|
|
|
1216
1183
|
/**
|
|
1217
1184
|
* ShaderCallable - the return type of Fn()
|
|
@@ -1311,6 +1278,7 @@ declare global {
|
|
|
1311
1278
|
| three_webgpu.Euler
|
|
1312
1279
|
| three_webgpu.Quaternion
|
|
1313
1280
|
| { x: number; y?: number; z?: number; w?: number } // Plain objects converted to vectors
|
|
1281
|
+
| { r: number; g: number; b: number; a?: number } // Plain objects converted to Color
|
|
1314
1282
|
| Node // TSL nodes like color(), vec3(), float() for type casting
|
|
1315
1283
|
| UniformNode
|
|
1316
1284
|
|
|
@@ -1355,179 +1323,45 @@ declare module 'three/tsl' {
|
|
|
1355
1323
|
): ShaderCallable<R>
|
|
1356
1324
|
}
|
|
1357
1325
|
|
|
1358
|
-
/**
|
|
1359
|
-
* PostProcessing Types for usePostProcessing hook (WebGPU only)
|
|
1360
|
-
*/
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
1326
|
declare global {
|
|
1365
|
-
/**
|
|
1327
|
+
/**
|
|
1328
|
+
* three's own render pipeline type. Named here so the rest of R3F refers to three's shape
|
|
1329
|
+
* rather than `any`. three r183 renamed `PostProcessing` to `RenderPipeline`; our peer floor
|
|
1330
|
+
* is r185, so the new name is the only one.
|
|
1331
|
+
*/
|
|
1332
|
+
type ThreeRenderPipeline = three_webgpu.RenderPipeline
|
|
1333
|
+
|
|
1334
|
+
/** Pass record - stores TSL pass nodes for render pipeline */
|
|
1366
1335
|
type PassRecord = Record<string, any>
|
|
1367
1336
|
|
|
1337
|
+
/** State passed to pipeline callbacks after the active pipeline has been created */
|
|
1338
|
+
type RenderPipelineCallbackState = RootState & {
|
|
1339
|
+
renderPipeline: ThreeRenderPipeline
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1368
1342
|
/** Setup callback - runs first to configure MRT, create additional passes */
|
|
1369
|
-
type
|
|
1343
|
+
type RenderPipelineSetupCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1370
1344
|
|
|
1371
1345
|
/** Main callback - runs second to configure outputNode, create effect passes */
|
|
1372
|
-
type
|
|
1346
|
+
type RenderPipelineMainCallback = (state: RenderPipelineCallbackState) => PassRecord | void
|
|
1373
1347
|
|
|
1374
|
-
/** Return type for
|
|
1375
|
-
interface
|
|
1348
|
+
/** Return type for useRenderPipeline hook */
|
|
1349
|
+
interface UseRenderPipelineReturn {
|
|
1376
1350
|
/** Current passes from state */
|
|
1377
1351
|
passes: PassRecord
|
|
1378
|
-
/**
|
|
1379
|
-
|
|
1352
|
+
/** RenderPipeline instance (null if not initialized) */
|
|
1353
|
+
renderPipeline: ThreeRenderPipeline | null
|
|
1380
1354
|
/** Clear all passes from state */
|
|
1381
1355
|
clearPasses: () => void
|
|
1382
|
-
/** Reset
|
|
1356
|
+
/** Reset RenderPipeline entirely (clears PP + passes) */
|
|
1383
1357
|
reset: () => void
|
|
1384
1358
|
/** Re-run setup/main callbacks with current closure values */
|
|
1385
1359
|
rebuild: () => void
|
|
1386
|
-
/** True when
|
|
1360
|
+
/** True when RenderPipeline is configured and ready */
|
|
1387
1361
|
isReady: boolean
|
|
1388
1362
|
}
|
|
1389
1363
|
}
|
|
1390
1364
|
|
|
1391
|
-
//* useFrameNext Types ==============================
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
//* Global Type Declarations ==============================
|
|
1396
|
-
|
|
1397
|
-
declare global {
|
|
1398
|
-
// Job --------------------------------
|
|
1399
|
-
|
|
1400
|
-
/**
|
|
1401
|
-
* Internal job representation in the scheduler
|
|
1402
|
-
*/
|
|
1403
|
-
interface Job {
|
|
1404
|
-
/** Unique identifier */
|
|
1405
|
-
id: string
|
|
1406
|
-
/** The callback to execute */
|
|
1407
|
-
callback: FrameNextCallback
|
|
1408
|
-
/** Phase this job belongs to */
|
|
1409
|
-
phase: string
|
|
1410
|
-
/** Run before these phases/job ids */
|
|
1411
|
-
before: Set<string>
|
|
1412
|
-
/** Run after these phases/job ids */
|
|
1413
|
-
after: Set<string>
|
|
1414
|
-
/** Priority within phase (higher first) */
|
|
1415
|
-
priority: number
|
|
1416
|
-
/** Insertion order for deterministic tie-breaking */
|
|
1417
|
-
index: number
|
|
1418
|
-
/** Max FPS for this job (undefined = no limit) */
|
|
1419
|
-
fps?: number
|
|
1420
|
-
/** Drop frames when behind (true) or catch up (false) */
|
|
1421
|
-
drop: boolean
|
|
1422
|
-
/** Last run timestamp (ms) */
|
|
1423
|
-
lastRun?: number
|
|
1424
|
-
/** Whether job is enabled */
|
|
1425
|
-
enabled: boolean
|
|
1426
|
-
/** Internal flag: system jobs (like default render) don't block user render takeover */
|
|
1427
|
-
system?: boolean
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
// Phase Graph --------------------------------
|
|
1431
|
-
|
|
1432
|
-
/**
|
|
1433
|
-
* A node in the phase graph
|
|
1434
|
-
*/
|
|
1435
|
-
interface PhaseNode {
|
|
1436
|
-
/** Phase name */
|
|
1437
|
-
name: string
|
|
1438
|
-
/** Whether this was auto-generated from a before/after constraint */
|
|
1439
|
-
isAutoGenerated: boolean
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
/**
|
|
1443
|
-
* Options for creating a job from hook options
|
|
1444
|
-
*/
|
|
1445
|
-
interface JobOptions {
|
|
1446
|
-
id?: string
|
|
1447
|
-
phase?: string
|
|
1448
|
-
before?: string | string[]
|
|
1449
|
-
after?: string | string[]
|
|
1450
|
-
priority?: number
|
|
1451
|
-
fps?: number
|
|
1452
|
-
drop?: boolean
|
|
1453
|
-
enabled?: boolean
|
|
1454
|
-
}
|
|
1455
|
-
|
|
1456
|
-
// Frame Loop State --------------------------------
|
|
1457
|
-
|
|
1458
|
-
/**
|
|
1459
|
-
* Internal frame loop state
|
|
1460
|
-
*/
|
|
1461
|
-
interface FrameLoopState {
|
|
1462
|
-
/** Whether the loop is running */
|
|
1463
|
-
running: boolean
|
|
1464
|
-
/** Current RAF handle */
|
|
1465
|
-
rafHandle: number | null
|
|
1466
|
-
/** Last frame timestamp in ms (null = uninitialized) */
|
|
1467
|
-
lastTime: number | null
|
|
1468
|
-
/** Frame counter */
|
|
1469
|
-
frameCount: number
|
|
1470
|
-
/** Elapsed time since first frame in ms */
|
|
1471
|
-
elapsedTime: number
|
|
1472
|
-
/** createdAt timestamp in ms */
|
|
1473
|
-
createdAt: number
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
// Root Entry --------------------------------
|
|
1477
|
-
|
|
1478
|
-
/**
|
|
1479
|
-
* Internal representation of a registered root (Canvas).
|
|
1480
|
-
* Tracks jobs and manages rebuild state for this root.
|
|
1481
|
-
* @internal
|
|
1482
|
-
*/
|
|
1483
|
-
interface RootEntry {
|
|
1484
|
-
/** Unique identifier for this root */
|
|
1485
|
-
id: string
|
|
1486
|
-
/** Function to get the root's current state. Returns any to support independent mode. */
|
|
1487
|
-
getState: () => any
|
|
1488
|
-
/** Map of job IDs to Job objects */
|
|
1489
|
-
jobs: Map<string, Job>
|
|
1490
|
-
/** Cached sorted job list for execution order */
|
|
1491
|
-
sortedJobs: Job[]
|
|
1492
|
-
/** Whether sortedJobs needs rebuilding */
|
|
1493
|
-
needsRebuild: boolean
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1496
|
-
/**
|
|
1497
|
-
* Internal representation of a global job (deprecated API).
|
|
1498
|
-
* Global jobs run once per frame, not per-root.
|
|
1499
|
-
* Used by legacy addEffect/addAfterEffect APIs.
|
|
1500
|
-
* @internal
|
|
1501
|
-
* @deprecated Use useFrame with phases instead
|
|
1502
|
-
*/
|
|
1503
|
-
interface GlobalJob {
|
|
1504
|
-
/** Unique identifier for this global job */
|
|
1505
|
-
id: string
|
|
1506
|
-
/** Callback invoked with RAF timestamp in ms */
|
|
1507
|
-
callback: (timestamp: number) => void
|
|
1508
|
-
}
|
|
1509
|
-
|
|
1510
|
-
// HMR Support --------------------------------
|
|
1511
|
-
|
|
1512
|
-
/**
|
|
1513
|
-
* Hot Module Replacement data structure for preserving scheduler state
|
|
1514
|
-
* @internal
|
|
1515
|
-
*/
|
|
1516
|
-
interface HMRData {
|
|
1517
|
-
/** Shared data object for storing values across reloads */
|
|
1518
|
-
data: Record<string, any>
|
|
1519
|
-
/** Optional function to accept HMR updates */
|
|
1520
|
-
accept?: () => void
|
|
1521
|
-
}
|
|
1522
|
-
|
|
1523
|
-
// Default Phases --------------------------------
|
|
1524
|
-
|
|
1525
|
-
/**
|
|
1526
|
-
* Default phase names for the scheduler
|
|
1527
|
-
*/
|
|
1528
|
-
type DefaultPhase = 'start' | 'input' | 'physics' | 'update' | 'render' | 'finish'
|
|
1529
|
-
}
|
|
1530
|
-
|
|
1531
1365
|
type MutableOrReadonlyParameters<T extends (...args: any) => any> = Parameters<T> | Readonly<Parameters<T>>
|
|
1532
1366
|
|
|
1533
1367
|
interface MathRepresentation {
|
|
@@ -1697,7 +1531,7 @@ declare namespace three_d {
|
|
|
1697
1531
|
* a single WebGPURenderer using Three.js CanvasTarget API.
|
|
1698
1532
|
*
|
|
1699
1533
|
* Primary canvas: Has `id` prop, creates its own renderer, registers here
|
|
1700
|
-
* Secondary canvas: Has `
|
|
1534
|
+
* Secondary canvas: Has `renderer={{ primaryCanvas: 'id' }}`, shares primary's renderer via CanvasTarget
|
|
1701
1535
|
*/
|
|
1702
1536
|
|
|
1703
1537
|
interface PrimaryCanvasEntry {
|
|
@@ -1765,12 +1599,23 @@ type EnvironmentLoaderProps = {
|
|
|
1765
1599
|
* const texture = useEnvironment({ preset: 'sunset' })
|
|
1766
1600
|
* ```
|
|
1767
1601
|
*/
|
|
1768
|
-
declare function useEnvironment({ files, path, preset, colorSpace, extensions, }?: Partial<EnvironmentLoaderProps>): Texture$1<unknown> | CubeTexture
|
|
1602
|
+
declare function useEnvironment({ files, path, preset, colorSpace, extensions, }?: Partial<EnvironmentLoaderProps>): Texture$1<unknown, THREE$1.TextureEventMap> | CubeTexture<unknown>;
|
|
1769
1603
|
declare namespace useEnvironment {
|
|
1770
1604
|
var preload: (preloadOptions?: EnvironmentLoaderPreloadOptions) => void;
|
|
1771
1605
|
var clear: (clearOptions?: EnvironmentLoaderClearOptions) => void;
|
|
1772
1606
|
}
|
|
1773
|
-
|
|
1607
|
+
/**
|
|
1608
|
+
* Options accepted by `useEnvironment.preload`.
|
|
1609
|
+
*
|
|
1610
|
+
* `colorSpace` is deliberately omitted: preload only warms the loader cache, and colorSpace is
|
|
1611
|
+
* applied to the texture by `useEnvironment()` at use time, per consumer. Accepting it here would
|
|
1612
|
+
* advertise an option this function silently ignores.
|
|
1613
|
+
*
|
|
1614
|
+
* This previously read `Omit<…, 'encoding'>` — omitting a key that does not exist on
|
|
1615
|
+
* `EnvironmentLoaderProps`, a leftover from three's pre-`colorSpace` `encoding` API. That made the
|
|
1616
|
+
* type equivalent to the full props, so `colorSpace` was accepted and then dropped on the floor.
|
|
1617
|
+
*/
|
|
1618
|
+
type EnvironmentLoaderPreloadOptions = Omit<EnvironmentLoaderProps, 'colorSpace'>;
|
|
1774
1619
|
type EnvironmentLoaderClearOptions = Pick<EnvironmentLoaderProps, 'files' | 'preset'>;
|
|
1775
1620
|
|
|
1776
1621
|
/**
|
|
@@ -1814,9 +1659,9 @@ type EnvironmentProps = {
|
|
|
1814
1659
|
blur?: number;
|
|
1815
1660
|
backgroundBlurriness?: number;
|
|
1816
1661
|
backgroundIntensity?: number;
|
|
1817
|
-
backgroundRotation?: Euler
|
|
1662
|
+
backgroundRotation?: Euler;
|
|
1818
1663
|
environmentIntensity?: number;
|
|
1819
|
-
environmentRotation?: Euler
|
|
1664
|
+
environmentRotation?: Euler;
|
|
1820
1665
|
map?: Texture$1;
|
|
1821
1666
|
preset?: PresetsType;
|
|
1822
1667
|
scene?: Scene | React$1.RefObject<Scene>;
|
|
@@ -1900,7 +1745,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
|
|
|
1900
1745
|
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;
|
|
1901
1746
|
declare module '@react-three/fiber' {
|
|
1902
1747
|
interface ThreeElements {
|
|
1903
|
-
groundProjectedEnvImpl: ThreeElement
|
|
1748
|
+
groundProjectedEnvImpl: ThreeElement<typeof GroundedSkybox>;
|
|
1904
1749
|
}
|
|
1905
1750
|
}
|
|
1906
1751
|
/**
|
|
@@ -2000,9 +1845,29 @@ declare module '@react-three/fiber' {
|
|
|
2000
1845
|
*/
|
|
2001
1846
|
declare function Environment(props: EnvironmentProps): react_jsx_runtime.JSX.Element;
|
|
2002
1847
|
|
|
1848
|
+
/**
|
|
1849
|
+
* Moves every trace of interactivity from one object to its replacement, for reconstruction.
|
|
1850
|
+
*
|
|
1851
|
+
* When `args` or a `primitive`'s `object` changes, R3F builds a new three object and keeps the same
|
|
1852
|
+
* instance. Removing the old object from the interaction state and registering the new one from
|
|
1853
|
+
* scratch makes events *work* again (#3778), but it forgets what was in flight: a pointer resting on
|
|
1854
|
+
* the object fires a second `onPointerEnter` without ever having left, and an active pointer capture
|
|
1855
|
+
* is dropped mid-drag. Rewriting the references instead keeps the interaction continuous across a
|
|
1856
|
+
* swap the user never asked to see (#3744).
|
|
1857
|
+
*
|
|
1858
|
+
* Captures are re-keyed rather than released, so the DOM-level capture on `captureData.target` is
|
|
1859
|
+
* left alone — releasing and re-acquiring it is precisely the glitch being avoided.
|
|
1860
|
+
*
|
|
1861
|
+
* Visibility handlers are deliberately not transferred: that registry is keyed by `object.uuid`, so
|
|
1862
|
+
* the replacement re-registers itself through `applyProps`. The old entry is dropped here so it
|
|
1863
|
+
* cannot outlive the object it described.
|
|
1864
|
+
*/
|
|
1865
|
+
declare function swapInteractivity(store: RootStore, object: Object3D, newObject: Object3D): void;
|
|
2003
1866
|
declare function removeInteractivity(store: RootStore, object: Object3D): void;
|
|
2004
1867
|
declare function createEvents(store: RootStore): {
|
|
2005
1868
|
handlePointer: (name: string) => (event: DomEvent) => void;
|
|
1869
|
+
flushDeferredPointers: () => void;
|
|
1870
|
+
processDeferredPointer: (event: DomEvent, pointerId: number) => void;
|
|
2006
1871
|
};
|
|
2007
1872
|
/** Default R3F event manager for web */
|
|
2008
1873
|
declare function createPointerEvents(store: RootStore): EventManager<HTMLElement>;
|
|
@@ -2018,389 +1883,27 @@ declare function getLoader<L extends LoaderLike | ConstructorRepresentation<Load
|
|
|
2018
1883
|
* Note: this hook's caller must be wrapped with `React.Suspense`
|
|
2019
1884
|
* @see https://docs.pmnd.rs/react-three-fiber/api/hooks#useloader
|
|
2020
1885
|
*/
|
|
2021
|
-
declare function useLoader<I extends InputLike, L extends LoaderLike | ConstructorRepresentation<LoaderLike>>(loader: L, input: I, extensions?: Extensions<L>, onProgress?: (event: ProgressEvent<EventTarget>) => void): I extends any[] ? LoaderResult<L>[] : LoaderResult<L>;
|
|
1886
|
+
declare function useLoader<I extends InputLike, L extends LoaderLike | ConstructorRepresentation<LoaderLike>>(loader: L, input: I, extensions?: Extensions<L>, onProgress?: (event: ProgressEvent<EventTarget>) => void, cacheKey?: InputLike): I extends any[] ? LoaderResult<L>[] : LoaderResult<L>;
|
|
2022
1887
|
declare namespace useLoader {
|
|
2023
|
-
var preload: <I extends InputLike, L extends LoaderLike | ConstructorRepresentation<LoaderLike>>(loader: L, input: I, extensions?: Extensions<L>, onProgress?: (event: ProgressEvent<EventTarget>) => void) => void;
|
|
2024
|
-
var clear: <I extends InputLike, L extends LoaderLike | ConstructorRepresentation<LoaderLike>>(loader: L, input: I) => void;
|
|
1888
|
+
var preload: <I extends InputLike, L extends LoaderLike | ConstructorRepresentation<LoaderLike>>(loader: L, input: I, extensions?: Extensions<L>, onProgress?: (event: ProgressEvent<EventTarget>) => void, cacheKey?: InputLike) => void;
|
|
1889
|
+
var clear: <I extends InputLike, L extends LoaderLike | ConstructorRepresentation<LoaderLike>>(loader: L, input: I, cacheKey?: InputLike) => void;
|
|
2025
1890
|
var loader: typeof getLoader;
|
|
2026
1891
|
}
|
|
2027
1892
|
|
|
2028
|
-
/**
|
|
2029
|
-
* Global Singleton Scheduler - manages the frame loop and job execution for ALL R3F roots.
|
|
2030
|
-
*
|
|
2031
|
-
* Features:
|
|
2032
|
-
* - Single RAF loop for entire application
|
|
2033
|
-
* - Root registration (multiple Canvas support)
|
|
2034
|
-
* - Global phases for addEffect/addAfterEffect (deprecated)
|
|
2035
|
-
* - Per-root job management with phases, priorities, FPS throttling
|
|
2036
|
-
* - onIdle callbacks for addTail (deprecated)
|
|
2037
|
-
* - Demand mode support via invalidate()
|
|
2038
|
-
*/
|
|
2039
|
-
declare class Scheduler {
|
|
2040
|
-
private static readonly INSTANCE_KEY;
|
|
2041
|
-
private static get instance();
|
|
2042
|
-
private static set instance(value);
|
|
2043
|
-
/**
|
|
2044
|
-
* Get the global scheduler instance (creates if doesn't exist).
|
|
2045
|
-
* Uses HMR data to preserve instance across hot reloads.
|
|
2046
|
-
* @returns {Scheduler} The singleton scheduler instance
|
|
2047
|
-
*/
|
|
2048
|
-
static get(): Scheduler;
|
|
2049
|
-
/**
|
|
2050
|
-
* Reset the singleton instance. Stops the loop and clears all state.
|
|
2051
|
-
* Primarily used for testing to ensure clean state between tests.
|
|
2052
|
-
* @returns {void}
|
|
2053
|
-
*/
|
|
2054
|
-
static reset(): void;
|
|
2055
|
-
private roots;
|
|
2056
|
-
private phaseGraph;
|
|
2057
|
-
private loopState;
|
|
2058
|
-
private stoppedTime;
|
|
2059
|
-
private nextRootIndex;
|
|
2060
|
-
private globalBeforeJobs;
|
|
2061
|
-
private globalAfterJobs;
|
|
2062
|
-
private nextGlobalIndex;
|
|
2063
|
-
private idleCallbacks;
|
|
2064
|
-
private nextJobIndex;
|
|
2065
|
-
private jobStateListeners;
|
|
2066
|
-
private pendingFrames;
|
|
2067
|
-
private _frameloop;
|
|
2068
|
-
private _independent;
|
|
2069
|
-
private errorHandler;
|
|
2070
|
-
private rootReadyCallbacks;
|
|
2071
|
-
get phases(): string[];
|
|
2072
|
-
get frameloop(): Frameloop;
|
|
2073
|
-
set frameloop(mode: Frameloop);
|
|
2074
|
-
get isRunning(): boolean;
|
|
2075
|
-
get isReady(): boolean;
|
|
2076
|
-
get independent(): boolean;
|
|
2077
|
-
set independent(value: boolean);
|
|
2078
|
-
constructor();
|
|
2079
|
-
/**
|
|
2080
|
-
* Register a root (Canvas) with the scheduler.
|
|
2081
|
-
* The first root to register starts the RAF loop (if frameloop='always').
|
|
2082
|
-
* @param {string} id - Unique identifier for this root
|
|
2083
|
-
* @param {RootOptions} [options] - Optional configuration with getState and onError callbacks
|
|
2084
|
-
* @returns {() => void} Unsubscribe function to remove this root
|
|
2085
|
-
*/
|
|
2086
|
-
registerRoot(id: string, options?: RootOptions): () => void;
|
|
2087
|
-
/**
|
|
2088
|
-
* Unregister a root from the scheduler.
|
|
2089
|
-
* Cleans up all job state listeners for this root's jobs.
|
|
2090
|
-
* The last root to unregister stops the RAF loop.
|
|
2091
|
-
* @param {string} id - The root ID to unregister
|
|
2092
|
-
* @returns {void}
|
|
2093
|
-
*/
|
|
2094
|
-
unregisterRoot(id: string): void;
|
|
2095
|
-
/**
|
|
2096
|
-
* Subscribe to be notified when a root becomes available.
|
|
2097
|
-
* Fires immediately if a root already exists.
|
|
2098
|
-
* @param {() => void} callback - Function called when first root registers
|
|
2099
|
-
* @returns {() => void} Unsubscribe function
|
|
2100
|
-
*/
|
|
2101
|
-
onRootReady(callback: () => void): () => void;
|
|
2102
|
-
/**
|
|
2103
|
-
* Notify all registered root-ready callbacks.
|
|
2104
|
-
* Called when the first root registers.
|
|
2105
|
-
* @returns {void}
|
|
2106
|
-
* @private
|
|
2107
|
-
*/
|
|
2108
|
-
private notifyRootReady;
|
|
2109
|
-
/**
|
|
2110
|
-
* Ensure a default root exists for independent mode.
|
|
2111
|
-
* Creates a minimal root with no state provider.
|
|
2112
|
-
* @returns {void}
|
|
2113
|
-
* @private
|
|
2114
|
-
*/
|
|
2115
|
-
private ensureDefaultRoot;
|
|
2116
|
-
/**
|
|
2117
|
-
* Trigger error handling for job errors.
|
|
2118
|
-
* Uses the bound error handler if available, otherwise logs to console.
|
|
2119
|
-
* @param {Error} error - The error to handle
|
|
2120
|
-
* @returns {void}
|
|
2121
|
-
*/
|
|
2122
|
-
triggerError(error: Error): void;
|
|
2123
|
-
/**
|
|
2124
|
-
* Add a named phase to the scheduler's execution order.
|
|
2125
|
-
* Marks all roots for rebuild to incorporate the new phase.
|
|
2126
|
-
* @param {string} name - The phase name (e.g., 'physics', 'postprocess')
|
|
2127
|
-
* @param {AddPhaseOptions} [options] - Positioning options (before/after other phases)
|
|
2128
|
-
* @returns {void}
|
|
2129
|
-
* @example
|
|
2130
|
-
* scheduler.addPhase('physics', { before: 'update' });
|
|
2131
|
-
* scheduler.addPhase('postprocess', { after: 'render' });
|
|
2132
|
-
*/
|
|
2133
|
-
addPhase(name: string, options?: AddPhaseOptions): void;
|
|
2134
|
-
/**
|
|
2135
|
-
* Check if a phase exists in the scheduler.
|
|
2136
|
-
* @param {string} name - The phase name to check
|
|
2137
|
-
* @returns {boolean} True if the phase exists
|
|
2138
|
-
*/
|
|
2139
|
-
hasPhase(name: string): boolean;
|
|
2140
|
-
/**
|
|
2141
|
-
* Register a global job that runs once per frame (not per-root).
|
|
2142
|
-
* Used internally by deprecated addEffect/addAfterEffect APIs.
|
|
2143
|
-
* @param {'before' | 'after'} phase - When to run: 'before' all roots or 'after' all roots
|
|
2144
|
-
* @param {string} id - Unique identifier for this global job
|
|
2145
|
-
* @param {(timestamp: number) => void} callback - Function called each frame with RAF timestamp
|
|
2146
|
-
* @returns {() => void} Unsubscribe function to remove this global job
|
|
2147
|
-
* @deprecated Use useFrame with phases instead
|
|
2148
|
-
*/
|
|
2149
|
-
registerGlobal(phase: 'before' | 'after', id: string, callback: (timestamp: number) => void): () => void;
|
|
2150
|
-
/**
|
|
2151
|
-
* Register an idle callback that fires when the loop stops.
|
|
2152
|
-
* Used internally by deprecated addTail API.
|
|
2153
|
-
* @param {(timestamp: number) => void} callback - Function called when loop becomes idle
|
|
2154
|
-
* @returns {() => void} Unsubscribe function to remove this idle callback
|
|
2155
|
-
* @deprecated Use demand mode with invalidate() instead
|
|
2156
|
-
*/
|
|
2157
|
-
onIdle(callback: (timestamp: number) => void): () => void;
|
|
2158
|
-
/**
|
|
2159
|
-
* Notify all registered idle callbacks.
|
|
2160
|
-
* Called when the loop stops in demand mode.
|
|
2161
|
-
* @param {number} timestamp - The RAF timestamp when idle occurred
|
|
2162
|
-
* @returns {void}
|
|
2163
|
-
* @private
|
|
2164
|
-
*/
|
|
2165
|
-
private notifyIdle;
|
|
2166
|
-
/**
|
|
2167
|
-
* Register a job (frame callback) with a specific root.
|
|
2168
|
-
* This is the core registration method used by useFrame internally.
|
|
2169
|
-
* @param {FrameNextCallback} callback - The function to call each frame
|
|
2170
|
-
* @param {JobOptions & { rootId?: string; system?: boolean }} [options] - Job configuration
|
|
2171
|
-
* @param {string} [options.rootId] - Target root ID (defaults to first registered root)
|
|
2172
|
-
* @param {string} [options.id] - Unique job ID (auto-generated if not provided)
|
|
2173
|
-
* @param {string} [options.phase] - Execution phase (defaults to 'update')
|
|
2174
|
-
* @param {number} [options.priority] - Priority within phase (higher = earlier, default 0)
|
|
2175
|
-
* @param {number} [options.fps] - FPS throttle limit
|
|
2176
|
-
* @param {boolean} [options.drop] - Drop frames when behind (default true)
|
|
2177
|
-
* @param {boolean} [options.enabled] - Whether job is active (default true)
|
|
2178
|
-
* @param {boolean} [options.system] - Internal flag for system jobs (not user-facing)
|
|
2179
|
-
* @returns {() => void} Unsubscribe function to remove this job
|
|
2180
|
-
*/
|
|
2181
|
-
register(callback: FrameNextCallback, options?: JobOptions & {
|
|
2182
|
-
rootId?: string;
|
|
2183
|
-
system?: boolean;
|
|
2184
|
-
}): () => void;
|
|
2185
|
-
/**
|
|
2186
|
-
* Unregister a job by its ID.
|
|
2187
|
-
* Searches all roots if rootId is not provided.
|
|
2188
|
-
* @param {string} id - The job ID to unregister
|
|
2189
|
-
* @param {string} [rootId] - Optional root ID to search (searches all if not provided)
|
|
2190
|
-
* @returns {void}
|
|
2191
|
-
*/
|
|
2192
|
-
unregister(id: string, rootId?: string): void;
|
|
2193
|
-
/**
|
|
2194
|
-
* Update a job's options dynamically.
|
|
2195
|
-
* Searches all roots to find the job by ID.
|
|
2196
|
-
* Phase/constraint changes trigger a rebuild of the sorted job list.
|
|
2197
|
-
* @param {string} id - The job ID to update
|
|
2198
|
-
* @param {Partial<JobOptions>} options - The options to update
|
|
2199
|
-
* @returns {void}
|
|
2200
|
-
*/
|
|
2201
|
-
updateJob(id: string, options: Partial<JobOptions>): void;
|
|
2202
|
-
/**
|
|
2203
|
-
* Check if a job is currently paused (disabled).
|
|
2204
|
-
* @param {string} id - The job ID to check
|
|
2205
|
-
* @returns {boolean} True if the job exists and is paused
|
|
2206
|
-
*/
|
|
2207
|
-
isJobPaused(id: string): boolean;
|
|
2208
|
-
/**
|
|
2209
|
-
* Subscribe to state changes for a specific job.
|
|
2210
|
-
* Listener is called when job is paused or resumed.
|
|
2211
|
-
* @param {string} id - The job ID to subscribe to
|
|
2212
|
-
* @param {() => void} listener - Callback invoked on state changes
|
|
2213
|
-
* @returns {() => void} Unsubscribe function
|
|
2214
|
-
*/
|
|
2215
|
-
subscribeJobState(id: string, listener: () => void): () => void;
|
|
2216
|
-
/**
|
|
2217
|
-
* Notify all listeners that a job's state has changed.
|
|
2218
|
-
* @param {string} id - The job ID that changed
|
|
2219
|
-
* @returns {void}
|
|
2220
|
-
* @private
|
|
2221
|
-
*/
|
|
2222
|
-
private notifyJobStateChange;
|
|
2223
|
-
/**
|
|
2224
|
-
* Pause a job by ID (sets enabled=false).
|
|
2225
|
-
* Notifies any subscribed state listeners.
|
|
2226
|
-
* @param {string} id - The job ID to pause
|
|
2227
|
-
* @returns {void}
|
|
2228
|
-
*/
|
|
2229
|
-
pauseJob(id: string): void;
|
|
2230
|
-
/**
|
|
2231
|
-
* Resume a paused job by ID (sets enabled=true).
|
|
2232
|
-
* Resets job timing to prevent frame accumulation.
|
|
2233
|
-
* Notifies any subscribed state listeners.
|
|
2234
|
-
* @param {string} id - The job ID to resume
|
|
2235
|
-
* @returns {void}
|
|
2236
|
-
*/
|
|
2237
|
-
resumeJob(id: string): void;
|
|
2238
|
-
/**
|
|
2239
|
-
* Start the requestAnimationFrame loop.
|
|
2240
|
-
* Resets timing state (elapsedTime, frameCount) on start.
|
|
2241
|
-
* No-op if already running.
|
|
2242
|
-
* @returns {void}
|
|
2243
|
-
*/
|
|
2244
|
-
start(): void;
|
|
2245
|
-
/**
|
|
2246
|
-
* Stop the requestAnimationFrame loop.
|
|
2247
|
-
* Cancels any pending RAF callback.
|
|
2248
|
-
* No-op if not running.
|
|
2249
|
-
* @returns {void}
|
|
2250
|
-
*/
|
|
2251
|
-
stop(): void;
|
|
2252
|
-
/**
|
|
2253
|
-
* Request frames to be rendered in demand mode.
|
|
2254
|
-
* Accumulates pending frames (capped at 60) and starts the loop if not running.
|
|
2255
|
-
* No-op if frameloop is not 'demand'.
|
|
2256
|
-
* @param {number} [frames=1] - Number of frames to request
|
|
2257
|
-
* @param {boolean} [stackFrames=false] - Whether to add frames to existing pending count
|
|
2258
|
-
* - `false` (default): Sets pending frames to the specified value (replaces existing count)
|
|
2259
|
-
* - `true`: Adds frames to existing pending count (useful for accumulating invalidations)
|
|
2260
|
-
* @returns {void}
|
|
2261
|
-
* @example
|
|
2262
|
-
* // Request a single frame render
|
|
2263
|
-
* scheduler.invalidate();
|
|
2264
|
-
*
|
|
2265
|
-
* @example
|
|
2266
|
-
* // Request 5 frames (e.g., for animations)
|
|
2267
|
-
* scheduler.invalidate(5);
|
|
2268
|
-
*
|
|
2269
|
-
* @example
|
|
2270
|
-
* // Set pending frames to exactly 3 (don't stack with existing)
|
|
2271
|
-
* scheduler.invalidate(3, false);
|
|
2272
|
-
*
|
|
2273
|
-
* @example
|
|
2274
|
-
* // Add 2 more frames to existing pending count
|
|
2275
|
-
* scheduler.invalidate(2, true);
|
|
2276
|
-
*/
|
|
2277
|
-
invalidate(frames?: number, stackFrames?: boolean): void;
|
|
2278
|
-
/**
|
|
2279
|
-
* Reset timing state for deterministic testing.
|
|
2280
|
-
* Preserves jobs and roots but resets lastTime, frameCount, elapsedTime, etc.
|
|
2281
|
-
* @returns {void}
|
|
2282
|
-
*/
|
|
2283
|
-
resetTiming(): void;
|
|
2284
|
-
/**
|
|
2285
|
-
* Manually execute a single frame for all roots.
|
|
2286
|
-
* Useful for frameloop='never' mode or testing scenarios.
|
|
2287
|
-
* @param {number} [timestamp] - Optional timestamp (defaults to performance.now())
|
|
2288
|
-
* @returns {void}
|
|
2289
|
-
* @example
|
|
2290
|
-
* // Manual control mode
|
|
2291
|
-
* scheduler.frameloop = 'never';
|
|
2292
|
-
* scheduler.step(); // Execute one frame
|
|
2293
|
-
*/
|
|
2294
|
-
step(timestamp?: number): void;
|
|
2295
|
-
/**
|
|
2296
|
-
* Manually execute a single job by its ID.
|
|
2297
|
-
* Useful for testing individual job callbacks in isolation.
|
|
2298
|
-
* @param {string} id - The job ID to step
|
|
2299
|
-
* @param {number} [timestamp] - Optional timestamp (defaults to performance.now())
|
|
2300
|
-
* @returns {void}
|
|
2301
|
-
*/
|
|
2302
|
-
stepJob(id: string, timestamp?: number): void;
|
|
2303
|
-
/**
|
|
2304
|
-
* Main RAF loop callback.
|
|
2305
|
-
* Executes frame, handles demand mode, and schedules next frame.
|
|
2306
|
-
* @param {number} timestamp - RAF timestamp in milliseconds
|
|
2307
|
-
* @returns {void}
|
|
2308
|
-
* @private
|
|
2309
|
-
*/
|
|
2310
|
-
private loop;
|
|
2311
|
-
/**
|
|
2312
|
-
* Execute a single frame across all roots.
|
|
2313
|
-
* Order: globalBefore → each root's jobs → globalAfter
|
|
2314
|
-
* @param {number} timestamp - RAF timestamp in milliseconds
|
|
2315
|
-
* @returns {void}
|
|
2316
|
-
* @private
|
|
2317
|
-
*/
|
|
2318
|
-
private executeFrame;
|
|
2319
|
-
/**
|
|
2320
|
-
* Run all global jobs from a job map.
|
|
2321
|
-
* Catches and logs errors without stopping execution.
|
|
2322
|
-
* @param {Map<string, GlobalJob>} jobs - The global jobs map to execute
|
|
2323
|
-
* @param {number} timestamp - RAF timestamp in milliseconds
|
|
2324
|
-
* @returns {void}
|
|
2325
|
-
* @private
|
|
2326
|
-
*/
|
|
2327
|
-
private runGlobalJobs;
|
|
2328
|
-
/**
|
|
2329
|
-
* Execute all jobs for a single root in sorted order.
|
|
2330
|
-
* Rebuilds sorted job list if needed, then dispatches each job.
|
|
2331
|
-
* Errors are caught and propagated via triggerError.
|
|
2332
|
-
* @param {RootEntry} root - The root entry to tick
|
|
2333
|
-
* @param {number} timestamp - RAF timestamp in milliseconds
|
|
2334
|
-
* @param {number} delta - Time since last frame in seconds
|
|
2335
|
-
* @returns {void}
|
|
2336
|
-
* @private
|
|
2337
|
-
*/
|
|
2338
|
-
private tickRoot;
|
|
2339
|
-
/**
|
|
2340
|
-
* Get the total number of registered jobs across all roots.
|
|
2341
|
-
* Includes both per-root jobs and global before/after jobs.
|
|
2342
|
-
* @returns {number} Total job count
|
|
2343
|
-
*/
|
|
2344
|
-
getJobCount(): number;
|
|
2345
|
-
/**
|
|
2346
|
-
* Get all registered job IDs across all roots.
|
|
2347
|
-
* Includes both per-root jobs and global before/after jobs.
|
|
2348
|
-
* @returns {string[]} Array of all job IDs
|
|
2349
|
-
*/
|
|
2350
|
-
getJobIds(): string[];
|
|
2351
|
-
/**
|
|
2352
|
-
* Get the number of registered roots (Canvas instances).
|
|
2353
|
-
* @returns {number} Number of registered roots
|
|
2354
|
-
*/
|
|
2355
|
-
getRootCount(): number;
|
|
2356
|
-
/**
|
|
2357
|
-
* Check if any user (non-system) jobs are registered in a specific phase.
|
|
2358
|
-
* Used by the default render job to know if a user has taken over rendering.
|
|
2359
|
-
*
|
|
2360
|
-
* @param phase The phase to check
|
|
2361
|
-
* @param rootId Optional root ID to check (checks all roots if not provided)
|
|
2362
|
-
* @returns true if any user jobs exist in the phase
|
|
2363
|
-
*/
|
|
2364
|
-
hasUserJobsInPhase(phase: string, rootId?: string): boolean;
|
|
2365
|
-
/**
|
|
2366
|
-
* Generate a unique root ID for automatic root registration.
|
|
2367
|
-
* @returns {string} A unique root ID in the format 'root_N'
|
|
2368
|
-
*/
|
|
2369
|
-
generateRootId(): string;
|
|
2370
|
-
/**
|
|
2371
|
-
* Generate a unique job ID.
|
|
2372
|
-
* @returns {string} A unique job ID in the format 'job_N'
|
|
2373
|
-
* @private
|
|
2374
|
-
*/
|
|
2375
|
-
private generateJobId;
|
|
2376
|
-
/**
|
|
2377
|
-
* Normalize before/after constraints to a Set.
|
|
2378
|
-
* Handles undefined, single string, or array inputs.
|
|
2379
|
-
* @param {string | string[] | undefined} value - The constraint value(s)
|
|
2380
|
-
* @returns {Set<string>} Normalized Set of constraint strings
|
|
2381
|
-
* @private
|
|
2382
|
-
*/
|
|
2383
|
-
private normalizeConstraints;
|
|
2384
|
-
}
|
|
2385
|
-
/**
|
|
2386
|
-
* Get the global scheduler instance.
|
|
2387
|
-
* Creates one if it doesn't exist.
|
|
2388
|
-
*/
|
|
2389
|
-
declare const getScheduler: () => Scheduler;
|
|
2390
|
-
|
|
2391
1893
|
/**
|
|
2392
1894
|
* Frame hook with phase-based ordering, priority, and FPS throttling.
|
|
2393
1895
|
*
|
|
2394
|
-
*
|
|
2395
|
-
* - Inside Canvas: Full RootState (
|
|
2396
|
-
* - Outside Canvas
|
|
2397
|
-
*
|
|
1896
|
+
* Always delivers full RootState — works both inside and outside Canvas context:
|
|
1897
|
+
* - Inside Canvas: Full RootState (renderer, scene, camera, etc.)
|
|
1898
|
+
* - Outside Canvas: The job registers immediately but the callback is held until a
|
|
1899
|
+
* Canvas adopts it, then runs with full RootState. For hostless / standalone
|
|
1900
|
+
* frame loops with no Canvas, use `@pmndrs/scheduler` directly.
|
|
2398
1901
|
*
|
|
2399
1902
|
* Returns a controls object for manual stepping, pausing, and resuming.
|
|
2400
1903
|
*
|
|
2401
1904
|
* @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
|
|
2402
1905
|
* @param priorityOrOptions - Either a priority number (backwards compat) or options object
|
|
2403
|
-
* @returns Controls object with step(), stepAll(), pause(), resume(), isPaused, id, scheduler
|
|
1906
|
+
* @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
|
|
2404
1907
|
*
|
|
2405
1908
|
* @example
|
|
2406
1909
|
* // Simple priority (backwards compat)
|
|
@@ -2411,16 +1914,16 @@ declare const getScheduler: () => Scheduler;
|
|
|
2411
1914
|
* useFrame((state, delta) => { ... }, { phase: 'physics' })
|
|
2412
1915
|
*
|
|
2413
1916
|
* @example
|
|
2414
|
-
* // Outside Canvas - waits for Canvas
|
|
1917
|
+
* // Outside Canvas - callback waits for a Canvas, then always has full state
|
|
2415
1918
|
* function UI() {
|
|
2416
1919
|
* useFrame((state, delta) => { syncUI(state.camera) });
|
|
2417
1920
|
* return <button>...</button>;
|
|
2418
1921
|
* }
|
|
2419
1922
|
*
|
|
2420
1923
|
* @example
|
|
2421
|
-
* //
|
|
2422
|
-
* getScheduler
|
|
2423
|
-
*
|
|
1924
|
+
* // Hostless / standalone loop (no Canvas) - use @pmndrs/scheduler directly
|
|
1925
|
+
* import { getScheduler } from '@pmndrs/scheduler'
|
|
1926
|
+
* getScheduler().register((state, delta) => { updateGame(delta) })
|
|
2424
1927
|
*
|
|
2425
1928
|
* @example
|
|
2426
1929
|
* // Scheduler-only access (no callback)
|
|
@@ -2443,11 +1946,16 @@ type UseTextureOptions<Url extends string[] | string | Record<string, string>> =
|
|
|
2443
1946
|
/** Callback when texture(s) finish loading */
|
|
2444
1947
|
onLoad?: (texture: MappedTextureType<Url>) => void;
|
|
2445
1948
|
/**
|
|
2446
|
-
*
|
|
2447
|
-
* When true:
|
|
1949
|
+
* Register the texture(s) in R3F's global texture registry for access via useTextures().
|
|
1950
|
+
* When true (the default):
|
|
2448
1951
|
* - Textures persist until explicitly disposed
|
|
2449
|
-
* -
|
|
2450
|
-
*
|
|
1952
|
+
* - On mount, returns existing registered textures if available (preserving modifications like colorSpace)
|
|
1953
|
+
*
|
|
1954
|
+
* Reads are taken once at mount — a mounted `useTexture` does not re-render when the registry
|
|
1955
|
+
* changes. To react to registry swaps, use `useTextures(s => s.get(key))` instead.
|
|
1956
|
+
*
|
|
1957
|
+
* Pass `false` to opt out of registry enrollment entirely.
|
|
1958
|
+
* @default true
|
|
2451
1959
|
*/
|
|
2452
1960
|
cache?: boolean;
|
|
2453
1961
|
};
|
|
@@ -2471,15 +1979,18 @@ type UseTextureOptions<Url extends string[] | string | Record<string, string>> =
|
|
|
2471
1979
|
* normal: '/normal.png'
|
|
2472
1980
|
* })
|
|
2473
1981
|
*
|
|
2474
|
-
* //
|
|
2475
|
-
* //
|
|
2476
|
-
* const diffuse = useTexture('/diffuse.png'
|
|
1982
|
+
* // Textures are registered in the global registry by default — the same texture
|
|
1983
|
+
* // object is shared across components and modifications (colorSpace, wrapS, etc.) are preserved
|
|
1984
|
+
* const diffuse = useTexture('/diffuse.png')
|
|
2477
1985
|
* diffuse.colorSpace = THREE.SRGBColorSpace
|
|
2478
1986
|
*
|
|
2479
1987
|
* // Another component gets the SAME texture with colorSpace already set
|
|
2480
|
-
* const sameDiffuse = useTexture('/diffuse.png'
|
|
1988
|
+
* const sameDiffuse = useTexture('/diffuse.png')
|
|
2481
1989
|
*
|
|
2482
|
-
* //
|
|
1990
|
+
* // Opt out of registry enrollment for a one-off texture
|
|
1991
|
+
* const scratch = useTexture('/scratch.png', { cache: false })
|
|
1992
|
+
*
|
|
1993
|
+
* // Access the registry directly
|
|
2483
1994
|
* const { get } = useTextures()
|
|
2484
1995
|
* const cached = get('/diffuse.png')
|
|
2485
1996
|
* ```
|
|
@@ -2496,63 +2007,80 @@ declare const Texture: ({ children, input, onLoad, cache, }: {
|
|
|
2496
2007
|
cache?: boolean;
|
|
2497
2008
|
}) => react_jsx_runtime.JSX.Element;
|
|
2498
2009
|
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2010
|
+
/** Accepted shapes for a registry read: a single key, a list of keys, or a name→key map. */
|
|
2011
|
+
type TextureInput = string | string[] | Record<string, string>;
|
|
2012
|
+
/** Result of a `get()` read, mirroring the input shape. */
|
|
2013
|
+
type TextureResult<Input extends TextureInput> = Input extends string ? Texture$1 | undefined : Input extends string[] ? (Texture$1 | undefined)[] : {
|
|
2014
|
+
[K in keyof Input]: Texture$1 | undefined;
|
|
2502
2015
|
};
|
|
2016
|
+
/** Options for `dispose()`. */
|
|
2017
|
+
interface DisposeOptions {
|
|
2018
|
+
/** Dispose even if the texture still has active references (default false). */
|
|
2019
|
+
force?: boolean;
|
|
2020
|
+
}
|
|
2503
2021
|
interface UseTexturesReturn {
|
|
2504
|
-
/** Map
|
|
2505
|
-
|
|
2506
|
-
/**
|
|
2507
|
-
get
|
|
2508
|
-
/** Check
|
|
2509
|
-
has
|
|
2510
|
-
/**
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2022
|
+
/** The live registry Map (key → Texture). Treat as read-only. */
|
|
2023
|
+
readonly all: Map<string, Texture$1>;
|
|
2024
|
+
/** Read one texture, an array of textures, or a name→texture record (mirrors the input shape). */
|
|
2025
|
+
get<Input extends TextureInput>(input: Input): TextureResult<Input>;
|
|
2026
|
+
/** Check whether a key exists in the registry. */
|
|
2027
|
+
has(key: string): boolean;
|
|
2028
|
+
/**
|
|
2029
|
+
* Register a texture (or a record of textures) that has no URL — e.g. a render
|
|
2030
|
+
* target or procedural texture. URL-loaded textures are registered automatically
|
|
2031
|
+
* by `useTexture` (registry enrollment is on by default).
|
|
2032
|
+
*/
|
|
2033
|
+
add(key: string, texture: Texture$1): void;
|
|
2034
|
+
add(record: Record<string, Texture$1>): void;
|
|
2035
|
+
/**
|
|
2036
|
+
* Dispose a texture's GPU resources and remove it from the registry.
|
|
2037
|
+
* Refcount-aware: if the key is still in use by a mounted `useTexture` consumer it is
|
|
2038
|
+
* skipped (with a warning) unless `{ force: true }` is passed.
|
|
2039
|
+
* @returns true if disposed, false if skipped.
|
|
2040
|
+
*/
|
|
2041
|
+
dispose(key: string, options?: DisposeOptions): boolean;
|
|
2042
|
+
/** Dispose every texture in the registry and clear it. Use on scene teardown. */
|
|
2043
|
+
disposeAll(): void;
|
|
2524
2044
|
}
|
|
2525
2045
|
/**
|
|
2526
|
-
*
|
|
2046
|
+
* Reactive Texture registry — load once with `useTexture`, reach the textures from anywhere.
|
|
2527
2047
|
*
|
|
2528
|
-
*
|
|
2529
|
-
*
|
|
2048
|
+
* This is a registry of plain `Texture` objects (not TSL nodes), so the same texture can feed
|
|
2049
|
+
* a material map, a heightmap sampler, or anything else. It does **not** load — pair it with
|
|
2050
|
+
* `useTexture` for loading (registry enrollment is on by default); `useTextures` is for access and lifecycle.
|
|
2051
|
+
*
|
|
2052
|
+
* The returned handle is **reactive**: the calling component re-renders when the registry
|
|
2053
|
+
* changes. Pass a selector to scope the subscription to a single read.
|
|
2530
2054
|
*
|
|
2531
2055
|
* @example
|
|
2532
2056
|
* ```tsx
|
|
2533
|
-
*
|
|
2057
|
+
* // Load + register once (anywhere in the tree) — registered by default
|
|
2058
|
+
* useTexture({ map: '/diffuse.jpg', normalMap: '/normal.jpg' })
|
|
2534
2059
|
*
|
|
2535
|
-
* //
|
|
2536
|
-
*
|
|
2537
|
-
*
|
|
2538
|
-
* const tex = useTexture('/textures/diffuse.png', { cache: true })
|
|
2539
|
-
* }
|
|
2060
|
+
* // Reach them from another component — record form lands straight into a material
|
|
2061
|
+
* const { map, normalMap } = useTextures().get({ map: '/diffuse.jpg', normalMap: '/normal.jpg' })
|
|
2062
|
+
* return <meshStandardMaterial map={map} normalMap={normalMap} />
|
|
2540
2063
|
*
|
|
2541
|
-
* //
|
|
2542
|
-
* const
|
|
2543
|
-
* if (diffuse) material.map = diffuse
|
|
2064
|
+
* // A set of heightmaps at once
|
|
2065
|
+
* const [a, b, c] = useTextures().get(['/h0.png', '/h1.png', '/h2.png'])
|
|
2544
2066
|
*
|
|
2545
|
-
* //
|
|
2546
|
-
*
|
|
2067
|
+
* // Register a non-URL texture (render target / procedural)
|
|
2068
|
+
* useTextures().add('rt-main', renderTarget.texture)
|
|
2547
2069
|
*
|
|
2548
|
-
* //
|
|
2549
|
-
* dispose('/
|
|
2550
|
-
*
|
|
2551
|
-
* // Nuclear option - dispose everything
|
|
2552
|
-
* disposeAll()
|
|
2070
|
+
* // Deliberate GPU cleanup (refcount-aware; force to override)
|
|
2071
|
+
* useTextures().dispose('/diffuse.jpg')
|
|
2072
|
+
* useTextures().disposeAll() // scene teardown
|
|
2553
2073
|
* ```
|
|
2074
|
+
*
|
|
2075
|
+
* @remarks
|
|
2076
|
+
* **Future expansion:** an imperative async loader (e.g. `await useTextures().load('/x.jpg')`) is
|
|
2077
|
+
* intentionally not included yet. It would let non-React code (loading screens, dynamic streaming)
|
|
2078
|
+
* populate the registry without Suspense, at the cost of putting loading back into this hook. It
|
|
2079
|
+
* will be added only if a concrete consumer needs imperative loading; for now, loading lives in
|
|
2080
|
+
* `useTexture`.
|
|
2554
2081
|
*/
|
|
2555
2082
|
declare function useTextures(): UseTexturesReturn;
|
|
2083
|
+
declare function useTextures<T>(selector: (registry: UseTexturesReturn) => T): T;
|
|
2556
2084
|
|
|
2557
2085
|
/**
|
|
2558
2086
|
* Creates a render target compatible with the current renderer.
|
|
@@ -2582,9 +2110,9 @@ declare function useTextures(): UseTexturesReturn;
|
|
|
2582
2110
|
* const fbo = useRenderTarget(512, 256, { samples: 4 })
|
|
2583
2111
|
* ```
|
|
2584
2112
|
*/
|
|
2585
|
-
declare function useRenderTarget(options?: RenderTargetOptions):
|
|
2586
|
-
declare function useRenderTarget(size: number, options?: RenderTargetOptions):
|
|
2587
|
-
declare function useRenderTarget(width: number, height: number, options?: RenderTargetOptions):
|
|
2113
|
+
declare function useRenderTarget(options?: RenderTargetOptions): WebGLRenderTarget;
|
|
2114
|
+
declare function useRenderTarget(size: number, options?: RenderTargetOptions): WebGLRenderTarget;
|
|
2115
|
+
declare function useRenderTarget(width: number, height: number, options?: RenderTargetOptions): WebGLRenderTarget;
|
|
2588
2116
|
|
|
2589
2117
|
/**
|
|
2590
2118
|
* Returns the R3F Canvas' Zustand store. Useful for [transient updates](https://github.com/pmndrs/zustand#transient-updates-for-often-occurring-state-changes).
|
|
@@ -2671,7 +2199,10 @@ declare function addTail(callback: GlobalRenderCallback): () => void;
|
|
|
2671
2199
|
* Invalidates the view, requesting a frame to be rendered.
|
|
2672
2200
|
* In demand mode, this triggers the scheduler to run frames.
|
|
2673
2201
|
*
|
|
2674
|
-
*
|
|
2202
|
+
* With a state argument, only that root's jobs run on the requested frames; other
|
|
2203
|
+
* roots on 'demand' stay idle. Without one, every registered root is invalidated.
|
|
2204
|
+
*
|
|
2205
|
+
* @param state - Optional root state; targets the invalidation at that root
|
|
2675
2206
|
* @param frames - Number of frames to request (default: 1)
|
|
2676
2207
|
* @param stackFrames - If false, sets pendingFrames to frames. If true, adds to existing pendingFrames (default: false)
|
|
2677
2208
|
*
|
|
@@ -2682,14 +2213,16 @@ declare function invalidate(state?: RootState, frames?: number, stackFrames?: bo
|
|
|
2682
2213
|
* Advances the frameloop and runs render effects.
|
|
2683
2214
|
* Useful for when manually rendering via `frameloop="never"`.
|
|
2684
2215
|
*
|
|
2216
|
+
* With a state argument, only that root is stepped. Without one, every
|
|
2217
|
+
* registered root is stepped for backwards compatibility.
|
|
2218
|
+
*
|
|
2685
2219
|
* @param timestamp - The timestamp to use for this frame
|
|
2686
2220
|
* @param runGlobalEffects - Ignored (kept for backwards compat, global effects always run)
|
|
2687
|
-
* @param state -
|
|
2688
|
-
* @param frame - Ignored (kept for backwards compat)
|
|
2221
|
+
* @param state - Optional root state; targets the manual step at that root
|
|
2689
2222
|
*
|
|
2690
2223
|
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
|
|
2691
2224
|
*/
|
|
2692
|
-
declare function advance(timestamp: number): void;
|
|
2225
|
+
declare function advance(timestamp: number, runGlobalEffects?: boolean, state?: RootState): void;
|
|
2693
2226
|
|
|
2694
2227
|
/* eslint-disable @definitelytyped/no-unnecessary-generics */
|
|
2695
2228
|
declare function ReactReconciler<
|
|
@@ -3760,11 +3293,6 @@ declare function flushSync<R>(fn: () => R): R;
|
|
|
3760
3293
|
declare const context: React$1.Context<RootStore>;
|
|
3761
3294
|
declare const createStore: (invalidate: (state?: RootState, frames?: number, stackFrames?: boolean) => void, advance: (timestamp: number, runGlobalEffects?: boolean, state?: RootState, frame?: XRFrame) => void) => RootStore;
|
|
3762
3295
|
|
|
3763
|
-
/**
|
|
3764
|
-
* Safely flush async effects when testing, simulating a legacy root.
|
|
3765
|
-
* @deprecated Import from React instead. import { act } from 'react'
|
|
3766
|
-
*/
|
|
3767
|
-
declare const act: typeof React$1.act;
|
|
3768
3296
|
/**
|
|
3769
3297
|
* An SSR-friendly useLayoutEffect.
|
|
3770
3298
|
*
|
|
@@ -4248,5 +3776,5 @@ declare function isOnce(value: unknown): value is {
|
|
|
4248
3776
|
*/
|
|
4249
3777
|
declare function Canvas(props: CanvasProps): react_jsx_runtime.JSX.Element;
|
|
4250
3778
|
|
|
4251
|
-
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,
|
|
4252
|
-
export type { Act,
|
|
3779
|
+
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 };
|
|
3780
|
+
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, LegacyInternalState as 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, LegacyRenderer as R3FRenderer, RaycastableRepresentation, ReactProps, ReconcilerRoot, RenderCallback, RenderProps, RenderTargetOptions, Renderer, RendererConfigExtended, RendererFactory, RendererProps, Root, LegacyRootState as 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 };
|