blockbench-types 5.1.0 → 5.2.0-beta.0-next.2

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 (102) hide show
  1. package/README.md +30 -30
  2. package/custom/animation.d.ts +257 -256
  3. package/custom/animation_controller.d.ts +124 -124
  4. package/custom/blockbench.d.ts +73 -73
  5. package/custom/canvas.d.ts +324 -307
  6. package/custom/codec.d.ts +182 -182
  7. package/custom/copy_paste.d.ts +43 -42
  8. package/custom/cube.d.ts +151 -151
  9. package/custom/desktop.d.ts +61 -73
  10. package/custom/display_mode.d.ts +141 -137
  11. package/custom/edit_session.d.ts +38 -37
  12. package/custom/global.d.ts +181 -168
  13. package/custom/group.d.ts +113 -113
  14. package/custom/interface.d.ts +88 -78
  15. package/custom/io.d.ts +12 -12
  16. package/custom/{toolbars.d.ts → keybind.d.ts} +150 -221
  17. package/custom/keyframe.d.ts +94 -94
  18. package/custom/libs.d.ts +13 -13
  19. package/custom/menu_bar.d.ts +66 -0
  20. package/custom/mesh.d.ts +196 -196
  21. package/custom/misc.d.ts +196 -199
  22. package/custom/molang.d.ts +159 -159
  23. package/custom/outliner.d.ts +158 -158
  24. package/custom/painter.d.ts +102 -69
  25. package/custom/preview_scene.d.ts +120 -120
  26. package/custom/screencam.d.ts +71 -71
  27. package/custom/spline_mesh.d.ts +190 -189
  28. package/custom/texture_group.d.ts +68 -68
  29. package/custom/textures.d.ts +526 -515
  30. package/custom/timeline.d.ts +66 -66
  31. package/custom/undo.d.ts +209 -208
  32. package/custom/util/version_util.d.ts +32 -32
  33. package/custom/util.d.ts +235 -235
  34. package/custom/uveditor.d.ts +3 -3
  35. package/custom/validator.d.ts +99 -99
  36. package/documentation.md +12 -12
  37. package/generated/animations/mirror_animating.d.ts +7 -0
  38. package/generated/animations/timeline_animators.d.ts +1 -1
  39. package/generated/api.d.ts +8 -1
  40. package/generated/file_system.d.ts +2 -1
  41. package/generated/find_replace.d.ts +6 -0
  42. package/generated/formats/standards/obj.d.ts +9 -11
  43. package/generated/interface/actions.d.ts +16 -12
  44. package/generated/interface/form.d.ts +2 -1
  45. package/generated/interface/main_tools.d.ts +23 -0
  46. package/generated/interface/menu.d.ts +141 -0
  47. package/generated/interface/menu_bar.d.ts +2 -3
  48. package/generated/interface/resize_lines.d.ts +2 -0
  49. package/generated/interface/settings.d.ts +6 -2
  50. package/generated/interface/shared_actions.d.ts +5 -0
  51. package/generated/interface/start_screen.d.ts +62 -42
  52. package/generated/interface/toolbars.d.ts +146 -46
  53. package/generated/io/format.d.ts +1 -0
  54. package/generated/io/project.d.ts +10 -2
  55. package/generated/lib/CanvasFrame.d.ts +1 -0
  56. package/generated/main.d.ts +4 -1
  57. package/generated/modeling/mesh/add_mesh.d.ts +6 -0
  58. package/generated/modeling/mesh/proportional_edit.d.ts +15 -13
  59. package/generated/modeling/mesh/util.d.ts +8 -2
  60. package/generated/modeling/mirror_modeling.d.ts +4 -0
  61. package/generated/modeling/weight_paint.d.ts +11 -0
  62. package/generated/modes.d.ts +2 -2
  63. package/generated/native_apis.d.ts +3 -0
  64. package/generated/outliner/abstract/outliner_element.d.ts +1 -0
  65. package/generated/outliner/abstract/outliner_node.d.ts +1 -0
  66. package/generated/outliner/types/armature.d.ts +1 -1
  67. package/generated/outliner/types/armature_bone.d.ts +1 -1
  68. package/generated/outliner/types/billboard.d.ts +1 -1
  69. package/generated/outliner/types/bounding_box.d.ts +1 -1
  70. package/generated/outliner/types/cube.d.ts +1 -1
  71. package/generated/outliner/types/group.d.ts +1 -1
  72. package/generated/outliner/types/locator.d.ts +1 -1
  73. package/generated/outliner/types/mesh.d.ts +1 -1
  74. package/generated/outliner/types/null_object.d.ts +1 -1
  75. package/generated/outliner/types/spline_mesh.d.ts +1 -2
  76. package/generated/outliner/types/texture_mesh.d.ts +1 -1
  77. package/generated/plugin_loader.d.ts +1 -1
  78. package/generated/preview/preview.d.ts +280 -0
  79. package/generated/preview/reference_images.d.ts +1 -1
  80. package/generated/texturing/layers.d.ts +140 -0
  81. package/generated/util/gif.d.ts +12 -3
  82. package/generated/util/state_memory.d.ts +3 -11
  83. package/index.d.ts +2 -2
  84. package/package.json +39 -39
  85. package/tsconfig.json +19 -19
  86. package/type_config.json +43 -46
  87. package/custom/menu.d.ts +0 -136
  88. package/custom/preview.d.ts +0 -137
  89. package/custom/start_screen.d.ts +0 -15
  90. package/custom/texture_layers.d.ts +0 -117
  91. package/generated/global_types.d.ts +0 -47
  92. package/generated/io/formats/bedrock.d.ts +0 -4
  93. package/generated/io/formats/bedrock_old.d.ts +0 -4
  94. package/generated/io/formats/collada.d.ts +0 -4
  95. package/generated/io/formats/fbx.d.ts +0 -17
  96. package/generated/io/formats/gltf.d.ts +0 -6
  97. package/generated/io/formats/java_block.d.ts +0 -4
  98. package/generated/io/formats/modded_entity.d.ts +0 -139
  99. package/generated/io/formats/obj.d.ts +0 -12
  100. package/generated/io/formats/optifine_jem.d.ts +0 -3
  101. package/generated/io/formats/optifine_jpm.d.ts +0 -3
  102. package/generated/io/formats/skin.d.ts +0 -22
@@ -1,307 +1,324 @@
1
- /// <reference types="./blockbench"/>
2
- interface UpdateViewOptions {
3
- /**
4
- * List of elements to update
5
- */
6
- elements?: OutlinerElement[]
7
- /**
8
- * Which aspects of the elements to update
9
- */
10
- element_aspects?: {
11
- /**
12
- * Update visibility of elements
13
- */
14
- visibility?: boolean
15
- /**
16
- * Update the position and geometry
17
- */
18
- geometry?: boolean
19
- /**
20
- * Update the mesh faces
21
- */
22
- faces?: boolean
23
- /**
24
- * Update the UV mapping
25
- */
26
- uv?: boolean
27
- /**
28
- * Update the painting grid
29
- */
30
- painting_grid?: boolean
31
- /**
32
- * Update the transform of elements
33
- */
34
- transform?: boolean
35
- }
36
- /**
37
- * Groups to update
38
- */
39
- groups?: Group[]
40
- /**
41
- * Which aspects of the groups to update
42
- */
43
- group_aspects?: {
44
- /**
45
- * Update the transform of elements
46
- */
47
- transform?: boolean
48
- /**
49
- * Update visibility of elements
50
- */
51
- visibility?: boolean
52
- }
53
- /**
54
- * Whether to update the selection (updates the selection outlines and interface)
55
- */
56
- selection?: boolean
57
- }
58
-
59
- /**
60
- * A global namespace handling miscellaneous functionality related to the 3D preview
61
- */
62
- declare namespace Canvas {
63
- const gizmo_colors: Record<string, THREE.Color>
64
- const materials: {
65
- [uuid: UUID]: THREE.Material
66
- }
67
- const emptyMaterials: {
68
- [uuid: UUID]: THREE.Material
69
- }
70
- const coloredSolidMaterials: THREE.ShaderMaterial[]
71
- const meshes: {
72
- [uuid: UUID]: THREE.Mesh
73
- }
74
- const bones: {
75
- [uuid: UUID]: THREE.Object3D
76
- }
77
- /**
78
- * Main scene, shared across all tabs
79
- */
80
- const scene: THREE.Scene
81
- /**
82
- * List of the gizmos (control and UI elements) in the 3D scene
83
- */
84
- const gizmos: THREE.Object3D[]
85
- /**
86
- * The material used for all selection outlines
87
- */
88
- const outlineMaterial: THREE.LineBasicMaterial
89
- const meshOutlineMaterial: THREE.LineBasicMaterial
90
- const onionSkinEarlierMaterial: THREE.LineBasicMaterial
91
- const onionSkinLaterMaterial: THREE.LineBasicMaterial
92
- /**
93
- * The material used for the wireframe view
94
- */
95
- const wireframeMaterial: THREE.MeshBasicMaterial
96
- const solidMaterial: THREE.ShaderMaterial
97
- const normalHelperMaterial: THREE.ShaderMaterial
98
- const uvHelperMaterial: THREE.ShaderMaterial
99
- const meshVertexMaterial: THREE.PointsMaterial
100
- const transparentMaterial: THREE.MeshBasicMaterial
101
- /**
102
- * The material used for the grids
103
- */
104
- const gridMaterial: THREE.LineBasicMaterial
105
-
106
- const pivot_marker: THREE.Object3D
107
-
108
- const ground_plane: THREE.Mesh
109
- const brush_outline: THREE.Mesh
110
-
111
- const show_gizmos: boolean
112
-
113
- const global_light_color: THREE.Color
114
- const global_light_side: number
115
-
116
- const face_order: ['east', 'west', 'up', 'down', 'south', 'north']
117
-
118
- /**
119
- * Raycast on the currently selected preview
120
- */
121
- function raycast(event: MouseEvent): any
122
- /**
123
- * Execute the callback function without any gizmos, grids and helpers visible
124
- */
125
- function withoutGizmos(cb: () => void): void
126
- /**
127
- * Clear all elements from the scene
128
- */
129
- function clear(): void
130
- function buildGrid(): void
131
- function updateShading(): void
132
- /**
133
- * Updates selected aspects of the preview
134
- * @param options
135
- */
136
- function updateView(options: UpdateViewOptions): void
137
- /**
138
- * Regenerate all elements in the scene. Very unoptimized, use with care
139
- */
140
- function updateAll(): void
141
- /**
142
- * Update the position and shape of all elements
143
- */
144
- function updateAllPositions(): void
145
- /**
146
- * Update the visibility of all elements
147
- */
148
- function updateVisibility(): void
149
- /**
150
- * Update all faces in the scene
151
- * @param texture Texture filter. If specified, only faces with this texture will be updated
152
- */
153
- function updateAllFaces(texture?: Texture): void
154
- /**
155
- * Update all UV maps in the scene
156
- */
157
- function updateAllUVs(): void
158
- /**
159
- * Returns the three.js render sides based on the current settings and state
160
- */
161
- function getRenderSide(): number
162
- /**
163
- * Update render sides of all materials
164
- */
165
- function updateRenderSides(): void
166
- /**
167
- * Redraw the selected elements in the scene
168
- * @param arr Optionally specify an array of elements to update
169
- */
170
-
171
- function updateSelected(arr: any): void
172
- /**
173
- * Update positions and shapes of the selected elements
174
- */
175
- function updatePositions(y?: number): void
176
- /**
177
- * Update the faces of all selected elements (material, UV map)
178
- */
179
- function updateSelectedFaces(): void
180
- /**
181
- * Update the UV maps of all selected elements
182
- */
183
- function updateUVs(): void
184
- /**
185
- * Update the hierarchy and position of all bones
186
- */
187
- function updateAllBones(bones?: OutlinerNode[]): void
188
- /**
189
- * Update the position of the origin / pivot point gizmo
190
- */
191
- function updateOrigin(): boolean
192
- /**
193
- * Update the position and shape of the specified cube
194
- * @param cube Cube to update
195
- * @param mesh Mesh instance of the cube
196
- */
197
- function adaptObjectPosition(cube: Cube, mesh?: THREE.Mesh): void
198
- /**
199
- * Update the geometry faces of the specified cube
200
- * @param cube Cube to update
201
- */
202
- function adaptObjectFaceGeo(cube: any): void
203
- /**
204
- * Update the faces (material) of the specified cube
205
- * @param cube Cube to update
206
- * @param mesh Mesh instance of the cube
207
- */
208
- function adaptObjectFaces(cube: any, mesh: any): void
209
- /**
210
- * Update the layered or not layered material of all elements
211
- */
212
- function updateLayeredTextures(): void
213
- /**
214
- * Update the UV map of the specified cube
215
- * @param cube Cube to update
216
- * @param animation Whether to display the current animated texture frame
217
- */
218
- function updateUV(cube: Cube, animation?: boolean): any
219
- /**
220
- * Update the materials of marker colors if new colors were added
221
- */
222
- function updateMarkerColorMaterials(): void
223
- /**
224
- * Create an additional outline around the specified cubes
225
- * @param arr List of cubes to outline
226
- */
227
- function outlineObjects(arr: Cube[]): void
228
- /**
229
- * Calculate the size of the model, in the currently displayed shape. Returns [width, height] in blockbench units
230
- */
231
- function getModelSize(): [number, number]
232
- }
233
-
234
- /**
235
- * Marks a specific aspect of the interface to be updated in the next tick. Useful to avoid an update function getting called multiple times in the same task.
236
- */
237
- declare namespace TickUpdates {
238
- let interface: undefined | true
239
- let outliner: undefined | true
240
- let selection: undefined | true
241
- let main_uv: undefined | true
242
- let texture_list: undefined | true
243
- let keyframes: undefined | true
244
- let keyframe_selection: undefined | true
245
- let keybind_conflicts: undefined | true
246
- }
247
-
248
- interface NodePreviewControllerOptions {
249
- /**
250
- * NOTE: This option is just for type checking and should not be set in the options object. It should be set inside of the setup function via `this.mesh`
251
- *
252
- * ```
253
- * setup(element) {
254
- * this.mesh = new THREE.Mesh()
255
- * }
256
- * ```
257
- */
258
- mesh?: THREE.Object3D | THREE.Mesh
259
- setup?(element: OutlinerNode): void
260
- remove?(element: OutlinerNode): void
261
- updateAll?(element: OutlinerNode): void
262
- updateTransform?(element: OutlinerNode): void
263
- updateVisibility?(element: OutlinerNode): void
264
- updateSelection?(element: OutlinerNode): void
265
- updateGeometry?(element: OutlinerNode): void
266
- updateUV?(element: OutlinerNode): void
267
- updateFaces?(element: OutlinerNode): void
268
- updatePaintingGrid?(element: OutlinerNode): void
269
- updateHighlight?(element: OutlinerNode, ...args: any[]): void
270
- [key: string]: any
271
- }
272
- declare class NodePreviewController {
273
- constructor(
274
- type: typeof OutlinerElement | typeof OutlinerNode,
275
- options: NodePreviewControllerOptions
276
- )
277
- type: typeof OutlinerNode
278
- events: {
279
- [event_name: string]: ((data: any) => void)[]
280
- }
281
- mesh: THREE.Object3D | THREE.Mesh
282
- dispatchEvent(event_name: string, data: Record<string, any>): void
283
- /**
284
- * Adds an event listener
285
- */
286
- on(event_name: string, cb: (data: any) => void): void
287
- /**
288
- * Adds a single-use event listener
289
- */
290
- once(event_name: string, cb: (data: any) => void): void
291
- /**
292
- * Removes an event listener
293
- */
294
- removeListener(event_name: string, cb: (data: any) => void): void
295
-
296
- setup(element: OutlinerNode): void
297
- remove(element: OutlinerNode): void
298
- updateAll(element: OutlinerNode): void
299
- updateTransform(element: OutlinerNode): void
300
- updateVisibility(element: OutlinerNode): void
301
- updateSelection(element: OutlinerNode): void
302
- updateGeometry(instance: OutlinerNode): void
303
- updateUV(instance: OutlinerNode): void
304
- updateFaces(instance: OutlinerNode): void
305
- updatePaintingGrid(instance: OutlinerNode): void
306
- updateHighlight(instance: OutlinerNode, ...args: any[]): void
307
- }
1
+ /// <reference types="./blockbench"/>
2
+ interface UpdateViewOptions {
3
+ /**
4
+ * List of elements to update
5
+ */
6
+ elements?: OutlinerElement[]
7
+ /**
8
+ * Which aspects of the elements to update
9
+ */
10
+ element_aspects?: {
11
+ /**
12
+ * Update visibility of elements
13
+ */
14
+ visibility?: boolean
15
+ /**
16
+ * Update the position and geometry
17
+ */
18
+ geometry?: boolean
19
+ /**
20
+ * Update the mesh faces
21
+ */
22
+ faces?: boolean
23
+ /**
24
+ * Update the UV mapping
25
+ */
26
+ uv?: boolean
27
+ /**
28
+ * Update the painting grid
29
+ */
30
+ painting_grid?: boolean
31
+ /**
32
+ * Update the transform of elements
33
+ */
34
+ transform?: boolean
35
+ }
36
+ /**
37
+ * Groups to update
38
+ */
39
+ groups?: Group[]
40
+ /**
41
+ * Which aspects of the groups to update
42
+ */
43
+ group_aspects?: {
44
+ /**
45
+ * Update the transform of elements
46
+ */
47
+ transform?: boolean
48
+ /**
49
+ * Update visibility of elements
50
+ */
51
+ visibility?: boolean
52
+ }
53
+ /**
54
+ * Whether to update the selection (updates the selection outlines and interface)
55
+ */
56
+ selection?: boolean
57
+ }
58
+
59
+ /**
60
+ * A global namespace handling miscellaneous functionality related to the 3D preview
61
+ */
62
+ declare namespace Canvas {
63
+ const gizmo_colors: Record<string, THREE.Color>
64
+ const materials: {
65
+ [uuid: UUID]: THREE.Material
66
+ }
67
+ const emptyMaterials: {
68
+ [uuid: UUID]: THREE.Material
69
+ }
70
+ const coloredSolidMaterials: THREE.ShaderMaterial[]
71
+ const meshes: {
72
+ [uuid: UUID]: THREE.Mesh
73
+ }
74
+ const bones: {
75
+ [uuid: UUID]: THREE.Object3D
76
+ }
77
+ let outlines: THREE.Object3D
78
+ /**
79
+ * Main scene, shared across all tabs
80
+ */
81
+ const scene: THREE.Scene
82
+ /**
83
+ * List of the gizmos (control and UI elements) in the 3D scene
84
+ */
85
+ const gizmos: THREE.Object3D[]
86
+ /**
87
+ * The material used for all selection outlines
88
+ */
89
+ const outlineMaterial: THREE.LineBasicMaterial
90
+ const meshOutlineMaterial: THREE.LineBasicMaterial
91
+ const onionSkinEarlierMaterial: THREE.LineBasicMaterial
92
+ const onionSkinLaterMaterial: THREE.LineBasicMaterial
93
+ /**
94
+ * The material used for the wireframe view
95
+ */
96
+ const wireframeMaterial: THREE.MeshBasicMaterial
97
+ const solidMaterial: THREE.ShaderMaterial
98
+ const normalHelperMaterial: THREE.ShaderMaterial
99
+ const uvHelperMaterial: THREE.ShaderMaterial
100
+ const meshVertexMaterial: THREE.PointsMaterial
101
+ const transparentMaterial: THREE.MeshBasicMaterial
102
+ /**
103
+ * The material used for the grids
104
+ */
105
+ const gridMaterial: THREE.LineBasicMaterial
106
+
107
+ const pivot_marker: THREE.Object3D
108
+
109
+ const ground_plane: THREE.Mesh
110
+ const brush_outline: THREE.Mesh
111
+
112
+ let show_gizmos: boolean
113
+ let ground_animation: boolean
114
+
115
+ const global_light_color: THREE.Color
116
+ let global_light_side: number
117
+
118
+ const face_order: ['east', 'west', 'up', 'down', 'south', 'north']
119
+
120
+ const hover_helper_line: THREE.LineSegments
121
+ const hover_helper_vertex: THREE.Points
122
+
123
+ /**
124
+ * Raycast on the currently selected preview
125
+ */
126
+ function raycast(event: MouseEvent): any
127
+ /**
128
+ * Execute the callback function without any gizmos, grids and helpers visible
129
+ */
130
+ function withoutGizmos(cb: () => void): void
131
+ /**
132
+ * Clear all elements from the scene
133
+ */
134
+ function clear(): void
135
+ function buildGrid(): void
136
+ function updateShading(): void
137
+ function updateViewMode(): void
138
+ function updateCubeHighlights(hover_cube: OutlinerElement, force_off?: boolean): void
139
+ /**
140
+ * Updates selected aspects of the preview
141
+ * @param options
142
+ */
143
+ function updateView(options: UpdateViewOptions): void
144
+ /**
145
+ * Regenerate all elements in the scene. Very unoptimized, use with care
146
+ */
147
+ function updateAll(): void
148
+ /**
149
+ * Update the position and shape of all elements
150
+ */
151
+ function updateAllPositions(): void
152
+ /**
153
+ * Update the visibility of all elements
154
+ */
155
+ function updateVisibility(): void
156
+ /**
157
+ * Update all faces in the scene
158
+ * @param texture Texture filter. If specified, only faces with this texture will be updated
159
+ */
160
+ function updateAllFaces(texture?: Texture): void
161
+ /**
162
+ * Update all UV maps in the scene
163
+ */
164
+ function updateAllUVs(): void
165
+ /**
166
+ * Returns the three.js render sides based on the current settings and state
167
+ */
168
+ function getRenderSide(): number
169
+ /**
170
+ * Update render sides of all materials
171
+ */
172
+ function updateRenderSides(): void
173
+ /**
174
+ * Redraw the selected elements in the scene
175
+ * @param arr Optionally specify an array of elements to update
176
+ */
177
+
178
+ function updateSelected(arr: any): void
179
+ /**
180
+ * Update positions and shapes of the selected elements
181
+ */
182
+ function updatePositions(y?: number): void
183
+ /**
184
+ * Update the faces of all selected elements (material, UV map)
185
+ */
186
+ function updateSelectedFaces(): void
187
+ /**
188
+ * Update the UV maps of all selected elements
189
+ */
190
+ function updateUVs(): void
191
+ /**
192
+ * Update the hierarchy and position of all bones
193
+ */
194
+ function updateAllBones(bones?: OutlinerNode[]): void
195
+ /**
196
+ * Update the position of the origin / pivot point gizmo
197
+ */
198
+ function updatePivotMarker(): boolean
199
+ /**
200
+ * Update the position and shape of the specified cube
201
+ * @param cube Cube to update
202
+ * @param mesh Mesh instance of the cube
203
+ */
204
+ function adaptObjectPosition(cube: Cube, mesh?: THREE.Mesh): void
205
+ /**
206
+ * Update the geometry faces of the specified cube
207
+ * @param cube Cube to update
208
+ */
209
+ function adaptObjectFaceGeo(cube: any): void
210
+ /**
211
+ * Update the faces (material) of the specified cube
212
+ * @param cube Cube to update
213
+ * @param mesh Mesh instance of the cube
214
+ */
215
+ function adaptObjectFaces(cube: any, mesh: any): void
216
+ /**
217
+ * Update the layered or not layered material of all elements
218
+ */
219
+ function updateLayeredTextures(): void
220
+ /**
221
+ * Update the UV map of the specified cube
222
+ * @param cube Cube to update
223
+ * @param animation Whether to display the current animated texture frame
224
+ */
225
+ function updateUV(cube: Cube, animation?: boolean): any
226
+ /**
227
+ * Update the materials of marker colors if new colors were added
228
+ */
229
+ function updateMarkerColorMaterials(): void
230
+ /**
231
+ * Create an additional outline around the specified cubes
232
+ * @param arr List of cubes to outline
233
+ */
234
+ function outlineObjects(arr: Cube[]): void
235
+ /**
236
+ * Calculate the size of the model, in the currently displayed shape. Returns [width, height] in blockbench units
237
+ */
238
+ function getModelSize(): [number, number]
239
+ function getSelectionBounds(): THREE.Box3
240
+ }
241
+
242
+ /**
243
+ * Marks a specific aspect of the interface to be updated in the next tick. Useful to avoid an update function getting called multiple times in the same task.
244
+ */
245
+ declare namespace TickUpdates {
246
+ private function Run(): void
247
+ let interface: undefined | true
248
+ let outliner: undefined | true
249
+ let selection: undefined | true
250
+ let main_uv: undefined | true
251
+ let texture_list: undefined | true
252
+ let keyframes: undefined | true
253
+ let keyframe_selection: undefined | true
254
+ let keybind_conflicts: undefined | true
255
+ }
256
+
257
+ interface NodePreviewControllerOptions {
258
+ /**
259
+ * NOTE: This option is just for type checking and should not be set in the options object. It should be set inside of the setup function via `this.mesh`
260
+ *
261
+ * ```
262
+ * setup(element) {
263
+ * this.mesh = new THREE.Mesh()
264
+ * }
265
+ * ```
266
+ */
267
+ mesh?: THREE.Object3D | THREE.Mesh
268
+ setup?(element: OutlinerNode): void
269
+ remove?(element: OutlinerNode): void
270
+ updateAll?(element: OutlinerNode): void
271
+ updateTransform?(element: OutlinerNode): void
272
+ updateVisibility?(element: OutlinerNode): void
273
+ updateSelection?(element: OutlinerNode): void
274
+ updateGeometry?(element: OutlinerNode): void
275
+ updateUV?(element: OutlinerNode): void
276
+ updateFaces?(element: OutlinerNode): void
277
+ updatePaintingGrid?(element: OutlinerNode): void
278
+ updateHighlight?(element: OutlinerNode, ...args: any[]): void
279
+ [key: string]: any
280
+ }
281
+ interface ViewportRectangleOverlapContext {
282
+ projectPoint: (vector: THREE.Vector3) => ArrayVector2
283
+ extend_selection: boolean
284
+ rect_start: ArrayVector2
285
+ rect_end: ArrayVector2
286
+ preview: Preview
287
+ }
288
+ declare class NodePreviewController {
289
+ constructor(
290
+ type: typeof OutlinerElement | typeof OutlinerNode,
291
+ options: NodePreviewControllerOptions
292
+ )
293
+ type: typeof OutlinerNode
294
+ events: {
295
+ [event_name: string]: ((data: any) => void)[]
296
+ }
297
+ mesh: THREE.Object3D | THREE.Mesh
298
+ dispatchEvent(event_name: string, data: Record<string, any>): void
299
+ /**
300
+ * Adds an event listener
301
+ */
302
+ on(event_name: string, cb: (data: any) => void): void
303
+ /**
304
+ * Adds a single-use event listener
305
+ */
306
+ once(event_name: string, cb: (data: any) => void): void
307
+ /**
308
+ * Removes an event listener
309
+ */
310
+ removeListener(event_name: string, cb: (data: any) => void): void
311
+
312
+ setup(element: OutlinerNode): void
313
+ remove(element: OutlinerNode): void
314
+ updateAll(element: OutlinerNode): void
315
+ updateTransform(element: OutlinerNode): void
316
+ updateVisibility(element: OutlinerNode): void
317
+ updateSelection(element: OutlinerNode): void
318
+ updateGeometry(instance: OutlinerNode): void
319
+ updateUV(instance: OutlinerNode): void
320
+ updateFaces(instance: OutlinerNode): void
321
+ updatePaintingGrid(instance: OutlinerNode): void
322
+ updateHighlight(instance: OutlinerNode, ...args: any[]): void
323
+ viewportRectangleOverlap(element: OutlinerNode, context: ViewportRectangleOverlapContext)
324
+ }