@react-three/fiber 10.0.0-canary.9b237a7 → 10.0.0-canary.a9bd42a
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/extension.cjs +2 -1
- package/dist/extension.d.cts +9 -46
- package/dist/extension.d.mts +9 -46
- package/dist/extension.d.ts +9 -46
- package/dist/extension.mjs +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +7 -8
- package/dist/index.d.mts +7 -8
- package/dist/index.d.ts +7 -8
- package/dist/index.mjs +3 -3
- package/dist/legacy.cjs +2 -2
- package/dist/legacy.d.cts +4 -4
- package/dist/legacy.d.mts +4 -4
- package/dist/legacy.d.ts +4 -4
- package/dist/legacy.mjs +4 -4
- package/dist/shared/{fiber.D9zziEOb.mjs → fiber.B0oukOFO.mjs} +28 -1
- package/dist/shared/fiber.BU0vBHc9.d.mts +48 -0
- package/dist/shared/{fiber.DAg-9ieU.d.ts → fiber.BY6Yf1h-.d.cts} +37 -98
- package/dist/shared/{fiber.Ddgoyqql.d.mts → fiber.Cu2hX1IM.d.mts} +37 -98
- package/dist/shared/fiber.Cx-UAmMb.d.ts +48 -0
- package/dist/shared/fiber.DAl4H27x.d.cts +48 -0
- package/dist/shared/{fiber.DiPB625B.d.cts → fiber.DXw-SLsH.d.ts} +37 -98
- package/dist/shared/{fiber.Bw8YnGg5.d.cts → fiber.I5Q4dVvl.d.cts} +81 -4
- package/dist/shared/{fiber.Bw8YnGg5.d.mts → fiber.I5Q4dVvl.d.mts} +81 -4
- package/dist/shared/{fiber.Bw8YnGg5.d.ts → fiber.I5Q4dVvl.d.ts} +81 -4
- package/dist/shared/{fiber.D9dtW9DT.cjs → fiber.khFlPHPf.cjs} +30 -0
- package/dist/shared/{fiber.COk97oyZ.cjs → fiber.oKEFddXj.cjs} +6085 -5155
- package/dist/shared/{fiber.COTqIf4o.mjs → fiber.tsM9NKZ9.mjs} +6076 -5146
- package/dist/webgpu/index.cjs +2 -2
- package/dist/webgpu/index.d.cts +4 -5
- package/dist/webgpu/index.d.mts +4 -5
- package/dist/webgpu/index.d.ts +4 -5
- package/dist/webgpu/index.mjs +4 -4
- package/package.json +6 -6
- package/readme.md +1 -1
package/dist/legacy.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { x as useRenderTarget$1, c as createRoot$1, C as Canvas$1 } from './shared/fiber.
|
|
3
|
-
export { k as Environment, i as EnvironmentCube, E as EnvironmentMap, j as EnvironmentPortal, ai as FROM_REF, I as IsObject, al as ONCE, P as Portal, R as REACT_INTERNAL_PROPS, Y as RESERVED_PROPS, T as Texture, _ as _roots, A as addAfterEffect, z as addEffect, B as addTail, F as advance, a2 as applyProps, $ as attach, S as buildGraph, a3 as calculateDpr, m as createEvents, a as createPointerEvents, L as createPortal, N as createStore, a0 as detach, a1 as diffProps, U as dispose, a as events, G as extend, O as findInitialRoot, M as flushSync, aj as fromRef, V as getInstanceProps, b as getPrimary, f as getPrimaryIds, Q as getRootState, g as getThree, a4 as getUuidPrefix, ah as hasConstructor, e as hasPrimary, h as hasThree, D as invalidate, X as invalidateInstance, a7 as is, aa as isColorRepresentation, ag as isCopyable, ak as isFromRef, ad as isLayers, ab as isObject3D, an as isOnce, a8 as isOrthographicCamera, a9 as isRef, J as isRenderer, ac as isTexture, ae as isUniform, af as isVectorLike, am as once, W as prepare, p as presetsObj, H as reconciler, r as registerPrimary, l as removeInteractivity, Z as resolve, s as swapInteractivity, K as unmountComponentAtNode, u as unregisterPrimary, a5 as updateCamera, a6 as updateFrustum, y as useEnvironment, o as useGraph, n as useInstanceHandle, q as useLoader, t as useTexture, v as useTextures, d as waitForPrimary, w as whenThree } from './shared/fiber.
|
|
2
|
+
import { x as useRenderTarget$1, c as createRoot$1, C as Canvas$1 } from './shared/fiber.tsM9NKZ9.mjs';
|
|
3
|
+
export { k as Environment, i as EnvironmentCube, E as EnvironmentMap, j as EnvironmentPortal, ai as FROM_REF, I as IsObject, al as ONCE, P as Portal, R as REACT_INTERNAL_PROPS, Y as RESERVED_PROPS, T as Texture, _ as _roots, A as addAfterEffect, z as addEffect, B as addTail, F as advance, a2 as applyProps, $ as attach, S as buildGraph, a3 as calculateDpr, m as createEvents, a as createPointerEvents, L as createPortal, N as createStore, a0 as detach, a1 as diffProps, U as dispose, a as events, G as extend, O as findInitialRoot, M as flushSync, aj as fromRef, V as getInstanceProps, b as getPrimary, f as getPrimaryIds, Q as getRootState, g as getThree, a4 as getUuidPrefix, ah as hasConstructor, e as hasPrimary, h as hasThree, D as invalidate, X as invalidateInstance, a7 as is, aa as isColorRepresentation, ag as isCopyable, ak as isFromRef, ad as isLayers, ab as isObject3D, an as isOnce, a8 as isOrthographicCamera, a9 as isRef, J as isRenderer, ac as isTexture, ae as isUniform, af as isVectorLike, am as once, W as prepare, p as presetsObj, H as reconciler, r as registerPrimary, l as removeInteractivity, Z as resolve, s as swapInteractivity, K as unmountComponentAtNode, u as unregisterPrimary, a5 as updateCamera, a6 as updateFrustum, y as useEnvironment, o as useGraph, n as useInstanceHandle, q as useLoader, t as useTexture, v as useTextures, d as waitForPrimary, w as whenThree } from './shared/fiber.tsM9NKZ9.mjs';
|
|
4
4
|
import { webglSupport } from './chunks/webgl.mjs';
|
|
5
|
-
import { a as useThree$1, b as useFrame$1 } from './shared/fiber.
|
|
6
|
-
export { B as Block, E as ErrorBoundary, c as context, r as registerRootExtension, s as setRenderOverride, f as useBridge, d as useIsomorphicLayoutEffect, e as useMutableCallback, u as useStore } from './shared/fiber.
|
|
5
|
+
import { a as useThree$1, b as useFrame$1 } from './shared/fiber.B0oukOFO.mjs';
|
|
6
|
+
export { B as Block, E as ErrorBoundary, c as context, r as registerRootExtension, s as setRenderOverride, f as useBridge, d as useIsomorphicLayoutEffect, e as useMutableCallback, u as useStore } from './shared/fiber.B0oukOFO.mjs';
|
|
7
7
|
export { Scheduler, getScheduler } from '@pmndrs/scheduler';
|
|
8
8
|
|
|
9
9
|
const R3F_BUILD_LEGACY = true;
|
|
@@ -284,6 +284,33 @@ function useFrame(callback, priorityOrOptions) {
|
|
|
284
284
|
return controls;
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
+
const R3F_STAGED_TEXTURES = Symbol.for("@react-three/fiber.stagedTextures");
|
|
288
|
+
const globalStaging = globalThis;
|
|
289
|
+
const staging = globalStaging[R3F_STAGED_TEXTURES] ?? (globalStaging[R3F_STAGED_TEXTURES] = /* @__PURE__ */ new WeakMap());
|
|
290
|
+
function stageTextures(store, entries) {
|
|
291
|
+
const registered = store.getState().textures;
|
|
292
|
+
let staged = staging.get(store);
|
|
293
|
+
for (const [url, texture] of entries) {
|
|
294
|
+
if (registered.has(url)) continue;
|
|
295
|
+
if (!staged) staging.set(store, staged = /* @__PURE__ */ new Map());
|
|
296
|
+
staged.set(url, texture);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function unstageTextures(store, urls) {
|
|
300
|
+
const staged = staging.get(store);
|
|
301
|
+
if (!staged) return;
|
|
302
|
+
for (const url of urls) staged.delete(url);
|
|
303
|
+
if (staged.size === 0) staging.delete(store);
|
|
304
|
+
}
|
|
305
|
+
function getTextureView(store) {
|
|
306
|
+
const registered = store.getState().textures;
|
|
307
|
+
const staged = staging.get(store);
|
|
308
|
+
if (!staged) return registered;
|
|
309
|
+
const view = new Map(registered);
|
|
310
|
+
for (const [url, texture] of staged) if (!view.has(url)) view.set(url, texture);
|
|
311
|
+
return view;
|
|
312
|
+
}
|
|
313
|
+
|
|
287
314
|
const R3F_EXTENSIONS = Symbol.for("@react-three/fiber.extensions");
|
|
288
315
|
function getRegistry() {
|
|
289
316
|
return globalThis[R3F_EXTENSIONS] ?? (globalThis[R3F_EXTENSIONS] = {
|
|
@@ -334,4 +361,4 @@ function notifyRootExtensionsHmr(store) {
|
|
|
334
361
|
for (const setUpBy of applied.values()) current(registry, setUpBy).hmr?.(store);
|
|
335
362
|
}
|
|
336
363
|
|
|
337
|
-
export { Block as B, ErrorBoundary as E, useThree as a, useFrame as b, context as c, useIsomorphicLayoutEffect as d, useMutableCallback as e, useBridge as f,
|
|
364
|
+
export { Block as B, ErrorBoundary as E, useThree as a, useFrame as b, context as c, useIsomorphicLayoutEffect as d, useMutableCallback as e, useBridge as f, getTextureView as g, unstageTextures as h, stageTextures as i, detachRootExtensions as j, attachRootExtensions as k, notifyAlpha as l, notifyRootExtensionsHmr as m, notifyDepreciated as n, registerRootExtension as r, setRenderOverride as s, useStore as u };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { a3 as FrameNextCallback } from './fiber.I5Q4dVvl.mjs';
|
|
2
|
+
import { UseFrameNextOptions, FrameNextControls } from '@pmndrs/scheduler';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Frame hook with phase-based ordering, priority, and FPS throttling.
|
|
6
|
+
*
|
|
7
|
+
* Always delivers full RootState — works both inside and outside Canvas context:
|
|
8
|
+
* - Inside Canvas: Full RootState (renderer, scene, camera, etc.)
|
|
9
|
+
* - Outside Canvas: The job registers immediately but the callback is held until a
|
|
10
|
+
* Canvas adopts it, then runs with full RootState. For hostless / standalone
|
|
11
|
+
* frame loops with no Canvas, use `@pmndrs/scheduler` directly.
|
|
12
|
+
*
|
|
13
|
+
* Returns a controls object for manual stepping, pausing, and resuming.
|
|
14
|
+
*
|
|
15
|
+
* @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
|
|
16
|
+
* @param priorityOrOptions - Either a priority number (backwards compat) or options object
|
|
17
|
+
* @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Simple priority (backwards compat)
|
|
21
|
+
* useFrame((state, delta) => { ... }, 5)
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // With phase-based ordering
|
|
25
|
+
* useFrame((state, delta) => { ... }, { phase: 'physics' })
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Outside Canvas - callback waits for a Canvas, then always has full state
|
|
29
|
+
* function UI() {
|
|
30
|
+
* useFrame((state, delta) => { syncUI(state.camera) });
|
|
31
|
+
* return <button>...</button>;
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Hostless / standalone loop (no Canvas) - use @pmndrs/scheduler directly
|
|
36
|
+
* import { getScheduler } from '@pmndrs/scheduler'
|
|
37
|
+
* getScheduler().register((state, delta) => { updateGame(delta) })
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // Scheduler-only access (no callback)
|
|
41
|
+
* const { scheduler } = useFrame()
|
|
42
|
+
* scheduler.pauseJob('some-job-id')
|
|
43
|
+
*
|
|
44
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/hooks#useframe
|
|
45
|
+
*/
|
|
46
|
+
declare function useFrame(callback?: FrameNextCallback, priorityOrOptions?: number | UseFrameNextOptions): FrameNextControls;
|
|
47
|
+
|
|
48
|
+
export { useFrame as u };
|
|
@@ -2,10 +2,9 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import { ReactNode, Component, RefObject, JSX } from 'react';
|
|
3
3
|
import { Options } from 'react-use-measure';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { ColorRepresentation, Euler as Euler$1, Loader, RenderTargetOptions as RenderTargetOptions$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D } from 'three';
|
|
6
|
+
import { J as Properties, c as Size, F as Frameloop, e as Performance, D as Dpr, g as RootStore, p as EventManager, f as RootState, n as ComputeFunction, C as ConstructorRepresentation, _ as ObjectMap, I as InternalState, M as Mutable, O as Overwrite, y as Args, l as EventHandlers, B as InstanceProps, k as DomEvent, G as Instance, x as Catalogue, v as Root, a6 as ThreeCore, W as Bridge, Z as UnblockProps, a0 as Disposable, Q as ThreeCamera, $ as EquConfig } from './fiber.I5Q4dVvl.cjs';
|
|
7
7
|
import { WebGPURenderer, WebGPURendererParameters } from 'three/webgpu';
|
|
8
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
8
|
|
|
10
9
|
//* Base Renderer Types =====================================
|
|
11
10
|
|
|
@@ -235,83 +234,6 @@ type InjectState = Partial<
|
|
|
235
234
|
}
|
|
236
235
|
>
|
|
237
236
|
|
|
238
|
-
//* Reconciler Types ==============================
|
|
239
|
-
|
|
240
|
-
// FiberRoot is an opaque internal React type - we define it locally
|
|
241
|
-
// to avoid bundling @types/react-reconciler which causes absolute path issues
|
|
242
|
-
type FiberRoot = any
|
|
243
|
-
|
|
244
|
-
interface Root {
|
|
245
|
-
fiber: FiberRoot
|
|
246
|
-
store: RootStore
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
type AttachFnType<O = any> = (parent: any, self: O) => () => void
|
|
250
|
-
type AttachType<O = any> = string | AttachFnType<O>
|
|
251
|
-
|
|
252
|
-
type ConstructorRepresentation<T = any> = new (...args: any[]) => T
|
|
253
|
-
|
|
254
|
-
interface Catalogue {
|
|
255
|
-
[name: string]: ConstructorRepresentation
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// TODO: handle constructor overloads
|
|
259
|
-
// https://github.com/pmndrs/react-three-fiber/pull/2931
|
|
260
|
-
// https://github.com/microsoft/TypeScript/issues/37079
|
|
261
|
-
type Args<T> = T extends ConstructorRepresentation
|
|
262
|
-
? T extends typeof Color$1
|
|
263
|
-
? [r: number, g: number, b: number] | [color: ColorRepresentation]
|
|
264
|
-
: ConstructorParameters<T>
|
|
265
|
-
: any[]
|
|
266
|
-
|
|
267
|
-
type ArgsProp<P> = P extends ConstructorRepresentation
|
|
268
|
-
? IsAllOptional<ConstructorParameters<P>> extends true
|
|
269
|
-
? { args?: Args<P> }
|
|
270
|
-
: { args: Args<P> }
|
|
271
|
-
: { args: unknown[] }
|
|
272
|
-
|
|
273
|
-
type InstanceProps<T = any, P = any> = ArgsProp<P> & {
|
|
274
|
-
object?: T
|
|
275
|
-
dispose?: null
|
|
276
|
-
attach?: AttachType<T>
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
interface Instance<O = any> {
|
|
280
|
-
root: RootStore
|
|
281
|
-
type: string
|
|
282
|
-
parent: Instance | null
|
|
283
|
-
children: Instance[]
|
|
284
|
-
props: InstanceProps<O> & Record<string, unknown>
|
|
285
|
-
object: O & { __r3f?: Instance<O> }
|
|
286
|
-
eventCount: number
|
|
287
|
-
handlers: Partial<EventHandlers>
|
|
288
|
-
attach?: AttachType<O>
|
|
289
|
-
previousAttach?: any
|
|
290
|
-
isHidden: boolean
|
|
291
|
-
/** Set of props that have been applied via once() */
|
|
292
|
-
appliedOnce?: Set<string>
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
interface HostConfig {
|
|
296
|
-
type: string
|
|
297
|
-
props: Instance['props']
|
|
298
|
-
container: RootStore
|
|
299
|
-
instance: Instance
|
|
300
|
-
textInstance: void
|
|
301
|
-
suspenseInstance: Instance
|
|
302
|
-
hydratableInstance: never
|
|
303
|
-
formInstance: never
|
|
304
|
-
publicInstance: Instance['object']
|
|
305
|
-
hostContext: {}
|
|
306
|
-
childSet: never
|
|
307
|
-
timeoutHandle: number | undefined
|
|
308
|
-
noTimeout: -1
|
|
309
|
-
TransitionStatus: null
|
|
310
|
-
}
|
|
311
|
-
declare global {
|
|
312
|
-
var IS_REACT_ACT_ENVIRONMENT: boolean | undefined
|
|
313
|
-
}
|
|
314
|
-
|
|
315
237
|
//* Loop Types ==============================
|
|
316
238
|
|
|
317
239
|
type GlobalRenderCallback = (timestamp: number) => void
|
|
@@ -875,7 +797,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
|
|
|
875
797
|
* </EnvironmentPortal>
|
|
876
798
|
* ```
|
|
877
799
|
*/
|
|
878
|
-
declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps):
|
|
800
|
+
declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): React$1.JSX.Element;
|
|
879
801
|
/**
|
|
880
802
|
* Sets up a global environment map for PBR materials and backgrounds.
|
|
881
803
|
* Affects scene.environment and optionally scene.background unless a custom scene is passed.
|
|
@@ -971,7 +893,7 @@ declare function EnvironmentPortal({ children, near, far, resolution, frames, ma
|
|
|
971
893
|
* />
|
|
972
894
|
* ```
|
|
973
895
|
*/
|
|
974
|
-
declare function Environment(props: EnvironmentProps):
|
|
896
|
+
declare function Environment(props: EnvironmentProps): React$1.JSX.Element;
|
|
975
897
|
|
|
976
898
|
/**
|
|
977
899
|
* Moves every trace of interactivity from one object to its replacement, for reconstruction.
|
|
@@ -1089,7 +1011,7 @@ declare const Texture: ({ children, input, onLoad, cache, }: {
|
|
|
1089
1011
|
input: Parameters<typeof useTexture>[0];
|
|
1090
1012
|
onLoad?: Parameters<typeof useTexture>[1];
|
|
1091
1013
|
cache?: boolean;
|
|
1092
|
-
}) =>
|
|
1014
|
+
}) => React$1.JSX.Element;
|
|
1093
1015
|
|
|
1094
1016
|
/** Accepted shapes for a registry read: a single key, a list of keys, or a name→key map. */
|
|
1095
1017
|
type TextureInput = string | string[] | Record<string, string>;
|
|
@@ -1876,7 +1798,8 @@ declare namespace ReactReconciler {
|
|
|
1876
1798
|
type LanePriority = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17;
|
|
1877
1799
|
|
|
1878
1800
|
type Lanes = number;
|
|
1879
|
-
|
|
1801
|
+
|
|
1802
|
+
type Lane = number & { __LaneBrand: any };
|
|
1880
1803
|
|
|
1881
1804
|
type Flags = number;
|
|
1882
1805
|
|
|
@@ -2207,7 +2130,6 @@ declare namespace ReactReconciler {
|
|
|
2207
2130
|
onCaughtError: (error: Error, info: BaseErrorInfo) => void,
|
|
2208
2131
|
onRecoverableError: (error: Error, info: BaseErrorInfo) => void,
|
|
2209
2132
|
onDefaultTransitionIndicator: () => void,
|
|
2210
|
-
transitionCallbacks: null | TransitionTracingCallbacks,
|
|
2211
2133
|
): OpaqueRoot;
|
|
2212
2134
|
|
|
2213
2135
|
createPortal(
|
|
@@ -2217,8 +2139,6 @@ declare namespace ReactReconciler {
|
|
|
2217
2139
|
key?: string | null,
|
|
2218
2140
|
): ReactPortal;
|
|
2219
2141
|
|
|
2220
|
-
registerMutableSourceForHydration(root: FiberRoot, mutableSource: MutableSource): void;
|
|
2221
|
-
|
|
2222
2142
|
createComponentSelector(component: React$AbstractComponent<never, unknown>): ComponentSelector;
|
|
2223
2143
|
|
|
2224
2144
|
createHasPseudoClassSelector(selectors: Selector[]): HasPseudoClassSelector;
|
|
@@ -2253,8 +2173,12 @@ declare namespace ReactReconciler {
|
|
|
2253
2173
|
isStrictMode: boolean,
|
|
2254
2174
|
concurrentUpdatesByDefaultOverride: null | boolean,
|
|
2255
2175
|
identifierPrefix: string,
|
|
2256
|
-
|
|
2176
|
+
onUncaughtError: (error: Error, info: BaseErrorInfo & { errorBoundary?: Component }) => void,
|
|
2177
|
+
onCaughtError: (error: Error, info: BaseErrorInfo) => void,
|
|
2178
|
+
onRecoverableError: (error: Error, info: BaseErrorInfo) => void,
|
|
2179
|
+
onDefaultTransitionIndicator: () => void,
|
|
2257
2180
|
transitionCallbacks: null | TransitionTracingCallbacks,
|
|
2181
|
+
formState: unknown,
|
|
2258
2182
|
): OpaqueRoot;
|
|
2259
2183
|
|
|
2260
2184
|
updateContainer(
|
|
@@ -2264,17 +2188,27 @@ declare namespace ReactReconciler {
|
|
|
2264
2188
|
callback?: (() => void) | null,
|
|
2265
2189
|
): Lane;
|
|
2266
2190
|
|
|
2191
|
+
updateContainerSync(
|
|
2192
|
+
element: ReactNode,
|
|
2193
|
+
container: OpaqueRoot,
|
|
2194
|
+
parentComponent?: Component<any, any> | null,
|
|
2195
|
+
callback?: (() => void) | null,
|
|
2196
|
+
): Lane;
|
|
2197
|
+
|
|
2267
2198
|
batchedUpdates<A, R>(fn: (a: A) => R, a: A): R;
|
|
2268
2199
|
|
|
2269
2200
|
deferredUpdates<A>(fn: () => A): A;
|
|
2270
2201
|
|
|
2271
2202
|
discreteUpdates<A, B, C, D, R>(fn: (arg0: A, arg1: B, arg2: C, arg3: D) => R, a: A, b: B, c: C, d: D): R;
|
|
2272
2203
|
|
|
2273
|
-
flushControlled(fn: () => any): void;
|
|
2274
|
-
|
|
2275
2204
|
flushSync(): void;
|
|
2276
2205
|
flushSync<R>(fn: () => R): R;
|
|
2277
2206
|
|
|
2207
|
+
flushSyncFromReconciler(): void;
|
|
2208
|
+
flushSyncFromReconciler<R>(fn: () => R): R;
|
|
2209
|
+
|
|
2210
|
+
flushSyncWork(): boolean;
|
|
2211
|
+
|
|
2278
2212
|
isAlreadyRendering(): boolean;
|
|
2279
2213
|
|
|
2280
2214
|
flushPassiveEffects(): boolean;
|
|
@@ -2283,16 +2217,10 @@ declare namespace ReactReconciler {
|
|
|
2283
2217
|
|
|
2284
2218
|
attemptSynchronousHydration(fiber: Fiber): void;
|
|
2285
2219
|
|
|
2286
|
-
attemptDiscreteHydration(fiber: Fiber): void;
|
|
2287
|
-
|
|
2288
2220
|
attemptContinuousHydration(fiber: Fiber): void;
|
|
2289
2221
|
|
|
2290
2222
|
attemptHydrationAtCurrentPriority(fiber: Fiber): void;
|
|
2291
2223
|
|
|
2292
|
-
getCurrentUpdatePriority(): LanePriority;
|
|
2293
|
-
|
|
2294
|
-
runWithPriority<T>(priority: LanePriority, fn: () => T): T;
|
|
2295
|
-
|
|
2296
2224
|
findHostInstance(component: any): PublicInstance | null;
|
|
2297
2225
|
|
|
2298
2226
|
findHostInstanceWithWarning(component: any, methodName: string): PublicInstance | null;
|
|
@@ -2305,6 +2233,17 @@ declare namespace ReactReconciler {
|
|
|
2305
2233
|
|
|
2306
2234
|
injectIntoDevTools(devToolsConfig: DevToolsConfig<Instance, TextInstance, any>): boolean;
|
|
2307
2235
|
}
|
|
2236
|
+
|
|
2237
|
+
function defaultOnUncaughtError(error: Error): void;
|
|
2238
|
+
function defaultOnCaughtError(error: Error): void;
|
|
2239
|
+
function defaultOnRecoverableError(error: Error): void;
|
|
2240
|
+
|
|
2241
|
+
function startHostTransition(
|
|
2242
|
+
formFiber: Fiber,
|
|
2243
|
+
pendingState: unknown,
|
|
2244
|
+
action: ((formData: FormData) => void) | null,
|
|
2245
|
+
formData: FormData,
|
|
2246
|
+
): void;
|
|
2308
2247
|
}
|
|
2309
2248
|
|
|
2310
2249
|
declare function extend<T extends ConstructorRepresentation>(objects: T): React$1.ExoticComponent<ThreeElement<T>>;
|
|
@@ -2848,5 +2787,5 @@ declare function isOnce(value: unknown): value is {
|
|
|
2848
2787
|
[ONCE]: any[] | true;
|
|
2849
2788
|
};
|
|
2850
2789
|
|
|
2851
|
-
export {
|
|
2852
|
-
export type {
|
|
2790
|
+
export { REACT_INTERNAL_PROPS as a$, Texture as aA, useTextures as aF, useEnvironment as aH, addEffect as aI, addAfterEffect as aJ, addTail as aK, invalidate as aL, advance as aM, extend as aN, reconciler as aO, isRenderer as aP, _roots as aQ, unmountComponentAtNode as aR, createPortal as aS, Portal as aT, flushSync as aU, createStore as aV, useIsomorphicLayoutEffect as aW, useMutableCallback as aX, useBridge as aY, Block as aZ, ErrorBoundary as a_, registerPrimary as ad, getPrimary as ae, waitForPrimary as af, hasPrimary as ag, unregisterPrimary as ah, getPrimaryIds as ai, EnvironmentMap as ak, EnvironmentCube as al, EnvironmentPortal as am, Environment as an, presetsObj as ao, swapInteractivity as aq, removeInteractivity as ar, createEvents as as, useInstanceHandle as at, useGraph as au, useLoader as av, IsObject as aw, useTexture as az, findInitialRoot as b0, getRootState as b1, buildGraph as b2, dispose as b3, getInstanceProps as b4, prepare as b5, invalidateInstance as b6, RESERVED_PROPS as b7, resolve as b8, attach as b9, detach as ba, diffProps as bb, applyProps as bc, calculateDpr as bd, getUuidPrefix as be, updateCamera as bf, updateFrustum as bg, is as bh, isOrthographicCamera as bi, isRef as bj, isColorRepresentation as bk, isObject3D as bl, isTexture as bm, isLayers as bn, isUniform as bo, isVectorLike as bp, isCopyable as bq, hasConstructor as br, FROM_REF as bs, fromRef as bu, isFromRef as bv, ONCE as bw, once as bx, isOnce as bz, createPointerEvents as u, getThree as v, hasThree as w, whenThree as x };
|
|
2791
|
+
export type { InputLike as $, Renderer as A, BaseRendererProps as B, Color as C, ColorManagementConfig as D, Euler as E, DefaultGLProps as F, GeometryTransformProps as G, GLProps as H, DefaultRendererProps as I, CanvasSchedulerConfig as J, RendererConfigExtended as K, Layers as L, MutableOrReadonlyParameters as M, NodeProps as N, Object3DMethod as O, RendererProps as P, Quaternion as Q, RaycastableRepresentation as R, CameraProps as S, TSLNodeInput as T, RenderProps as U, VectorRepresentation as V, InjectState as W, GlobalRenderCallback as X, GlobalEffectType as Y, BackgroundConfig as Z, BackgroundProp as _, MathRepresentation as a, LoaderLike as a0, GLTFLike as a1, LoaderInstance as a2, InferLoadResult as a3, LoaderResult as a4, Extensions as a5, WebGLDefaultProps as a6, WebGLProps as a7, WebGLShadowConfig as a8, LegacyRenderer as a9, TextureInput as aB, TextureResult as aC, DisposeOptions as aD, UseTexturesReturn as aE, EnvironmentLoaderProps as aG, LegacyInternalState as aa, LegacyRootState as ab, PrimaryCanvasEntry as ac, EnvironmentProps as aj, PresetsType as ap, MappedTextureType as ax, UseTextureOptions as ay, MathTypes as b, FromRefMarker as bt, OnceValue as by, MathType as c, MathProps as d, Vector2 as e, Vector3 as f, Vector4 as g, Matrix3 as h, Matrix4 as i, EventProps as j, GeometryProps as k, ReactProps as l, ElementProps as m, ThreeElement as n, ThreeToJSXElements as o, ThreeElementsOf as p, ElementOf as q, RenderTargetOptions as r, ReconcilerRoot as s, CanvasProps as t, OffscreenCanvas$1 as y, RendererFactory as z };
|
|
@@ -2,10 +2,9 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import { ReactNode, Component, RefObject, JSX } from 'react';
|
|
3
3
|
import { Options } from 'react-use-measure';
|
|
4
4
|
import * as THREE from 'three';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { ColorRepresentation, Euler as Euler$1, Loader, RenderTargetOptions as RenderTargetOptions$1, ColorSpace, Texture as Texture$1, CubeTexture, Scene, Object3D } from 'three';
|
|
6
|
+
import { J as Properties, c as Size, F as Frameloop, e as Performance, D as Dpr, g as RootStore, p as EventManager, f as RootState, n as ComputeFunction, C as ConstructorRepresentation, _ as ObjectMap, I as InternalState, M as Mutable, O as Overwrite, y as Args, l as EventHandlers, B as InstanceProps, k as DomEvent, G as Instance, x as Catalogue, v as Root, a6 as ThreeCore, W as Bridge, Z as UnblockProps, a0 as Disposable, Q as ThreeCamera, $ as EquConfig } from './fiber.I5Q4dVvl.mjs';
|
|
7
7
|
import { WebGPURenderer, WebGPURendererParameters } from 'three/webgpu';
|
|
8
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
8
|
|
|
10
9
|
//* Base Renderer Types =====================================
|
|
11
10
|
|
|
@@ -235,83 +234,6 @@ type InjectState = Partial<
|
|
|
235
234
|
}
|
|
236
235
|
>
|
|
237
236
|
|
|
238
|
-
//* Reconciler Types ==============================
|
|
239
|
-
|
|
240
|
-
// FiberRoot is an opaque internal React type - we define it locally
|
|
241
|
-
// to avoid bundling @types/react-reconciler which causes absolute path issues
|
|
242
|
-
type FiberRoot = any
|
|
243
|
-
|
|
244
|
-
interface Root {
|
|
245
|
-
fiber: FiberRoot
|
|
246
|
-
store: RootStore
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
type AttachFnType<O = any> = (parent: any, self: O) => () => void
|
|
250
|
-
type AttachType<O = any> = string | AttachFnType<O>
|
|
251
|
-
|
|
252
|
-
type ConstructorRepresentation<T = any> = new (...args: any[]) => T
|
|
253
|
-
|
|
254
|
-
interface Catalogue {
|
|
255
|
-
[name: string]: ConstructorRepresentation
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// TODO: handle constructor overloads
|
|
259
|
-
// https://github.com/pmndrs/react-three-fiber/pull/2931
|
|
260
|
-
// https://github.com/microsoft/TypeScript/issues/37079
|
|
261
|
-
type Args<T> = T extends ConstructorRepresentation
|
|
262
|
-
? T extends typeof Color$1
|
|
263
|
-
? [r: number, g: number, b: number] | [color: ColorRepresentation]
|
|
264
|
-
: ConstructorParameters<T>
|
|
265
|
-
: any[]
|
|
266
|
-
|
|
267
|
-
type ArgsProp<P> = P extends ConstructorRepresentation
|
|
268
|
-
? IsAllOptional<ConstructorParameters<P>> extends true
|
|
269
|
-
? { args?: Args<P> }
|
|
270
|
-
: { args: Args<P> }
|
|
271
|
-
: { args: unknown[] }
|
|
272
|
-
|
|
273
|
-
type InstanceProps<T = any, P = any> = ArgsProp<P> & {
|
|
274
|
-
object?: T
|
|
275
|
-
dispose?: null
|
|
276
|
-
attach?: AttachType<T>
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
interface Instance<O = any> {
|
|
280
|
-
root: RootStore
|
|
281
|
-
type: string
|
|
282
|
-
parent: Instance | null
|
|
283
|
-
children: Instance[]
|
|
284
|
-
props: InstanceProps<O> & Record<string, unknown>
|
|
285
|
-
object: O & { __r3f?: Instance<O> }
|
|
286
|
-
eventCount: number
|
|
287
|
-
handlers: Partial<EventHandlers>
|
|
288
|
-
attach?: AttachType<O>
|
|
289
|
-
previousAttach?: any
|
|
290
|
-
isHidden: boolean
|
|
291
|
-
/** Set of props that have been applied via once() */
|
|
292
|
-
appliedOnce?: Set<string>
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
interface HostConfig {
|
|
296
|
-
type: string
|
|
297
|
-
props: Instance['props']
|
|
298
|
-
container: RootStore
|
|
299
|
-
instance: Instance
|
|
300
|
-
textInstance: void
|
|
301
|
-
suspenseInstance: Instance
|
|
302
|
-
hydratableInstance: never
|
|
303
|
-
formInstance: never
|
|
304
|
-
publicInstance: Instance['object']
|
|
305
|
-
hostContext: {}
|
|
306
|
-
childSet: never
|
|
307
|
-
timeoutHandle: number | undefined
|
|
308
|
-
noTimeout: -1
|
|
309
|
-
TransitionStatus: null
|
|
310
|
-
}
|
|
311
|
-
declare global {
|
|
312
|
-
var IS_REACT_ACT_ENVIRONMENT: boolean | undefined
|
|
313
|
-
}
|
|
314
|
-
|
|
315
237
|
//* Loop Types ==============================
|
|
316
238
|
|
|
317
239
|
type GlobalRenderCallback = (timestamp: number) => void
|
|
@@ -875,7 +797,7 @@ declare function EnvironmentCube({ background, scene, blur, backgroundBlurriness
|
|
|
875
797
|
* </EnvironmentPortal>
|
|
876
798
|
* ```
|
|
877
799
|
*/
|
|
878
|
-
declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps):
|
|
800
|
+
declare function EnvironmentPortal({ children, near, far, resolution, frames, map, background, blur, backgroundBlurriness, backgroundIntensity, backgroundRotation, environmentIntensity, environmentRotation, scene, files, path, preset, extensions, }: EnvironmentProps): React$1.JSX.Element;
|
|
879
801
|
/**
|
|
880
802
|
* Sets up a global environment map for PBR materials and backgrounds.
|
|
881
803
|
* Affects scene.environment and optionally scene.background unless a custom scene is passed.
|
|
@@ -971,7 +893,7 @@ declare function EnvironmentPortal({ children, near, far, resolution, frames, ma
|
|
|
971
893
|
* />
|
|
972
894
|
* ```
|
|
973
895
|
*/
|
|
974
|
-
declare function Environment(props: EnvironmentProps):
|
|
896
|
+
declare function Environment(props: EnvironmentProps): React$1.JSX.Element;
|
|
975
897
|
|
|
976
898
|
/**
|
|
977
899
|
* Moves every trace of interactivity from one object to its replacement, for reconstruction.
|
|
@@ -1089,7 +1011,7 @@ declare const Texture: ({ children, input, onLoad, cache, }: {
|
|
|
1089
1011
|
input: Parameters<typeof useTexture>[0];
|
|
1090
1012
|
onLoad?: Parameters<typeof useTexture>[1];
|
|
1091
1013
|
cache?: boolean;
|
|
1092
|
-
}) =>
|
|
1014
|
+
}) => React$1.JSX.Element;
|
|
1093
1015
|
|
|
1094
1016
|
/** Accepted shapes for a registry read: a single key, a list of keys, or a name→key map. */
|
|
1095
1017
|
type TextureInput = string | string[] | Record<string, string>;
|
|
@@ -1876,7 +1798,8 @@ declare namespace ReactReconciler {
|
|
|
1876
1798
|
type LanePriority = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17;
|
|
1877
1799
|
|
|
1878
1800
|
type Lanes = number;
|
|
1879
|
-
|
|
1801
|
+
|
|
1802
|
+
type Lane = number & { __LaneBrand: any };
|
|
1880
1803
|
|
|
1881
1804
|
type Flags = number;
|
|
1882
1805
|
|
|
@@ -2207,7 +2130,6 @@ declare namespace ReactReconciler {
|
|
|
2207
2130
|
onCaughtError: (error: Error, info: BaseErrorInfo) => void,
|
|
2208
2131
|
onRecoverableError: (error: Error, info: BaseErrorInfo) => void,
|
|
2209
2132
|
onDefaultTransitionIndicator: () => void,
|
|
2210
|
-
transitionCallbacks: null | TransitionTracingCallbacks,
|
|
2211
2133
|
): OpaqueRoot;
|
|
2212
2134
|
|
|
2213
2135
|
createPortal(
|
|
@@ -2217,8 +2139,6 @@ declare namespace ReactReconciler {
|
|
|
2217
2139
|
key?: string | null,
|
|
2218
2140
|
): ReactPortal;
|
|
2219
2141
|
|
|
2220
|
-
registerMutableSourceForHydration(root: FiberRoot, mutableSource: MutableSource): void;
|
|
2221
|
-
|
|
2222
2142
|
createComponentSelector(component: React$AbstractComponent<never, unknown>): ComponentSelector;
|
|
2223
2143
|
|
|
2224
2144
|
createHasPseudoClassSelector(selectors: Selector[]): HasPseudoClassSelector;
|
|
@@ -2253,8 +2173,12 @@ declare namespace ReactReconciler {
|
|
|
2253
2173
|
isStrictMode: boolean,
|
|
2254
2174
|
concurrentUpdatesByDefaultOverride: null | boolean,
|
|
2255
2175
|
identifierPrefix: string,
|
|
2256
|
-
|
|
2176
|
+
onUncaughtError: (error: Error, info: BaseErrorInfo & { errorBoundary?: Component }) => void,
|
|
2177
|
+
onCaughtError: (error: Error, info: BaseErrorInfo) => void,
|
|
2178
|
+
onRecoverableError: (error: Error, info: BaseErrorInfo) => void,
|
|
2179
|
+
onDefaultTransitionIndicator: () => void,
|
|
2257
2180
|
transitionCallbacks: null | TransitionTracingCallbacks,
|
|
2181
|
+
formState: unknown,
|
|
2258
2182
|
): OpaqueRoot;
|
|
2259
2183
|
|
|
2260
2184
|
updateContainer(
|
|
@@ -2264,17 +2188,27 @@ declare namespace ReactReconciler {
|
|
|
2264
2188
|
callback?: (() => void) | null,
|
|
2265
2189
|
): Lane;
|
|
2266
2190
|
|
|
2191
|
+
updateContainerSync(
|
|
2192
|
+
element: ReactNode,
|
|
2193
|
+
container: OpaqueRoot,
|
|
2194
|
+
parentComponent?: Component<any, any> | null,
|
|
2195
|
+
callback?: (() => void) | null,
|
|
2196
|
+
): Lane;
|
|
2197
|
+
|
|
2267
2198
|
batchedUpdates<A, R>(fn: (a: A) => R, a: A): R;
|
|
2268
2199
|
|
|
2269
2200
|
deferredUpdates<A>(fn: () => A): A;
|
|
2270
2201
|
|
|
2271
2202
|
discreteUpdates<A, B, C, D, R>(fn: (arg0: A, arg1: B, arg2: C, arg3: D) => R, a: A, b: B, c: C, d: D): R;
|
|
2272
2203
|
|
|
2273
|
-
flushControlled(fn: () => any): void;
|
|
2274
|
-
|
|
2275
2204
|
flushSync(): void;
|
|
2276
2205
|
flushSync<R>(fn: () => R): R;
|
|
2277
2206
|
|
|
2207
|
+
flushSyncFromReconciler(): void;
|
|
2208
|
+
flushSyncFromReconciler<R>(fn: () => R): R;
|
|
2209
|
+
|
|
2210
|
+
flushSyncWork(): boolean;
|
|
2211
|
+
|
|
2278
2212
|
isAlreadyRendering(): boolean;
|
|
2279
2213
|
|
|
2280
2214
|
flushPassiveEffects(): boolean;
|
|
@@ -2283,16 +2217,10 @@ declare namespace ReactReconciler {
|
|
|
2283
2217
|
|
|
2284
2218
|
attemptSynchronousHydration(fiber: Fiber): void;
|
|
2285
2219
|
|
|
2286
|
-
attemptDiscreteHydration(fiber: Fiber): void;
|
|
2287
|
-
|
|
2288
2220
|
attemptContinuousHydration(fiber: Fiber): void;
|
|
2289
2221
|
|
|
2290
2222
|
attemptHydrationAtCurrentPriority(fiber: Fiber): void;
|
|
2291
2223
|
|
|
2292
|
-
getCurrentUpdatePriority(): LanePriority;
|
|
2293
|
-
|
|
2294
|
-
runWithPriority<T>(priority: LanePriority, fn: () => T): T;
|
|
2295
|
-
|
|
2296
2224
|
findHostInstance(component: any): PublicInstance | null;
|
|
2297
2225
|
|
|
2298
2226
|
findHostInstanceWithWarning(component: any, methodName: string): PublicInstance | null;
|
|
@@ -2305,6 +2233,17 @@ declare namespace ReactReconciler {
|
|
|
2305
2233
|
|
|
2306
2234
|
injectIntoDevTools(devToolsConfig: DevToolsConfig<Instance, TextInstance, any>): boolean;
|
|
2307
2235
|
}
|
|
2236
|
+
|
|
2237
|
+
function defaultOnUncaughtError(error: Error): void;
|
|
2238
|
+
function defaultOnCaughtError(error: Error): void;
|
|
2239
|
+
function defaultOnRecoverableError(error: Error): void;
|
|
2240
|
+
|
|
2241
|
+
function startHostTransition(
|
|
2242
|
+
formFiber: Fiber,
|
|
2243
|
+
pendingState: unknown,
|
|
2244
|
+
action: ((formData: FormData) => void) | null,
|
|
2245
|
+
formData: FormData,
|
|
2246
|
+
): void;
|
|
2308
2247
|
}
|
|
2309
2248
|
|
|
2310
2249
|
declare function extend<T extends ConstructorRepresentation>(objects: T): React$1.ExoticComponent<ThreeElement<T>>;
|
|
@@ -2848,5 +2787,5 @@ declare function isOnce(value: unknown): value is {
|
|
|
2848
2787
|
[ONCE]: any[] | true;
|
|
2849
2788
|
};
|
|
2850
2789
|
|
|
2851
|
-
export {
|
|
2852
|
-
export type {
|
|
2790
|
+
export { REACT_INTERNAL_PROPS as a$, Texture as aA, useTextures as aF, useEnvironment as aH, addEffect as aI, addAfterEffect as aJ, addTail as aK, invalidate as aL, advance as aM, extend as aN, reconciler as aO, isRenderer as aP, _roots as aQ, unmountComponentAtNode as aR, createPortal as aS, Portal as aT, flushSync as aU, createStore as aV, useIsomorphicLayoutEffect as aW, useMutableCallback as aX, useBridge as aY, Block as aZ, ErrorBoundary as a_, registerPrimary as ad, getPrimary as ae, waitForPrimary as af, hasPrimary as ag, unregisterPrimary as ah, getPrimaryIds as ai, EnvironmentMap as ak, EnvironmentCube as al, EnvironmentPortal as am, Environment as an, presetsObj as ao, swapInteractivity as aq, removeInteractivity as ar, createEvents as as, useInstanceHandle as at, useGraph as au, useLoader as av, IsObject as aw, useTexture as az, findInitialRoot as b0, getRootState as b1, buildGraph as b2, dispose as b3, getInstanceProps as b4, prepare as b5, invalidateInstance as b6, RESERVED_PROPS as b7, resolve as b8, attach as b9, detach as ba, diffProps as bb, applyProps as bc, calculateDpr as bd, getUuidPrefix as be, updateCamera as bf, updateFrustum as bg, is as bh, isOrthographicCamera as bi, isRef as bj, isColorRepresentation as bk, isObject3D as bl, isTexture as bm, isLayers as bn, isUniform as bo, isVectorLike as bp, isCopyable as bq, hasConstructor as br, FROM_REF as bs, fromRef as bu, isFromRef as bv, ONCE as bw, once as bx, isOnce as bz, createPointerEvents as u, getThree as v, hasThree as w, whenThree as x };
|
|
2791
|
+
export type { InputLike as $, Renderer as A, BaseRendererProps as B, Color as C, ColorManagementConfig as D, Euler as E, DefaultGLProps as F, GeometryTransformProps as G, GLProps as H, DefaultRendererProps as I, CanvasSchedulerConfig as J, RendererConfigExtended as K, Layers as L, MutableOrReadonlyParameters as M, NodeProps as N, Object3DMethod as O, RendererProps as P, Quaternion as Q, RaycastableRepresentation as R, CameraProps as S, TSLNodeInput as T, RenderProps as U, VectorRepresentation as V, InjectState as W, GlobalRenderCallback as X, GlobalEffectType as Y, BackgroundConfig as Z, BackgroundProp as _, MathRepresentation as a, LoaderLike as a0, GLTFLike as a1, LoaderInstance as a2, InferLoadResult as a3, LoaderResult as a4, Extensions as a5, WebGLDefaultProps as a6, WebGLProps as a7, WebGLShadowConfig as a8, LegacyRenderer as a9, TextureInput as aB, TextureResult as aC, DisposeOptions as aD, UseTexturesReturn as aE, EnvironmentLoaderProps as aG, LegacyInternalState as aa, LegacyRootState as ab, PrimaryCanvasEntry as ac, EnvironmentProps as aj, PresetsType as ap, MappedTextureType as ax, UseTextureOptions as ay, MathTypes as b, FromRefMarker as bt, OnceValue as by, MathType as c, MathProps as d, Vector2 as e, Vector3 as f, Vector4 as g, Matrix3 as h, Matrix4 as i, EventProps as j, GeometryProps as k, ReactProps as l, ElementProps as m, ThreeElement as n, ThreeToJSXElements as o, ThreeElementsOf as p, ElementOf as q, RenderTargetOptions as r, ReconcilerRoot as s, CanvasProps as t, OffscreenCanvas$1 as y, RendererFactory as z };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { a3 as FrameNextCallback } from './fiber.I5Q4dVvl.js';
|
|
2
|
+
import { UseFrameNextOptions, FrameNextControls } from '@pmndrs/scheduler';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Frame hook with phase-based ordering, priority, and FPS throttling.
|
|
6
|
+
*
|
|
7
|
+
* Always delivers full RootState — works both inside and outside Canvas context:
|
|
8
|
+
* - Inside Canvas: Full RootState (renderer, scene, camera, etc.)
|
|
9
|
+
* - Outside Canvas: The job registers immediately but the callback is held until a
|
|
10
|
+
* Canvas adopts it, then runs with full RootState. For hostless / standalone
|
|
11
|
+
* frame loops with no Canvas, use `@pmndrs/scheduler` directly.
|
|
12
|
+
*
|
|
13
|
+
* Returns a controls object for manual stepping, pausing, and resuming.
|
|
14
|
+
*
|
|
15
|
+
* @param callback - Function called each frame with (state, delta). Optional if you only need scheduler access.
|
|
16
|
+
* @param priorityOrOptions - Either a priority number (backwards compat) or options object
|
|
17
|
+
* @returns Controls object with step(), stepAll(), invalidate(), pause(), resume(), isPaused, id, rootId, scheduler
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Simple priority (backwards compat)
|
|
21
|
+
* useFrame((state, delta) => { ... }, 5)
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // With phase-based ordering
|
|
25
|
+
* useFrame((state, delta) => { ... }, { phase: 'physics' })
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Outside Canvas - callback waits for a Canvas, then always has full state
|
|
29
|
+
* function UI() {
|
|
30
|
+
* useFrame((state, delta) => { syncUI(state.camera) });
|
|
31
|
+
* return <button>...</button>;
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Hostless / standalone loop (no Canvas) - use @pmndrs/scheduler directly
|
|
36
|
+
* import { getScheduler } from '@pmndrs/scheduler'
|
|
37
|
+
* getScheduler().register((state, delta) => { updateGame(delta) })
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* // Scheduler-only access (no callback)
|
|
41
|
+
* const { scheduler } = useFrame()
|
|
42
|
+
* scheduler.pauseJob('some-job-id')
|
|
43
|
+
*
|
|
44
|
+
* @see https://docs.pmnd.rs/react-three-fiber/api/hooks#useframe
|
|
45
|
+
*/
|
|
46
|
+
declare function useFrame(callback?: FrameNextCallback, priorityOrOptions?: number | UseFrameNextOptions): FrameNextControls;
|
|
47
|
+
|
|
48
|
+
export { useFrame as u };
|