@tresjs/core 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/chunk-DADVwcMf.js +30 -0
  2. package/dist/template-compiler-options.d.mts +17 -0
  3. package/dist/template-compiler-options.mjs +18 -0
  4. package/dist/tres.d.ts +1066 -0
  5. package/dist/tres.js +2269 -5574
  6. package/package.json +20 -25
  7. package/components.d.ts +0 -1
  8. package/composables.d.ts +0 -1
  9. package/dist/index.d.ts +0 -6
  10. package/dist/src/components/TresCanvas.vue.d.ts +0 -94
  11. package/dist/src/components/index.d.ts +0 -2
  12. package/dist/src/composables/index.d.ts +0 -9
  13. package/dist/src/composables/useCamera/index.d.ts +0 -43
  14. package/dist/src/composables/useCreateRafLoop/index.d.ts +0 -14
  15. package/dist/src/composables/useEventManager/index.d.ts +0 -10
  16. package/dist/src/composables/useGraph/index.d.ts +0 -3
  17. package/dist/src/composables/useLoader/component.vue.d.ts +0 -38
  18. package/dist/src/composables/useLoader/index.d.ts +0 -51
  19. package/dist/src/composables/useLoop/index.d.ts +0 -14
  20. package/dist/src/composables/useRenderer/pixelRatio.d.ts +0 -4
  21. package/dist/src/composables/useRenderer/useRendererManager.d.ts +0 -194
  22. package/dist/src/composables/useSizes/index.d.ts +0 -11
  23. package/dist/src/composables/useTres/index.d.ts +0 -37
  24. package/dist/src/composables/useTresContextProvider/index.d.ts +0 -24
  25. package/dist/src/core/catalogue.d.ts +0 -9
  26. package/dist/src/core/nodeOps.d.ts +0 -4
  27. package/dist/src/core/revision.d.ts +0 -1
  28. package/dist/src/devtools/DevtoolsMessenger.d.ts +0 -53
  29. package/dist/src/devtools/highlight.d.ts +0 -7
  30. package/dist/src/devtools/index.d.ts +0 -2
  31. package/dist/src/devtools/inspectorHandlers.d.ts +0 -60
  32. package/dist/src/devtools/plugin.d.ts +0 -10
  33. package/dist/src/devtools/setupDevtools.d.ts +0 -14
  34. package/dist/src/devtools/types.d.ts +0 -90
  35. package/dist/src/devtools/utils.d.ts +0 -7
  36. package/dist/src/directives/index.d.ts +0 -4
  37. package/dist/src/directives/vDistanceTo.d.ts +0 -6
  38. package/dist/src/directives/vLightHelper.d.ts +0 -6
  39. package/dist/src/directives/vLog.d.ts +0 -6
  40. package/dist/src/index.d.ts +0 -25
  41. package/dist/src/types/index.d.ts +0 -137
  42. package/dist/src/utils/array.d.ts +0 -6
  43. package/dist/src/utils/createPriorityEventHook.d.ts +0 -15
  44. package/dist/src/utils/graph.d.ts +0 -15
  45. package/dist/src/utils/index.d.ts +0 -19
  46. package/dist/src/utils/is/dom.d.ts +0 -1
  47. package/dist/src/utils/is/index.d.ts +0 -4
  48. package/dist/src/utils/is/three.d.ts +0 -162
  49. package/dist/src/utils/is/tres.d.ts +0 -70
  50. package/dist/src/utils/is/typed.d.ts +0 -1
  51. package/dist/src/utils/is/util.d.ts +0 -1
  52. package/dist/src/utils/logger.d.ts +0 -25
  53. package/dist/src/utils/makeMap.d.ts +0 -9
  54. package/dist/src/utils/normalize.d.ts +0 -17
  55. package/dist/src/utils/perf.d.ts +0 -7
  56. package/dist/src/utils/pointerEvents.d.ts +0 -10
  57. package/dist/src/utils/primitive/createRetargetingProxy.d.ts +0 -1
  58. package/dist/src/utils/string.d.ts +0 -1
  59. package/dist/src/utils/template-compiler-options.d.ts +0 -8
  60. package/dist/src/utils/test-utils.d.ts +0 -2
  61. package/dist/src/utils/three.d.ts +0 -9
  62. package/types.d.ts +0 -1
  63. package/utils.d.ts +0 -1
@@ -1,9 +0,0 @@
1
- import { Ref } from 'vue';
2
- import { TresCatalogue } from '../types';
3
- export declare const catalogue: Ref<TresCatalogue>;
4
- export declare const extend: (objects: any) => any;
5
- declare const _default: {
6
- catalogue: Ref<TresCatalogue, TresCatalogue>;
7
- extend: (objects: any) => any;
8
- };
9
- export default _default;
@@ -1,4 +0,0 @@
1
- import { TresContext } from '../composables';
2
- import { TresObject } from '../types';
3
- import { RendererOptions } from 'vue';
4
- export declare const nodeOps: (context: TresContext) => RendererOptions<TresObject, TresObject | null>;
@@ -1 +0,0 @@
1
- export declare const revision: number;
@@ -1,53 +0,0 @@
1
- export type DevtoolsMessageType = 'performance' | 'context' | 'asset-load';
2
- export interface AssetLoadData {
3
- url: string;
4
- type: string;
5
- loaded: boolean;
6
- size: number;
7
- asset: HTMLImageElement | HTMLScriptElement | HTMLLinkElement | Blob | ArrayBuffer | null;
8
- }
9
- export interface DevtoolsMessage<T = any> {
10
- type: DevtoolsMessageType;
11
- data: T;
12
- timestamp?: number;
13
- }
14
- export type DevtoolsSubscriber = (message: DevtoolsMessage) => void;
15
- /**
16
- * Messenger class for communicating with Tres DevTools
17
- * This class will be attached to window.__TRES__DEVTOOLS__
18
- */
19
- export declare class DevtoolsMessenger {
20
- private subscribers;
21
- private messageQueue;
22
- private maxQueueSize;
23
- /**
24
- * Send a message to devtools subscribers
25
- * If no subscribers are available, only queueable message types are queued
26
- */
27
- send<T>(type: DevtoolsMessageType, data: T): void;
28
- /**
29
- * Queue a message for later delivery
30
- */
31
- private queueMessage;
32
- /**
33
- * Flush all queued messages to current subscribers
34
- */
35
- private flushQueue;
36
- /**
37
- * Subscribe to devtools messages
38
- * When a new subscriber is added, all queued messages (asset-load events) are immediately delivered
39
- */
40
- subscribe(subscriber: DevtoolsSubscriber): () => void;
41
- /**
42
- * Check if there are any subscribers
43
- */
44
- get hasSubscribers(): boolean;
45
- /**
46
- * Get the current queue size
47
- */
48
- get queueSize(): number;
49
- /**
50
- * Clear all queued messages
51
- */
52
- clearQueue(): void;
53
- }
@@ -1,7 +0,0 @@
1
- import * as THREE from 'three';
2
- export declare class HightlightMesh extends THREE.Mesh {
3
- type: string;
4
- createTime: number;
5
- constructor(...args: any[]);
6
- onBeforeRender(): void;
7
- }
@@ -1,2 +0,0 @@
1
- export * from './DevtoolsMessenger';
2
- export { registerTresDevtools } from './plugin';
@@ -1,60 +0,0 @@
1
- import { Mesh } from 'three';
2
- import { TresObject } from '../types';
3
- import { SceneGraphObject } from './types';
4
- import { TresContext } from '../composables/useTresContextProvider';
5
- /**
6
- * Creates a node representation of a Three.js object for the inspector tree
7
- * @param object - The Three.js object to create a node for
8
- * @returns A SceneGraphObject representing the Three.js object with relevant metadata
9
- */
10
- export declare const createNode: (object: TresObject) => SceneGraphObject;
11
- /**
12
- * Creates a context node for the inspector tree
13
- * @param key - The key identifier for the context node
14
- * @param uuid - The unique identifier for the context
15
- * @param parentKey - Optional parent key for nested context nodes
16
- * @returns A SceneGraphObject representing the context node
17
- */
18
- export declare function createContextNode(key: string, uuid: string, parentKey?: string): SceneGraphObject;
19
- /**
20
- * Recursively builds a graph representation of Three.js objects for the inspector
21
- * @param object - The root Three.js object to build the graph from
22
- * @param node - The current node in the graph being built
23
- * @param filter - Optional filter string to filter objects by type or name
24
- */
25
- export declare function buildGraph(object: TresObject, node: SceneGraphObject, filter?: string): void;
26
- /**
27
- * Recursively builds a graph representation of context objects for the inspector
28
- * @param object - The root object to build the context graph from
29
- * @param node - The current node in the graph being built
30
- * @param visited - WeakSet to track visited objects and prevent circular references
31
- * @param depth - Current depth in the object tree
32
- * @param maxDepth - Maximum depth to traverse
33
- * @param contextUuid - Optional UUID for the context
34
- * @param parentKey - Optional parent key for nested objects
35
- */
36
- export declare function buildContextGraph(object: any, node: SceneGraphObject, visited?: WeakSet<WeakKey>, depth?: number, maxDepth?: number, contextUuid?: string, parentKey?: string): void;
37
- /**
38
- * Handler for inspector tree updates
39
- * @param tres - The TresContext instance
40
- * @returns A function that handles inspector tree payload updates
41
- */
42
- export declare const inspectorTreeHandler: (tres: TresContext) => (payload: any) => void;
43
- /**
44
- * Handler for inspector state updates
45
- * @param tres - The TresContext instance
46
- * @param options - Options for the handler
47
- * @param options.highlightMesh - The currently highlighted mesh
48
- * @param options.prevInstance - The previously selected instance
49
- * @returns A function that handles inspector state payload updates
50
- */
51
- export declare const inspectorStateHandler: (tres: TresContext, { highlightMesh, prevInstance }: {
52
- highlightMesh: Mesh | null;
53
- prevInstance: TresObject | null;
54
- }) => (payload: any) => void;
55
- /**
56
- * Handler for inspector state edits
57
- * @param tres - The TresContext instance
58
- * @returns A function that handles inspector state edit payload updates
59
- */
60
- export declare const inspectorEditStateHandler: (tres: TresContext) => (payload: any) => void;
@@ -1,10 +0,0 @@
1
- import { TresContext } from '../composables';
2
- import { App } from 'vue';
3
- export interface Tags {
4
- label: string;
5
- textColor: number;
6
- backgroundColor: number;
7
- tooltip?: string;
8
- }
9
- export declare const INSPECTOR_ID = "tres:inspector";
10
- export declare function registerTresDevtools(app: App, tres: TresContext): void;
@@ -1,14 +0,0 @@
1
- import { TresContext } from '../composables';
2
- export interface PerformanceState {
3
- maxFrames: number;
4
- fps: {
5
- value: number;
6
- accumulator: number[];
7
- };
8
- memory: {
9
- currentMem: number;
10
- allocatedMem: number;
11
- accumulator: number[];
12
- };
13
- }
14
- export declare function setupTresDevtools(ctx: TresContext): void;
@@ -1,90 +0,0 @@
1
- /**
2
- * Represents a tag that can be displayed in the inspector UI
3
- * @interface Tags
4
- */
5
- export interface Tags {
6
- /** The text to display in the tag */
7
- label: string;
8
- /** The color of the text in hexadecimal format (e.g., 0xFFFFFF) */
9
- textColor: number;
10
- /** The background color of the tag in hexadecimal format (e.g., 0x000000) */
11
- backgroundColor: number;
12
- /** Optional tooltip text to show on hover */
13
- tooltip?: string;
14
- }
15
- /**
16
- * Represents a node in the scene graph that can be displayed in the inspector
17
- * @interface SceneGraphObject
18
- */
19
- export interface SceneGraphObject {
20
- /** Unique identifier for the node */
21
- id: string;
22
- /** Display name of the node */
23
- label: string;
24
- /** Array of child nodes */
25
- children: SceneGraphObject[];
26
- /** Array of tags associated with the node */
27
- tags: Tags[];
28
- }
29
- /**
30
- * Represents memory usage statistics for Three.js resources
31
- * @interface MemoryStats
32
- */
33
- export interface MemoryStats {
34
- /** Map of geometry names to their memory usage in bytes */
35
- geometries: Map<string, number>;
36
- /** Map of material names to their memory usage in bytes */
37
- materials: Map<string, number>;
38
- /** Map of texture names to their memory usage in bytes */
39
- textures: Map<string, number>;
40
- }
41
- /**
42
- * Represents a property in the inspector state
43
- * @interface InspectorStateProperty
44
- */
45
- export interface InspectorStateProperty {
46
- /** The name of the property */
47
- key: string;
48
- /** The value of the property */
49
- value: unknown;
50
- /** Whether the property can be edited in the inspector */
51
- editable: boolean;
52
- }
53
- /**
54
- * Represents the state of an inspector panel
55
- * @interface InspectorState
56
- */
57
- export interface InspectorState {
58
- /** Array of properties to display in the inspector */
59
- object: InspectorStateProperty[];
60
- }
61
- /**
62
- * Represents the internal state of the devtools
63
- * @interface DevtoolsState
64
- */
65
- export interface DevtoolsState {
66
- /** The current scene graph representation */
67
- sceneGraph: SceneGraphObject | null;
68
- /** Timestamp of the last update */
69
- lastUpdate: number;
70
- /** Minimum time between updates in milliseconds */
71
- updateThreshold: number;
72
- /** Current memory usage statistics */
73
- memoryStats: MemoryStats;
74
- }
75
- /**
76
- * Represents a payload sent to or received from the devtools
77
- * @interface DevtoolsPayload
78
- */
79
- export interface DevtoolsPayload {
80
- /** The ID of the inspector panel */
81
- inspectorId: string;
82
- /** The ID of the node being inspected */
83
- nodeId: string;
84
- /** Optional filter string for searching */
85
- filter?: string;
86
- /** Optional state to update */
87
- state?: InspectorState;
88
- /** Optional path to the property being edited */
89
- path?: string[];
90
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * Shows a toast or console.log
3
- *
4
- * @param message - message to log
5
- * @param type - different color of the tooltip
6
- */
7
- export declare function toastMessage(message: string, type?: 'normal' | 'error' | 'warn' | undefined): void;
@@ -1,4 +0,0 @@
1
- import { vDistanceTo } from './vDistanceTo';
2
- import { vLightHelper } from './vLightHelper';
3
- import { vLog } from './vLog';
4
- export { vDistanceTo, vLightHelper, vLog };
@@ -1,6 +0,0 @@
1
- import { Ref } from 'vue';
2
- import { TresObject } from '../types';
3
- export declare const vDistanceTo: {
4
- updated: (el: TresObject, binding: Ref<TresObject>) => void;
5
- unmounted: (el: TresObject) => void;
6
- };
@@ -1,6 +0,0 @@
1
- import { TresObject } from '../types';
2
- export declare const vLightHelper: {
3
- mounted: (el: TresObject) => void;
4
- updated: (el: TresObject) => void;
5
- unmounted: (el: TresObject) => void;
6
- };
@@ -1,6 +0,0 @@
1
- import { TresObject } from '../types';
2
- export declare const vLog: {
3
- mounted: (el: TresObject, binding: {
4
- arg: string;
5
- }) => void;
6
- };
@@ -1,25 +0,0 @@
1
- import { App } from 'vue';
2
- import { disposeObject3D as dispose } from './utils';
3
- import { normalizeColor, normalizeVectorFlexibleParam } from './utils/normalize';
4
- import { default as templateCompilerOptions } from './utils/template-compiler-options';
5
- export * from './components';
6
- export * from './composables';
7
- export * from './core/catalogue';
8
- export * from './devtools';
9
- export * from './directives';
10
- export * from './types';
11
- export * from './utils/graph';
12
- export * from './utils/is/three';
13
- export * from './utils/is/tres';
14
- export * from './utils/logger';
15
- export interface TresOptions {
16
- extends?: Record<string, unknown>;
17
- }
18
- export interface TresPlugin {
19
- [key: string]: any;
20
- install: (app: App, options?: TresOptions) => void;
21
- }
22
- declare const plugin: TresPlugin;
23
- export default plugin;
24
- export { dispose, normalizeColor, normalizeVectorFlexibleParam, templateCompilerOptions, };
25
- export type { VectorFlexibleParams } from './utils/normalize';
@@ -1,137 +0,0 @@
1
- import { DefineComponent, VNode, VNodeRef } from 'vue';
2
- import { TresContext } from '../composables/useTresContextProvider';
3
- import { PointerEventHandlers } from '../utils/pointerEvents';
4
- import type * as THREE from 'three';
5
- export type AttachFnType = (parent: any, self: TresInstance) => () => void;
6
- export type AttachType = string | AttachFnType;
7
- export type DisposeType = ((self: TresInstance) => void) | boolean | 'default';
8
- export type ConstructorRepresentation = new (...args: any[]) => any;
9
- export type NonFunctionKeys<P> = {
10
- [K in keyof P]-?: P[K] extends (...args: any[]) => any ? never : K;
11
- }[keyof P];
12
- export type Overwrite<P, O> = Omit<P, NonFunctionKeys<O>> & O;
13
- export type Properties<T> = Pick<T, NonFunctionKeys<T>>;
14
- export type Mutable<P> = {
15
- [K in keyof P]: P[K] | Readonly<P[K]>;
16
- };
17
- export type Args<T> = T extends ConstructorRepresentation ? ConstructorParameters<T> : any[];
18
- export interface TresCatalogue {
19
- [name: string]: ConstructorRepresentation;
20
- }
21
- export type TresCamera = THREE.OrthographicCamera | THREE.PerspectiveCamera;
22
- /**
23
- * Represents the properties of an instance.
24
- *
25
- * @template T - The type of the object.
26
- * @template P - The type of the arguments.
27
- */
28
- export interface InstanceProps<T = any, P = any> {
29
- args?: Args<P>;
30
- object?: T;
31
- visible?: boolean;
32
- dispose?: null;
33
- attach?: AttachType;
34
- }
35
- interface TresBaseObject {
36
- removeFromParent?: () => void;
37
- dispose?: () => void;
38
- [prop: string]: any;
39
- }
40
- export interface LocalState {
41
- type: string;
42
- root: TresContext;
43
- memoizedProps: {
44
- [key: string]: any;
45
- };
46
- objects: TresObject[];
47
- parent: TresObject | null;
48
- primitive?: boolean;
49
- dispose?: DisposeType;
50
- attach?: AttachType;
51
- previousAttach: any;
52
- }
53
- export interface TresObject3D extends THREE.Object3D<THREE.Object3DEventMap> {
54
- geometry?: THREE.BufferGeometry & TresBaseObject;
55
- material?: THREE.Material & TresBaseObject;
56
- }
57
- export type TresObject = TresBaseObject & (TresObject3D | THREE.BufferGeometry | THREE.Material | THREE.Fog) & {
58
- __tres?: LocalState;
59
- };
60
- /**
61
- * Union type covering all common Three.js material types
62
- * This provides better TypeScript intellisense and type checking
63
- * when accessing specific material properties
64
- */
65
- export type TresMaterial = THREE.MeshBasicMaterial | THREE.MeshStandardMaterial | THREE.MeshPhysicalMaterial | THREE.MeshLambertMaterial | THREE.MeshPhongMaterial | THREE.MeshToonMaterial | THREE.MeshNormalMaterial | THREE.MeshMatcapMaterial | THREE.MeshDepthMaterial | THREE.MeshDistanceMaterial | THREE.LineBasicMaterial | THREE.LineDashedMaterial | THREE.PointsMaterial | THREE.SpriteMaterial | THREE.ShaderMaterial | THREE.RawShaderMaterial | THREE.ShadowMaterial | THREE.Material;
66
- export type TresInstance = TresObject & {
67
- __tres: LocalState;
68
- };
69
- export type TresPrimitive = TresInstance & {
70
- object: TresInstance;
71
- isPrimitive: true;
72
- };
73
- export interface TresScene extends THREE.Scene {
74
- __tres: {
75
- root: TresContext;
76
- };
77
- }
78
- interface MathRepresentation {
79
- set(...args: number[] | [THREE.ColorRepresentation]): any;
80
- }
81
- interface VectorRepresentation extends MathRepresentation {
82
- setScalar(s: number): any;
83
- }
84
- export interface VectorCoordinates {
85
- x: number;
86
- y: number;
87
- z: number;
88
- }
89
- export type MathType<T extends MathRepresentation | THREE.Euler> = T extends THREE.Color ? ConstructorParameters<typeof THREE.Color> | THREE.ColorRepresentation : T extends VectorRepresentation | THREE.Layers | THREE.Euler ? T | Parameters<T['set']> | number | VectorCoordinates : T | Parameters<T['set']>;
90
- type VectorLike<VectorClass extends THREE.Vector2 | THREE.Vector3 | THREE.Vector4> = VectorClass | Parameters<VectorClass['set']> | Readonly<Parameters<VectorClass['set']>> | Parameters<VectorClass['setScalar']>[0];
91
- export type TresVector2 = VectorLike<THREE.Vector2>;
92
- export type TresVector3 = VectorLike<THREE.Vector3>;
93
- export type TresVector4 = VectorLike<THREE.Vector4>;
94
- export type TresColor = ConstructorParameters<typeof THREE.Color> | THREE.Color | number | string;
95
- export type TresColorArray = typeof THREE.Color | [color: THREE.ColorRepresentation];
96
- export type TresLayers = THREE.Layers | Parameters<THREE.Layers['set']>[0];
97
- export type TresQuaternion = THREE.Quaternion | Parameters<THREE.Quaternion['set']>;
98
- export type TresEuler = THREE.Euler;
99
- export type TresControl = THREE.EventDispatcher & {
100
- enabled: boolean;
101
- };
102
- export type TresContextWithClock = TresContext & {
103
- delta: number;
104
- elapsed: number;
105
- };
106
- export type WithMathProps<P> = {
107
- [K in keyof P]: P[K] extends MathRepresentation | THREE.Euler ? MathType<P[K]> : P[K];
108
- };
109
- interface RaycastableRepresentation {
110
- raycast: (raycaster: THREE.Raycaster, intersects: THREE.Intersection[]) => void;
111
- }
112
- type EventProps<P> = P extends RaycastableRepresentation ? Partial<PointerEventHandlers> : unknown;
113
- export type { TresPointerEvent } from '../utils/pointerEvents';
114
- export interface VueProps {
115
- children?: VNode[];
116
- ref?: VNodeRef;
117
- key?: string | number | symbol;
118
- }
119
- export type ElementProps<T extends ConstructorRepresentation, P = InstanceType<T>> = Partial<Overwrite<P, WithMathProps<P> & VueProps & EventProps<P>>>;
120
- export type ThreeElement<T extends ConstructorRepresentation> = Mutable<Overwrite<ElementProps<T>, Omit<InstanceProps<InstanceType<T>, T>, 'object'>>>;
121
- type ThreeExports = typeof THREE;
122
- type ThreeInstancesImpl = {
123
- [K in keyof ThreeExports as Uncapitalize<K>]: ThreeExports[K] extends ConstructorRepresentation ? ThreeElement<ThreeExports[K]> : never;
124
- };
125
- export interface ThreeInstances extends ThreeInstancesImpl {
126
- primitive: Omit<ThreeElement<any>, 'args'> & {
127
- object: object;
128
- };
129
- }
130
- type TresComponents = {
131
- [K in keyof ThreeInstances as `Tres${Capitalize<string & K>}`]: DefineComponent<ThreeInstances[K]>;
132
- };
133
- declare module 'vue' {
134
- interface GlobalComponents extends TresComponents {
135
- primitive: DefineComponent<TresPrimitive>;
136
- }
137
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Like Array.filter, but modifies the array in place.
3
- * @param array - Array to modify
4
- * @param callbackFn - A function called for each element of the array. It should return a truthy value to keep the element in the array.
5
- */
6
- export declare const filterInPlace: <T>(array: T[], callbackFn: (element: T, index: number) => unknown) => T[];
@@ -1,15 +0,0 @@
1
- import { EventHookOff, EventHookTrigger } from '@vueuse/core';
2
- export type Callback<T> = Parameters<EventHookOff<T>>[0];
3
- export type PriorityEventHookOn<T> = (fn: Callback<T>, priority?: number) => {
4
- off: () => void;
5
- };
6
- export type PriorityEventHookOff<T> = EventHookOff<T>;
7
- export type PriorityEventHookTrigger<T> = EventHookTrigger<T>;
8
- export interface PriorityEventHook<T = any> {
9
- on: PriorityEventHookOn<T>;
10
- off: (fn: Callback<T>) => void;
11
- trigger: PriorityEventHookTrigger<T>;
12
- dispose: () => void;
13
- count: number;
14
- }
15
- export declare function createPriorityEventHook<T>(): PriorityEventHook<T>;
@@ -1,15 +0,0 @@
1
- import { Mesh, Object3D, Scene } from 'three';
2
- import { TresMaterial, TresObject } from '../types';
3
- export interface TresObjectMap {
4
- nodes: {
5
- [name: string]: TresObject;
6
- };
7
- materials: {
8
- [name: string]: TresMaterial;
9
- };
10
- meshes: {
11
- [name: string]: Mesh;
12
- };
13
- scene?: Scene;
14
- }
15
- export declare function buildGraph(object: Object3D | TresObject): TresObjectMap;
@@ -1,19 +0,0 @@
1
- import { nodeOps } from '../core/nodeOps';
2
- import { AttachType, LocalState, TresInstance, TresObject, TresPrimitive } from '../types';
3
- import { Material } from 'three';
4
- import { TresContext } from '../composables/useTresContextProvider';
5
- export * from './logger';
6
- export declare function disposeMaterial(material: Material): void;
7
- export declare function disposeObject3D(object: TresObject): void;
8
- export declare function resolve(obj: Record<string, any>, key: string): {
9
- target: Record<string, any>;
10
- key: string;
11
- };
12
- export declare function attach(parent: TresInstance, child: TresInstance, type: AttachType): void;
13
- export declare function detach(parent: any, child: TresInstance, type: AttachType): void;
14
- export declare function prepareTresInstance<T extends TresObject>(obj: T, state: Partial<LocalState>, context: TresContext): TresInstance;
15
- export declare function invalidateInstance(instance: TresObject): void;
16
- export declare function setPrimitiveObject(newObject: TresObject, primitive: TresPrimitive, setTarget: (object: TresObject) => void, nodeOpsFns: Pick<ReturnType<typeof nodeOps>, 'patchProp' | 'insert' | 'remove'>, context: TresContext): boolean;
17
- export declare function unboxTresPrimitive<T>(maybePrimitive: T): T | TresInstance;
18
- export declare function doRemoveDetach(node: TresObject, context: TresContext): void;
19
- export declare function doRemoveDeregister(node: TresObject, context: TresContext): void;
@@ -1 +0,0 @@
1
- export declare const isHTMLTag: (key: string) => boolean;
@@ -1,4 +0,0 @@
1
- export * from './dom';
2
- export * from './three';
3
- export * from './tres';
4
- export * from './typed';