blockbench-types 5.0.0-beta.1 → 5.0.0-beta.3

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 (55) hide show
  1. package/custom/action.d.ts +2 -1
  2. package/custom/animation.d.ts +1 -1
  3. package/custom/animation_controller.d.ts +1 -1
  4. package/custom/blockbench.d.ts +3 -1
  5. package/custom/canvas.d.ts +4 -2
  6. package/custom/codec.d.ts +10 -5
  7. package/custom/cube.d.ts +10 -4
  8. package/custom/desktop.d.ts +21 -17
  9. package/custom/display_mode.d.ts +1 -1
  10. package/custom/global.d.ts +1 -1
  11. package/custom/group.d.ts +3 -4
  12. package/custom/interface.d.ts +1 -1
  13. package/custom/keyframe.d.ts +3 -2
  14. package/custom/menu.d.ts +1 -1
  15. package/custom/mesh.d.ts +8 -3
  16. package/custom/misc.d.ts +8 -97
  17. package/custom/outliner.d.ts +20 -3
  18. package/custom/painter.d.ts +1 -1
  19. package/custom/preview.d.ts +1 -1
  20. package/custom/preview_scene.d.ts +1 -1
  21. package/custom/project.d.ts +1 -1
  22. package/custom/screencam.d.ts +1 -1
  23. package/custom/spline_mesh.d.ts +189 -0
  24. package/custom/texture_group.d.ts +1 -1
  25. package/custom/textures.d.ts +7 -3
  26. package/custom/timeline.d.ts +1 -1
  27. package/custom/undo.d.ts +4 -2
  28. package/custom/util/version_util.d.ts +32 -0
  29. package/custom/util.d.ts +5 -2
  30. package/custom/validator.d.ts +1 -1
  31. package/generated/animations/timeline_animators.d.ts +6 -0
  32. package/generated/global_types.d.ts +9 -0
  33. package/generated/interface/form.d.ts +4 -0
  34. package/generated/interface/panels.d.ts +16 -3
  35. package/generated/io/format.d.ts +42 -19
  36. package/generated/io/formats/bedrock_old.d.ts +1 -1
  37. package/generated/io/formats/image.d.ts +1 -0
  38. package/generated/io/io.d.ts +1 -1
  39. package/generated/lib/VuePrismEditor.min.d.ts +2 -1
  40. package/generated/modeling/mesh/proportional_edit.d.ts +1 -1
  41. package/generated/modeling/mirror_modeling.d.ts +37 -17
  42. package/generated/modeling/transform.d.ts +1 -1
  43. package/generated/outliner/armature.d.ts +4 -4
  44. package/generated/outliner/armature_bone.d.ts +59 -34
  45. package/generated/outliner/billboard.d.ts +5 -2
  46. package/generated/outliner/collections.d.ts +2 -2
  47. package/generated/outliner/spline_mesh.d.ts +4 -3
  48. package/generated/plugin_loader.d.ts +1 -0
  49. package/generated/util/json.d.ts +6 -1
  50. package/generated/util/property.d.ts +65 -23
  51. package/generated/util/versionUtil.d.ts +32 -0
  52. package/generated/util/version_util.d.ts +33 -0
  53. package/index.d.ts +2 -2
  54. package/package.json +2 -2
  55. /package/custom/{three.d.ts → libs.d.ts} +0 -0
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Registry of all toolbar items, such as actions, tools, etc.
3
3
  */
4
- /// <reference path="./blockbench.d.ts"/>
4
+ /// <reference types="./blockbench"/>
5
5
 
6
6
  import tinycolor from 'tinycolor2'
7
7
 
@@ -486,6 +486,7 @@ declare global {
486
486
  max?: number
487
487
  interval?: number
488
488
  step?: number
489
+ show_bar?: boolean
489
490
  }
490
491
  /**
491
492
  * Define a tool setting key under which the value of the slider is saved on the selected tool
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
 
3
3
  declare class AnimationItem {
4
4
  static all: _Animation[]
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
 
3
3
  type StateAnimationInput =
4
4
  | string
@@ -1,5 +1,5 @@
1
1
  /// <reference types="vue" />
2
- /// <reference types="./three" />
2
+ /// <reference types="./libs" />
3
3
  /// <reference types="@types/prismjs" />
4
4
  /// <reference types="@types/jquery" />
5
5
  /// <reference types="wintersky" />
@@ -21,6 +21,7 @@
21
21
  /// <reference types="./keyframe" />
22
22
  /// <reference types="./menu" />
23
23
  /// <reference types="./mesh" />
24
+ /// <reference types="./spline_mesh" />
24
25
  /// <reference types="./misc" />
25
26
  /// <reference types="./molang" />
26
27
  /// <reference types="./outliner" />
@@ -43,6 +44,7 @@
43
44
  /// <reference types="./canvas_frame" />
44
45
  /// <reference types="./io" />
45
46
  /// <reference types="./native_apis" />
47
+ /// <reference types="./util/VersionUtil" />
46
48
 
47
49
  /**
48
50
  * Provides access to global Javascript/DOM variables that are overwritten by Blockbench's own variables
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
  interface UpdateViewOptions {
3
3
  /**
4
4
  * List of elements to update
@@ -67,6 +67,7 @@ declare namespace Canvas {
67
67
  const emptyMaterials: {
68
68
  [uuid: UUID]: THREE.Material
69
69
  }
70
+ const coloredSolidMaterials: THREE.ShaderMaterial[]
70
71
  const meshes: {
71
72
  [uuid: UUID]: THREE.Mesh
72
73
  }
@@ -181,7 +182,7 @@ declare namespace Canvas {
181
182
  /**
182
183
  * Update the hierarchy and position of all bones
183
184
  */
184
- function updateAllBones(): void
185
+ function updateAllBones(bones?: OutlinerNode[]): void
185
186
  /**
186
187
  * Update the position of the origin / pivot point gizmo
187
188
  */
@@ -264,6 +265,7 @@ interface NodePreviewControllerOptions {
264
265
  updateFaces?(element: OutlinerNode): void
265
266
  updatePaintingGrid?(element: OutlinerNode): void
266
267
  updateHighlight?(element: OutlinerNode, ...args: any[]): void
268
+ [key: string]: any
267
269
  }
268
270
  declare class NodePreviewController {
269
271
  constructor(
package/custom/codec.d.ts CHANGED
@@ -1,9 +1,14 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
+ interface LoadOptions {
3
+ import_to_current_project?: boolean
4
+ externalDataLoader?: (path: string) => any
5
+ [key: string]: unknown
6
+ }
2
7
  interface CodecOptions {
3
8
  name: string
4
- load?(model: any, file: FileResult, add?: boolean): void
9
+ load?(model: any, file: FileResult, args?: LoadOptions): void
5
10
  compile?(options?: any): string | ArrayBuffer | any
6
- parse?(data: any, path: string, add?: boolean): void
11
+ parse?(data: any, path: string, args?: LoadOptions): void
7
12
  export?(): void
8
13
  /**
9
14
  * Generate a file name to suggest when exporting
@@ -63,7 +68,7 @@ declare class Codec extends Deletable {
63
68
  * @param file
64
69
  * @param add
65
70
  */
66
- load(model: any, file?: any, add?: boolean): void
71
+ load(model: any, file?: any, args?: LoadOptions): void
67
72
  /**
68
73
  * Compiles the file content
69
74
  * @param options
@@ -74,7 +79,7 @@ declare class Codec extends Deletable {
74
79
  * @param data File content
75
80
  * @param path File path
76
81
  */
77
- parse?(data: any, path: string, add?: boolean): void
82
+ parse?(data: any, path: string, args?: LoadOptions): void
78
83
  /**
79
84
  * Opens the file browser to export a file of this type
80
85
  */
package/custom/cube.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
  type CardinalDirection = 'north' | 'south' | 'east' | 'west' | 'up' | 'down'
3
3
 
4
4
  interface ICubeOptions {
@@ -13,6 +13,7 @@ interface ICubeOptions {
13
13
  to?: ArrayVector3
14
14
  rotation?: ArrayVector3
15
15
  origin?: ArrayVector3
16
+ stretch?: ArrayVector3
16
17
  box_uv?: boolean
17
18
  /**
18
19
  * UV position for box UV mode
@@ -54,6 +55,7 @@ declare class Cube extends OutlinerElement {
54
55
  to: ArrayVector3
55
56
  rotation: ArrayVector3
56
57
  origin: ArrayVector3
58
+ stretch: ArrayVector3
57
59
  faces: {
58
60
  [fkey: string]: CubeFace
59
61
  }
@@ -72,9 +74,13 @@ declare class Cube extends OutlinerElement {
72
74
 
73
75
  extend(options: ICubeOptions): this
74
76
  /**
75
- * Calculates and returns the size of a cube across a certain axis. If the axis argument is omitted, it returns all sizes as an array vector.
77
+ * Calculates and returns the size of the cube
76
78
  */
77
- size(axis?: number, floored?: boolean): number | ArrayVector3
79
+ size(): ArrayVector3
80
+ /**
81
+ * Calculates and returns the size of a cube on a certain axis
82
+ */
83
+ size(axis: number, floored?: boolean): number
78
84
  rotationAxis(): string
79
85
  getUndoCopy(aspects?: any): void
80
86
  getSaveCopy(project?: boolean): Cube
@@ -116,7 +122,7 @@ declare class Cube extends OutlinerElement {
116
122
  }
117
123
 
118
124
  interface FaceOptions {
119
- texture?: Texture
125
+ texture?: Texture | UUID | false
120
126
  }
121
127
  declare class Face {
122
128
  constructor()
@@ -49,20 +49,24 @@ type ScopedFS = Pick<typeof import("node:fs"),
49
49
  "stat"
50
50
  >
51
51
  }
52
- declare function requireNativeModule(module: 'fs', options?: {scope?: string, message?: string}): ScopedFS | undefined
53
- declare function requireNativeModule(module: 'path', options?: {message?: string}): typeof import("node:path");
54
- declare function requireNativeModule(module: 'crypto', options?: {message?: string}): typeof import("node:crypto");
55
- declare function requireNativeModule(module: 'events', options?: {message?: string}): typeof import("node:events");
56
- declare function requireNativeModule(module: 'zlib', options?: {message?: string}): typeof import("node:zlib");
57
- declare function requireNativeModule(module: 'timers', options?: {message?: string}): typeof import("node:timers");
58
- declare function requireNativeModule(module: 'url', options?: {message?: string}): typeof import("node:url");
59
- declare function requireNativeModule(module: 'string_decoder', options?: {message?: string}): typeof import("node:string_decoder");
60
- declare function requireNativeModule(module: 'querystring', options?: {message?: string}): typeof import("node:querystring");
61
- declare function requireNativeModule(module: 'child_process', options?: {message?: string}): (typeof import("node:child_process")) | undefined;
62
- declare function requireNativeModule(module: 'electron', options?: {message?: string}): (typeof import("node:electron")) | undefined;
63
- declare function requireNativeModule(module: 'https', options?: {message?: string}): (typeof import("node:https")) | undefined;
64
- declare function requireNativeModule(module: 'net', options?: {message?: string}): (typeof import("node:net")) | undefined;
65
- declare function requireNativeModule(module: 'tls', options?: {message?: string}): (typeof import("node:tls")) | undefined;
66
- declare function requireNativeModule(module: 'util', options?: {message?: string}): (typeof import("node:util")) | undefined;
67
- declare function requireNativeModule(module: 'os', options?: {message?: string}): (typeof import("node:os")) | undefined;
68
- declare function requireNativeModule(module: 'v8', options?: {message?: string}): (typeof import("node:v8")) | undefined;
52
+ interface RequireDialogOptions {
53
+ message?: string
54
+ optional?: boolean
55
+ }
56
+ declare function requireNativeModule(module: 'fs', options?: {scope?: string} & RequireDialogOptions): ScopedFS | undefined
57
+ declare function requireNativeModule(module: 'path'): typeof import("node:path");
58
+ declare function requireNativeModule(module: 'crypto'): typeof import("node:crypto");
59
+ declare function requireNativeModule(module: 'events'): typeof import("node:events");
60
+ declare function requireNativeModule(module: 'zlib'): typeof import("node:zlib");
61
+ declare function requireNativeModule(module: 'timers'): typeof import("node:timers");
62
+ declare function requireNativeModule(module: 'url'): typeof import("node:url");
63
+ declare function requireNativeModule(module: 'string_decoder'): typeof import("node:string_decoder");
64
+ declare function requireNativeModule(module: 'querystring'): typeof import("node:querystring");
65
+ declare function requireNativeModule(module: 'child_process', options?: RequireDialogOptions): (typeof import("node:child_process")) | undefined;
66
+ declare function requireNativeModule(module: 'electron', options?: RequireDialogOptions): (typeof import("node:electron")) | undefined;
67
+ declare function requireNativeModule(module: 'https', options?: RequireDialogOptions): (typeof import("node:https")) | undefined;
68
+ declare function requireNativeModule(module: 'net', options?: RequireDialogOptions): (typeof import("node:net")) | undefined;
69
+ declare function requireNativeModule(module: 'tls', options?: RequireDialogOptions): (typeof import("node:tls")) | undefined;
70
+ declare function requireNativeModule(module: 'util', options?: RequireDialogOptions): (typeof import("node:util")) | undefined;
71
+ declare function requireNativeModule(module: 'os', options?: RequireDialogOptions): (typeof import("node:os")) | undefined;
72
+ declare function requireNativeModule(module: 'v8', options?: RequireDialogOptions): (typeof import("node:v8")) | undefined;
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
  declare const DisplayMode: {
3
3
  slots: string[]
4
4
  }
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
 
3
3
  declare global {
4
4
  // const Prism: typeof import('prismjs')
package/custom/group.d.ts CHANGED
@@ -24,11 +24,10 @@ interface GroupOptions {
24
24
  declare class Group extends OutlinerNode {
25
25
  constructor(options: Partial<GroupOptions> | string)
26
26
  /**
27
- * Returns the first selected group.
28
- * In the future this will return an array of selected groups instead.
29
- * @deprecated Use {@link Group.multi_selected} instead!
27
+ * Returns the selected groups
28
+ * @Note This only includes directly selected groups, not groups that are selected because the parent is selected
30
29
  */
31
- static selected: Group | undefined
30
+ static selected: Group[]
32
31
  /**
33
32
  * The first group in {@link Group.multi_selected}
34
33
  */
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
 
3
3
  interface ResizeLineOptions {
4
4
  condition?: ConditionResolvable
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
 
3
3
  interface KeyframeDataPointData {
4
4
  [key: string]: any
@@ -27,6 +27,7 @@ interface KeyframeOptions {
27
27
  bezier_right_value?: ArrayVector3
28
28
  }
29
29
  type axisLetter = 'x' | 'y' | 'z'
30
+ type axisNumber = 0 | 1 | 2
30
31
 
31
32
  declare class _Keyframe {
32
33
  constructor(options: KeyframeOptions, uuid: any)
@@ -38,7 +39,7 @@ declare class _Keyframe {
38
39
  uuid: string
39
40
  color: number
40
41
  uniform: boolean
41
- interpolation: 'linear' | 'catmullrom' | 'bezier' | 'step'
42
+ interpolation: 'linear' | 'catmullrom' | 'bezier' | 'step' | string
42
43
  cooldown?: boolean
43
44
  bezier_linked: boolean
44
45
  bezier_left_time: ArrayVector3
package/custom/menu.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
  interface CustomMenuItem {
3
3
  name: string
4
4
  id?: string
package/custom/mesh.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
  type OccupationMatrix = {
3
3
  [x: number]: {
4
4
  [y: number]: boolean
@@ -32,7 +32,7 @@ declare class MeshFace extends Face {
32
32
  uv: {
33
33
  [vertex: string]: ArrayVector2
34
34
  }
35
- extend(data: MeshFaceOptions): void
35
+ extend(data: MeshFaceOptions): this
36
36
  /**
37
37
  * Returns the face normal in mesh space as calculated from the vertex positions
38
38
  * @param normalize If true, the values will be normalized.
@@ -99,6 +99,7 @@ interface MeshOptions {
99
99
  name?: string
100
100
  color?: number
101
101
  visibility?: boolean
102
+ shading?: 'flat' | 'smooth'
102
103
  rotation?: ArrayVector3
103
104
  origin?: ArrayVector3
104
105
  vertices?: {
@@ -108,8 +109,11 @@ interface MeshOptions {
108
109
  declare class Mesh extends OutlinerElement {
109
110
  constructor(options: Partial<MeshOptions>, uuid?: string)
110
111
 
112
+ shading: 'flat' | 'smooth'
111
113
  visibility: boolean
112
114
  color: number
115
+ origin: ArrayVector3
116
+ rotation: ArrayVector3
113
117
 
114
118
  vertices: {
115
119
  [vkey: string]: ArrayVector3
@@ -138,7 +142,7 @@ declare class Mesh extends OutlinerElement {
138
142
  * Get selected faces as face keys
139
143
  * @param can_write If true, the array can safely be modified to update the selection
140
144
  */
141
- getSelectedVertices(can_write?: boolean): string[]
145
+ getSelectedFaces(can_write?: boolean): string[]
142
146
 
143
147
  /**
144
148
  * Get the armature if one is attached to the mesh
@@ -148,6 +152,7 @@ declare class Mesh extends OutlinerElement {
148
152
  * Vertex lists of quads are generally in arbitrary order, the order is calculated when calling getSortedVertices() to account for dfiferent face geometries. Calling this method pre-sorts all faces to allow optimizing subsequent processing
149
153
  */
150
154
  sortAllFaceVertices(): void
155
+ calculateNormals(): Record<string, ArrayVector3>
151
156
 
152
157
  setSeam(edge: MeshEdge, value: any): void
153
158
  getSeam(edge: MeshEdge): MeshSeamValue
package/custom/misc.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
 
3
3
  declare class Deletable {
4
4
  /**
@@ -33,6 +33,8 @@ type EventName =
33
33
  | 'user_joins_session'
34
34
  | 'user_leaves_session'
35
35
  | 'process_chat_message'
36
+ | 'loaded_plugin'
37
+ | 'unloaded_plugin'
36
38
  | 'update_settings'
37
39
  | 'update_project_settings'
38
40
  | 'save_project'
@@ -47,6 +49,7 @@ type EventName =
47
49
  | 'add_group'
48
50
  | 'add_texture_mesh'
49
51
  | 'add_armature'
52
+ | 'add_armature_bone'
50
53
  | 'group_elements'
51
54
  | 'update_selection'
52
55
  | 'compile_bedrock_animations'
@@ -124,105 +127,10 @@ type EventName =
124
127
 
125
128
  type IconString = string
126
129
 
127
-
128
-
129
- interface PropertyOptions {
130
- default?: any
131
- condition?: ConditionResolvable
132
- exposed?: boolean
133
- label?: string
134
- /**
135
- * Options used for select types
136
- */
137
- options?: any
138
- /**
139
- * Enum possible values
140
- */
141
- values?: string[]
142
- merge?(instance: any, data: any): void
143
- reset?(instance: any): void
144
- merge_validation?(value: any): boolean
145
- }
146
-
147
- interface IPropertyType {
148
- string: string
149
- molang: string
150
- number: number
151
- boolean: boolean
152
- array: any[]
153
- object: any
154
- instance: any
155
- vector: ArrayVector3
156
- vector2: ArrayVector2
157
- }
158
-
159
- /**
160
- * Creates a new property on the specified target class
161
- */
162
- declare class Property<T extends keyof IPropertyType> extends Deletable {
163
- constructor(target_class: any, type: T, name: string, options?: PropertyOptions)
164
- class: any
165
- name: string
166
- type: T
167
- default: IPropertyType[T]
168
- export?: boolean
169
-
170
- isString: boolean
171
- isEnum: boolean
172
- isMolang: boolean
173
- isNumber: boolean
174
- isBoolean: boolean
175
- isArray: boolean
176
- isVector: boolean
177
- isVector2: boolean
178
- isInstance: boolean
179
-
180
- enum_values?: string[]
181
- merge_validation: undefined | ((value: IPropertyType[T]) => boolean)
182
- condition: ConditionResolvable
183
- exposed: boolean
184
- label: any
185
- inputs?: any
186
- merge(instance: IPropertyType[T], data: IPropertyType[T]): void
187
- reset(instance: IPropertyType[T]): void
188
- getDefault(instance: IPropertyType[T]): IPropertyType[T]
189
- copy(instance: IPropertyType[T], target: IPropertyType[T]): void
190
-
191
- static resetUniqueValues(type: any, instance: any): void
192
- }
130
+ declare const osfs: '\\' | '/';
193
131
 
194
132
  declare function updateSelection(): void
195
133
 
196
- /**
197
- * Returns a translated string in the current language
198
- * @param key Translation key
199
- * @param arguments Array of arguments that replace anchors (%0, etc.) in the translation. Items can be strings or anything that can be converted to strings
200
- */
201
- declare function tl(key: string, arguments?: any[]): string
202
-
203
- declare namespace Language {
204
- /**
205
- * Translation data for the current language
206
- */
207
- const data: {
208
- [key: string]: string
209
- }
210
- /**
211
- * Language code indicating the currently selected language
212
- */
213
- const code: string
214
- /**
215
- * Add translations for custom translation strings
216
- * @param language Two letter language code, e. G. 'en'
217
- * @param strings Object listing the translation keys and values
218
- */
219
- function addTranslations(language: string, strings: { [key: string]: string }): void
220
- }
221
-
222
- interface Object {
223
- boneConfig: Record<string, Property<any> | undefined>
224
- }
225
-
226
134
  declare var LZUTF8: any
227
135
 
228
136
  declare function unselectAllElements(): void
@@ -240,6 +148,9 @@ declare const Pressing: {
240
148
  }
241
149
  }
242
150
 
151
+ declare function updateCubeHighlights(hover_cube: Cube, force_off: boolean): void
152
+ declare function getRescalingFactor(angle: number): number
153
+
243
154
  declare function isStringNumber(value: any): boolean
244
155
 
245
156
  declare function marked(text: string): string
@@ -1,7 +1,12 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
  type ArrayVector4 = [number, number, number, number]
3
3
  type ArrayVector3 = [number, number, number]
4
4
  type ArrayVector2 = [number, number]
5
+ declare interface OutlinerNodeParentTraits {
6
+ children: OutlinerNode[]
7
+ openUp(): void
8
+ isOpen: boolean
9
+ }
5
10
 
6
11
  declare const elements: OutlinerNode[]
7
12
  /**
@@ -15,16 +20,19 @@ declare class OutlinerNode {
15
20
  uuid: UUID
16
21
  export: boolean
17
22
  locked: boolean
18
- parent?: Group | 'root'
23
+ parent?: (OutlinerNode & OutlinerNodeParentTraits) | 'root'
24
+ selected: boolean
19
25
  menu?: Menu
20
26
 
21
27
  public preview_controller: NodePreviewController
22
28
  static preview_controller: NodePreviewController
29
+ readonly scene_object: THREE.Object3D
23
30
 
24
31
  /**
25
32
  * Initializes the node. This should always be called when creating nodes that will be used in the outliner.
26
33
  */
27
34
  init(): this
35
+ extend(data: any): void
28
36
  addTo(target?: OutlinerNode | 'root'): this
29
37
  sortInBefore(target?: OutlinerNode, index_modifier?: number): this
30
38
  select(event?: any, isOutlinerClick?: boolean): this
@@ -66,6 +74,11 @@ declare class OutlinerNode {
66
74
  getSaveCopy?(...args: any[]): Record<string, any>
67
75
  sanitizeName(): string
68
76
 
77
+ getTypeBehavior(flag: string): boolean | string | any
78
+
79
+ static addBehaviorOverride(override_options: {condition: ConditionResolvable, behavior: Record<string, any>}): Deletable
80
+ static behavior_overrides = [];
81
+
69
82
  static uuids: {
70
83
  [uuid: UUID]: OutlinerNode
71
84
  }
@@ -79,6 +92,7 @@ declare class OutlinerElement extends OutlinerNode {
79
92
 
80
93
  constructor(data: any, uuid: string)
81
94
  selected: boolean
95
+ allow_mirror_modeling?: boolean
82
96
  mesh: THREE.Object3D | THREE.Mesh
83
97
  static fromSave(data: any, keep_uuid?: boolean): OutlinerElement
84
98
  static isParent: false
@@ -183,6 +197,7 @@ interface OutlinerToggle {
183
197
 
184
198
  declare namespace Outliner {
185
199
  const root: OutlinerNode[]
200
+ const ROOT: 'root'
186
201
  const elements: OutlinerElement[]
187
202
  const selected: OutlinerElement[]
188
203
  let control_menu_group: MenuItem[]
@@ -194,7 +209,9 @@ declare namespace Outliner {
194
209
  shade: OutlinerToggle
195
210
  visibility: OutlinerToggle
196
211
  [id: string]: OutlinerToggle
197
- }
212
+ };
213
+ function toJSON(): []
214
+ function loadJSON(array: [], add_to_project?: boolean): void;
198
215
  }
199
216
 
200
217
  declare const markerColors: {
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
  /**
3
3
  * A global namespace containing various functionality for Blockbench's 2D and 3D paint tools and texture editor
4
4
  */
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
  interface AnglePreset {
3
3
  position: ArrayVector3
4
4
  target?: ArrayVector3
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
  interface PreviewModelCubeTemplate {
3
3
  position: ArrayVector3
4
4
  size: ArrayVector3
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
  interface ModelProjectOptions {
3
3
  format: ModelFormat
4
4
  }
@@ -1,4 +1,4 @@
1
- /// <reference path="./blockbench.d.ts"/>
1
+ /// <reference types="./blockbench"/>
2
2
  interface ScreenshotOptions {
3
3
  crop?: boolean
4
4
  width?: number