blockbench-types 4.12.1 → 5.0.0-beta.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 (123) hide show
  1. package/README.md +29 -2
  2. package/{types → custom}/action.d.ts +45 -12
  3. package/{types → custom}/animation.d.ts +2 -0
  4. package/custom/blockbench.d.ts +71 -0
  5. package/{types → custom}/canvas.d.ts +18 -0
  6. package/{types → custom}/codec.d.ts +7 -1
  7. package/{types → custom}/cube.d.ts +4 -0
  8. package/{types → custom}/desktop.d.ts +1 -0
  9. package/{types → custom}/dialog.d.ts +0 -110
  10. package/{types → custom}/format.d.ts +9 -1
  11. package/{types → custom}/global.d.ts +3 -0
  12. package/{types → custom}/group.d.ts +6 -0
  13. package/{types → custom}/misc.d.ts +15 -12
  14. package/{types → custom}/outliner.d.ts +6 -3
  15. package/{types → custom}/preview.d.ts +36 -0
  16. package/{types → custom}/project.d.ts +3 -0
  17. package/{types → custom}/shared_actions.d.ts +1 -1
  18. package/{types → custom}/textures.d.ts +18 -2
  19. package/{types → custom}/undo.d.ts +13 -0
  20. package/{types → custom}/util.d.ts +17 -20
  21. package/{types → custom}/validator.d.ts +3 -0
  22. package/generated/animations/animation.d.ts +68 -0
  23. package/generated/animations/animation_controllers.d.ts +212 -0
  24. package/generated/animations/animation_mode.d.ts +366 -0
  25. package/generated/animations/keyframe.d.ts +62 -0
  26. package/generated/animations/molang.d.ts +29 -0
  27. package/generated/animations/timeline.d.ts +59 -0
  28. package/generated/animations/timeline_animators.d.ts +114 -0
  29. package/generated/api.d.ts +112 -0
  30. package/generated/copy_paste.d.ts +39 -0
  31. package/generated/edit_sessions.d.ts +83 -0
  32. package/generated/file_system.d.ts +160 -0
  33. package/generated/interface/dialog.d.ts +96 -0
  34. package/generated/interface/form.d.ts +165 -0
  35. package/generated/interface/keyboard.d.ts +51 -0
  36. package/generated/interface/menu_bar.d.ts +31 -0
  37. package/generated/interface/panels.d.ts +136 -0
  38. package/generated/interface/settings.d.ts +147 -0
  39. package/generated/interface/setup_settings.d.ts +5 -0
  40. package/generated/interface/start_screen.d.ts +84 -0
  41. package/generated/interface/themes.d.ts +96 -0
  42. package/generated/interface/toolbars.d.ts +50 -0
  43. package/generated/io/format.d.ts +272 -0
  44. package/generated/io/formats/bedrock.d.ts +5 -0
  45. package/generated/io/formats/bedrock_old.d.ts +5 -0
  46. package/generated/io/formats/collada.d.ts +5 -0
  47. package/generated/io/formats/fbx.d.ts +17 -0
  48. package/generated/io/formats/gltf.d.ts +6 -0
  49. package/generated/io/formats/image.d.ts +3 -0
  50. package/generated/io/formats/java_block.d.ts +4 -0
  51. package/generated/io/formats/modded_entity.d.ts +140 -0
  52. package/generated/io/formats/obj.d.ts +13 -0
  53. package/generated/io/formats/optifine_jem.d.ts +3 -0
  54. package/generated/io/formats/optifine_jpm.d.ts +3 -0
  55. package/generated/io/formats/skin.d.ts +22 -0
  56. package/generated/io/io.d.ts +12 -0
  57. package/generated/languages.d.ts +49 -0
  58. package/generated/lib/CanvasFrame.d.ts +22 -0
  59. package/generated/lib/VuePrismEditor.min.d.ts +5 -0
  60. package/generated/lib/canvas2apng.d.ts +47 -0
  61. package/generated/lib/color-picker.min.d.ts +2 -0
  62. package/generated/lib/easing.d.ts +34 -0
  63. package/generated/lib/libs.d.ts +17 -0
  64. package/generated/main.d.ts +134 -0
  65. package/generated/misc.d.ts +59 -0
  66. package/generated/modeling/mesh_editing.d.ts +84 -0
  67. package/generated/modeling/mirror_modeling.d.ts +20 -0
  68. package/generated/modeling/scale.d.ts +13 -0
  69. package/generated/modeling/transform.d.ts +33 -0
  70. package/generated/modes.d.ts +61 -0
  71. package/generated/outliner/billboard.d.ts +74 -0
  72. package/generated/outliner/collections.d.ts +80 -0
  73. package/generated/outliner/spline_mesh.d.ts +216 -0
  74. package/generated/plugin_loader.d.ts +216 -0
  75. package/generated/predicate_editor.d.ts +111 -0
  76. package/generated/preview/OrbitControls.d.ts +70 -0
  77. package/generated/preview/reference_images.d.ts +91 -0
  78. package/generated/shaders/shader.d.ts +9 -0
  79. package/generated/texturing/color.d.ts +19 -0
  80. package/generated/texturing/texture_flipbook.d.ts +18 -0
  81. package/generated/texturing/texture_generator.d.ts +106 -0
  82. package/generated/util/event_system.d.ts +16 -0
  83. package/generated/util/json.d.ts +31 -0
  84. package/generated/util/molang.d.ts +6 -0
  85. package/generated/util/property.d.ts +39 -0
  86. package/generated/util/state_memory.d.ts +14 -0
  87. package/generated/util/yaml.d.ts +10 -0
  88. package/generated/web.d.ts +6 -0
  89. package/index.d.ts +2 -0
  90. package/package.json +4 -13
  91. package/type_config.json +41 -0
  92. package/.prettierignore +0 -1
  93. package/.prettierrc.json +0 -9
  94. package/.vscode/settings.json +0 -4
  95. package/scripts/generate_docs.js +0 -418
  96. package/tsconfig.json +0 -17
  97. package/types/blockbench.d.ts +0 -518
  98. package/types/collection.d.ts +0 -76
  99. package/types/file_system.d.ts +0 -159
  100. package/types/index.d.ts +0 -1
  101. package/types/legacy.d.ts +0 -6
  102. package/types/mode.d.ts +0 -58
  103. package/types/panel.d.ts +0 -98
  104. package/types/plugin.d.ts +0 -182
  105. package/types/settings.d.ts +0 -101
  106. /package/{types → custom}/animation_controller.d.ts +0 -0
  107. /package/{types → custom}/canvas_frame.d.ts +0 -0
  108. /package/{types → custom}/display_mode.d.ts +0 -0
  109. /package/{types → custom}/interface.d.ts +0 -0
  110. /package/{types → custom}/io.d.ts +0 -0
  111. /package/{types → custom}/keyframe.d.ts +0 -0
  112. /package/{types → custom}/math_util.d.ts +0 -0
  113. /package/{types → custom}/menu.d.ts +0 -0
  114. /package/{types → custom}/mesh.d.ts +0 -0
  115. /package/{types → custom}/molang.d.ts +0 -0
  116. /package/{types → custom}/painter.d.ts +0 -0
  117. /package/{types → custom}/preview_scene.d.ts +0 -0
  118. /package/{types → custom}/screencam.d.ts +0 -0
  119. /package/{types → custom}/texture_group.d.ts +0 -0
  120. /package/{types → custom}/texture_layers.d.ts +0 -0
  121. /package/{types → custom}/three.d.ts +0 -0
  122. /package/{types → custom}/timeline.d.ts +0 -0
  123. /package/{types → custom}/uveditor.d.ts +0 -0
package/README.md CHANGED
@@ -1,3 +1,30 @@
1
- # Blockbench Types [![npm version](https://img.shields.io/npm/v/blockbench-types)](https://www.npmjs.com/package/blockbench-types)
1
+ # Blockbench Typescript Types!
2
+
3
+ ## Generated types
4
+ All type definitions in the folder /generated/ are auto-generated from the Blockbench source.
5
+ All exports are converted to global declarations.
6
+ To exclude source files from generating types, add them to the "exclude" list in type_config.json.
7
+ To exclude individual exports, use the typescript @private flag.
8
+
9
+ ## Custom types
10
+ All type definitions in the /custom/ folder are manually written and are intended to provide types for old files that are still in Javascript.
11
+
12
+
13
+ ## Generating types
14
+ Run `npm run generate-types` from the main repo. Ensure typescript throws no errors, otherwise files won't export correctly.
15
+
16
+ ## Locally testing and using types
17
+ To use these types in other projects on your local PC before they are published, run this command in your other project:
18
+
19
+ `npm install "C:/path/to/blockbench/types"`
20
+
21
+ Where the path leads to this /types/ folder in the Blockbench repository.
22
+
23
+ ## Publishing types
24
+
25
+ `npm run publish-types --dry-run`
26
+
27
+ `npm run publish-types --tag beta`
28
+
29
+ `npm run publish-types`
2
30
 
3
- Blockbench typescript types!
@@ -51,6 +51,7 @@ declare global {
51
51
  variations?: {
52
52
  [key: string]: { name: string; description?: string }
53
53
  }
54
+ readonly label: string
54
55
  set(keys: KeybindKeys): this
55
56
  /**
56
57
  * Unassign the assigned key
@@ -128,6 +129,7 @@ declare global {
128
129
  class KeybindItem extends Deletable {
129
130
  constructor(id: string, options: KeybindItemOptions)
130
131
  keybind: Keybind
132
+ condition?: ConditionResolvable
131
133
  variations?: {
132
134
  [key: string]: { name: string; description?: string }
133
135
  }
@@ -147,6 +149,7 @@ declare global {
147
149
  | 'changed'
148
150
  | 'update'
149
151
  | 'open'
152
+ | 'modify_color'
150
153
  interface BarItemOptions extends KeybindItemOptions {
151
154
  name?: string
152
155
  description?: string
@@ -161,6 +164,11 @@ declare global {
161
164
  class BarItem extends KeybindItem {
162
165
  constructor(id: string, options: BarItemOptions)
163
166
  id: string
167
+ name: string
168
+ description: string
169
+ icon?: string
170
+ category?: string
171
+
164
172
  node: HTMLElement
165
173
  nodes: HTMLElement[]
166
174
  conditionMet(): boolean
@@ -177,7 +185,7 @@ declare global {
177
185
  /**
178
186
  * Appends the bar item to a HTML element
179
187
  */
180
- toElement(destination: HTMLElement): this
188
+ toElement(destination: HTMLElement | string): this
181
189
  pushToolbar(bar: any): void
182
190
 
183
191
  /**
@@ -185,19 +193,19 @@ declare global {
185
193
  * @param event_name The event type to listen for
186
194
  * @param callback
187
195
  */
188
- on(event_name: ActionEventName, callback: (data: object) => void): void
196
+ on(event_name: ActionEventName, callback: (data: Record<string, any>) => void): void
189
197
  /**
190
198
  * Adds a single-use event listener to the item
191
199
  * @param event_name The event type to listen for
192
200
  * @param callback
193
201
  */
194
- once(event_name: ActionEventName, callback: (data: object) => void): void
202
+ once(event_name: ActionEventName, callback: (data: Record<string, any>) => void): void
195
203
  /**
196
204
  * Removes an event listener from the item
197
205
  * @param event_name
198
206
  * @param callback
199
207
  */
200
- removeListener(event_name: ActionEventName, callback: (data: object) => void): void
208
+ removeListener(event_name: ActionEventName, callback: (data: Record<string, any>) => void): void
201
209
  constructor(id: string, options: BarItemOptions)
202
210
  conditionMet(): boolean
203
211
  /**
@@ -228,11 +236,7 @@ declare global {
228
236
  * Icon color. Can be a CSS color string, or an axis letter to use an axis color.
229
237
  */
230
238
  color?: string
231
- /**
232
- * ID of a setting that the action is slinked to
233
- */
234
- linked_setting?: string
235
- children?: any[]
239
+ children?: any[] | (() => any[])
236
240
  /**
237
241
  * Show the full label in toolbars
238
242
  */
@@ -251,6 +255,7 @@ declare global {
251
255
  */
252
256
  class Action extends BarItem {
253
257
  constructor(id: string, options: ActionOptions)
258
+ icon: string
254
259
  nodes: HTMLElement[]
255
260
  /**
256
261
  * Provide a menu that belongs to the action, and gets displayed as a small arrow next to it in toolbars.
@@ -276,15 +281,20 @@ declare global {
276
281
  setIcon(icon: IconString): void
277
282
  toggleLinkedSetting(change: any): void
278
283
  }
279
- interface ToggleOptions extends ActionOptions {
284
+ interface ToggleOptions extends Omit<ActionOptions, 'click'> {
280
285
  /**
281
286
  * Default value of the toggle
282
287
  */
283
288
  default?: boolean
289
+ /**
290
+ * ID of a setting that the toggle is linked to
291
+ */
292
+ linked_setting?: string
284
293
  /**
285
294
  * Method that gets called when the user changes the value of the toggle
286
295
  */
287
296
  onChange?(value: boolean): void
297
+ icon: IconString | (() => selected_layer)
288
298
  }
289
299
  /**
290
300
  * A toggle is a type of action that can be on or off. The state is not persistent between restarts by default.
@@ -296,8 +306,13 @@ declare global {
296
306
  * Updates the state of the toggle in the UI
297
307
  */
298
308
  updateEnabledState(): void
309
+ /**
310
+ * ID of a setting that the toggle is linked to
311
+ */
312
+ linked_setting?: string
299
313
  set(value: boolean): this
300
314
  setIcon(icon: IconString): void
315
+ icon: IconString | (() => selected_layer)
301
316
  }
302
317
 
303
318
  type RGBAColor = { r: number; g: number; b: number; a: number }
@@ -457,6 +472,7 @@ declare global {
457
472
  constructor(id: string, options: WidgetOptions)
458
473
  }
459
474
  type NumSliderOptions = WidgetOptions & {
475
+ private?: boolean
460
476
  settings?: {
461
477
  default?: number
462
478
  min?: number
@@ -530,7 +546,7 @@ declare global {
530
546
  get(): tinycolor.Instance
531
547
  }
532
548
  interface ToolbarOptions {
533
- id: string
549
+ id?: string
534
550
  name?: string
535
551
  /**
536
552
  * If true, the toolbar will display a label abovee
@@ -548,6 +564,22 @@ declare global {
548
564
  children: ('_' | '+' | '#' | string | BarItem)[]
549
565
  }
550
566
  class Toolbar {
567
+ id: string
568
+ name: string
569
+ label: boolean
570
+ label_node: HTMLElement
571
+ condition: ConditionResolvable
572
+ children: (BarItem | string)[]
573
+ no_wrap: boolean
574
+ narrow: boolean
575
+ vertical: boolean
576
+ default_children: (BarItem | string)[]
577
+ /*private*/ positionLookup: any
578
+ /*private*/ condition_cache: any
579
+ /*private*/ previously_enabled: any
580
+ /*private*/ postload: any
581
+ /*private*/ menu: any
582
+ node: HTMLElement
551
583
  constructor(id: string, data: ToolbarOptions)
552
584
  constructor(data: ToolbarOptions)
553
585
  build(data: any, force: any): this
@@ -580,7 +612,8 @@ declare global {
580
612
  const open: boolean
581
613
  const type: string
582
614
  const max_length: number
583
- function select(): void
615
+ function select(input?: string): void
616
+ function show(input?: string): void
584
617
  function hide(): void
585
618
  function confirm(event: Event): void
586
619
  function cancel(): void
@@ -131,6 +131,8 @@ declare namespace Animator {
131
131
  const particle_effects: any
132
132
  const animations: _Animation[]
133
133
  const selected: _Animation | undefined
134
+ function join(): void
135
+ function leave(): void
134
136
  function showDefaultPose(no_matrix_update?: boolean): void
135
137
  function resetParticles(): void
136
138
  function showMotionTrail(target?: Group): void
@@ -0,0 +1,71 @@
1
+ /// <reference types="vue" />
2
+ /// <reference types="./three" />
3
+ /// <reference types="@types/prismjs" />
4
+ /// <reference types="@types/jquery" />
5
+ /// <reference types="wintersky" />
6
+
7
+ /// <reference types="./texture_layers" />
8
+ /// <reference types="./texture_group" />
9
+ /// <reference types="./action" />
10
+ /// <reference types="./animation" />
11
+ /// <reference types="./animation_controller" />
12
+ /// <reference types="./canvas_frame" />
13
+ /// <reference types="./canvas" />
14
+ /// <reference types="./codec" />
15
+ /// <reference types="./cube" />
16
+ /// <reference types="./desktop" />
17
+ /// <reference types="./dialog" />
18
+ /// <reference types="./display_mode" />
19
+ /// <reference types="./format" />
20
+ /// <reference types="./global" />
21
+ /// <reference types="./group" />
22
+ /// <reference types="./interface" />
23
+ /// <reference types="./keyframe" />
24
+ /// <reference types="./menu" />
25
+ /// <reference types="./mesh" />
26
+ /// <reference types="./misc" />
27
+ /// <reference types="./molang" />
28
+ /// <reference types="./outliner" />
29
+ /// <reference types="./painter" />
30
+ /// <reference types="./preview" />
31
+ /// <reference types="./preview_scene" />
32
+ /// <reference types="./project" />
33
+ /// <reference types="./screencam" />
34
+ /// <reference types="./textures" />
35
+ /// <reference types="./timeline" />
36
+ /// <reference types="./undo" />
37
+ /// <reference types="./util" />
38
+ /// <reference types="./uveditor" />
39
+ /// <reference types="./validator" />
40
+ /// <reference types="./shared_actions" />
41
+ /// <reference types="./display_mode" />
42
+ /// <reference types="./misc" />
43
+ /// <reference types="./util" />
44
+ /// <reference types="./math_util" />
45
+ /// <reference types="./canvas_frame" />
46
+ /// <reference types="./io" />
47
+
48
+ /**
49
+ * Provides access to global Javascript/DOM variables that are overwritten by Blockbench's own variables
50
+ */
51
+ declare const NativeGlobals: {
52
+ Animation: {
53
+ new (
54
+ effect?: AnimationEffect | null | undefined,
55
+ timeline?: AnimationTimeline | null | undefined
56
+ ): Animation
57
+ prototype: Animation
58
+ }
59
+ }
60
+
61
+ /**
62
+ * Shader support
63
+ */
64
+ declare module "*.glsl" {
65
+ const value: string;
66
+ export default value;
67
+ }
68
+ declare module "*.bbtheme" {
69
+ const value: string | any;
70
+ export default value;
71
+ }
@@ -37,6 +37,19 @@ interface UpdateViewOptions {
37
37
  * Groups to update
38
38
  */
39
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
+ }
40
53
  /**
41
54
  * Whether to update the selection (updates the selection outlines and interface)
42
55
  */
@@ -47,6 +60,7 @@ interface UpdateViewOptions {
47
60
  * A global namespace handling miscellaneous functionality related to the 3D preview
48
61
  */
49
62
  declare namespace Canvas {
63
+ const gizmo_colors: Record<string, THREE.Color>
50
64
  const materials: {
51
65
  [uuid: UUID]: THREE.Material
52
66
  }
@@ -90,6 +104,9 @@ declare namespace Canvas {
90
104
 
91
105
  const pivot_marker: THREE.Object3D
92
106
 
107
+ const ground_plane: THREE.Mesh
108
+ const brush_outline: THREE.Mesh
109
+
93
110
  const global_light_color: THREE.Color
94
111
  const global_light_side: number
95
112
 
@@ -215,6 +232,7 @@ declare namespace Canvas {
215
232
  * 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.
216
233
  */
217
234
  declare namespace TickUpdates {
235
+ let interface: undefined | true
218
236
  let outliner: undefined | true
219
237
  let selection: undefined | true
220
238
  let main_uv: undefined | true
@@ -45,6 +45,7 @@ interface CodecOptions {
45
45
  * A codec represents a specific file format that can be imported into and exported from Blockbench. The codec handles the compilation and parsing, as well as the loading and exporting logic
46
46
  */
47
47
  declare class Codec extends Deletable {
48
+ plugin?: string
48
49
  /**
49
50
  * Creates a new codec
50
51
  * @param id Codec ID
@@ -58,7 +59,7 @@ declare class Codec extends Deletable {
58
59
  * @param file
59
60
  * @param add
60
61
  */
61
- load(model: any, file: any, add?: boolean): void
62
+ load(model: any, file?: any, add?: boolean): void
62
63
  /**
63
64
  * Compiles the file content
64
65
  * @param options
@@ -147,6 +148,11 @@ declare class Codec extends Deletable {
147
148
  [key: string]: FormElement
148
149
  }
149
150
 
151
+ /**
152
+ * Additional properties
153
+ */
154
+ [key: string]: any
155
+
150
156
  format: ModelFormat
151
157
 
152
158
  /**
@@ -38,6 +38,10 @@ declare class Cube extends OutlinerElement {
38
38
  * UV mirror across the X axis when using Box UV
39
39
  */
40
40
  mirror_uv: boolean
41
+ /**
42
+ * If the cube is using Box UV
43
+ */
44
+ box_uv: boolean
41
45
  /**
42
46
  * Inflate adds an inflation value to all sides equally
43
47
  */
@@ -12,3 +12,4 @@ declare function openDefaultTexturePath(): void
12
12
  declare function findExistingFile(paths: string[]): any
13
13
  declare function createBackup(init: any): void
14
14
  declare function closeBlockbenchWindow(): any
15
+ declare const currentwindow: any
@@ -1,115 +1,5 @@
1
- interface FormElement {
2
- label?: string
3
- /**
4
- * Detailed description of the field, available behind the questionmark icon or on mouse hover
5
- */
6
- description?: string
7
- type:
8
- | 'text'
9
- | 'number'
10
- | 'range'
11
- | 'checkbox'
12
- | 'select'
13
- | 'radio'
14
- | 'textarea'
15
- | 'vector'
16
- | 'color'
17
- | 'file'
18
- | 'folder'
19
- | 'save'
20
- | 'inline_select'
21
- | 'inline_multi_select'
22
- | 'info'
23
- | 'num_slider'
24
- | 'buttons'
25
- /**
26
- * If true, the label will be displayed without colon at the end
27
- */
28
- nocolon?: boolean
29
- /**
30
- * Stretch the input field across the whole width of the form
31
- */
32
- full_width?: boolean
33
- /** Set the input to read-only */
34
- readonly?: boolean
35
- /** Add buttons to allow copying and sharing the text or link */
36
- share_text?: boolean
37
- /**
38
- * The default value
39
- */
40
- value?: any
41
- /**
42
- * The default selected option for 'select', 'inline_select' and 'radio' types. Alias for 'value'
43
- */
44
- default?: any
45
- placeholder?: string
46
- /**
47
- * When using 'text' type, the text to display. Markdown is supported
48
- */
49
- text?: string
50
- /**
51
- * When using 'range' type, allow users to modify the numeric input
52
- */
53
- editable_range_label?: boolean
54
- colorpicker?: any
55
- /**
56
- * On numeric inputs, the minimum possible value
57
- */
58
- min?: number
59
- /**
60
- * On numeric inputs, the maximum possible value
61
- */
62
- max?: number
63
- /**
64
- * The step in which the value can be increased / decreased
65
- */
66
- step?: number
67
- /**
68
- * If enabled, the value is forced to multiples of the "step" value. This can be used to create integer-only inputs etc.
69
- */
70
- force_step?: boolean
71
- /**
72
- * The height of the input on textareas, in pixels
73
- */
74
- height?: number
75
- /**
76
- * Available options on select or inline_select inputs
77
- */
78
- options?: { [key: string]: string | { name: string } }
79
- /**
80
- * List of buttons for the button type
81
- */
82
- buttons?: string[]
83
-
84
- /**
85
- * Function to get the interval value for a num_slider based on the input event
86
- * @returns Interval value
87
- */
88
- getInterval?: (event: Event) => number
89
- /**
90
- * For num_sliders, the sliding interval mode
91
- */
92
- interval_type?: 'position' | 'rotation'
93
- /**
94
- * Allow users to toggle the entire option on or off
95
- */
96
- toggle_enabled?: boolean
97
- /**
98
- * Set whether the setting is toggled on or off by default. Requires 'toggle_enabled' field to be set to true
99
- */
100
- toggle_default?: boolean
101
- /**
102
- * Runs when any of the buttons is pressed
103
- * @param button_index Index of the clicked button in the buttons list
104
- */
105
- click?: (button_index: number) => void
106
- }
107
-
108
1
  type FormResultValue = string | number | boolean | []
109
2
 
110
- type InputFormConfig = {
111
- [formElement: string]: '_' | FormElement
112
- }
113
3
 
114
4
  declare class InputForm {
115
5
  constructor(form_config: InputFormConfig)
@@ -4,7 +4,7 @@ interface FormatPage {
4
4
  component?: Vue.Component
5
5
  content?: (
6
6
  | {
7
- type: 'image' | 'h2' | 'h3' | 'h4' | 'text' | 'label' | 'image' | ''
7
+ type?: 'image' | 'h2' | 'h3' | 'h4' | 'text' | 'label' | 'image' | ''
8
8
  text?: string
9
9
  source?: string
10
10
  width?: number
@@ -55,6 +55,7 @@ interface FormatOptions {
55
55
  confidential?: boolean
56
56
  condition?: ConditionResolvable
57
57
  show_on_start_screen?: boolean
58
+ can_convert_to?: boolean
58
59
  format_page?: FormatPage
59
60
  onFormatPage?(): void
60
61
  onStart?(): void
@@ -129,6 +130,10 @@ interface FormatOptions {
129
130
  * Enable mesh elements
130
131
  */
131
132
  meshes: boolean
133
+ /**
134
+ * Enable spline elements
135
+ */
136
+ splines: boolean
132
137
  /**
133
138
  * Enable texture meshes
134
139
  */
@@ -246,11 +251,14 @@ declare class ModelFormat extends Deletable implements FormatOptions {
246
251
  confidential: boolean
247
252
  condition?: ConditionResolvable
248
253
  show_on_start_screen: boolean
254
+ can_convert_to: boolean
249
255
  format_page?: FormatPage
250
256
  onFormatPage?(): void
251
257
  onStart?(): void
252
258
  onSetup?(): void
253
259
 
260
+ setup_dialog?: Dialog
261
+
254
262
  codec?: Codec
255
263
 
256
264
  cube_size_limiter?: CubeSizeLimiter
@@ -21,6 +21,9 @@ declare global {
21
21
  function rotateOnAxis(modify: OutlinerNode, axis: number, slider?: boolean): void
22
22
  function afterRotateOnAxis(): void
23
23
 
24
+ function showItemInFolder(path: string): void
25
+ const app: Electron.App
26
+
24
27
  // const Transformer: THREE.TransformControls
25
28
  interface HTMLImageElement {
26
29
  src: string
@@ -17,6 +17,8 @@ interface GroupOptions {
17
17
  export: boolean
18
18
  /**Auto UV setting for the children. Can be 0, 1 or 2. */
19
19
  autouv: 0 | 1 | 2
20
+ mirror_uv: boolean
21
+ color: number
20
22
  }
21
23
 
22
24
  declare class Group extends OutlinerNode {
@@ -53,6 +55,8 @@ declare class Group extends OutlinerNode {
53
55
  selected: boolean
54
56
  visibility: boolean
55
57
  autouv: 0 | 1 | 2
58
+ mirror_uv: boolean
59
+ color: number
56
60
  isOpen: boolean
57
61
  ik_enabled: boolean
58
62
  ik_chain_length: number
@@ -64,6 +68,8 @@ declare class Group extends OutlinerNode {
64
68
  cem_scale?: number
65
69
  mesh: THREE.Mesh
66
70
 
71
+ [key: string]: any
72
+
67
73
  static preview_controller: NodePreviewController
68
74
 
69
75
  extend(options: Partial<GroupOptions>): this
@@ -1,10 +1,19 @@
1
1
  /// <reference path="./blockbench.d.ts"/>
2
2
 
3
3
  declare class Deletable {
4
+ /**
5
+ * The ID of the plugin that created the object
6
+ */
7
+ plugin?: string
4
8
  delete(): void
5
9
  }
6
10
  type UUID = string
7
11
 
12
+
13
+ declare global {
14
+ const settings: typeof settings
15
+ }
16
+
8
17
  /**
9
18
  * True if Blockbench runs as a native app
10
19
  */
@@ -109,6 +118,8 @@ type EventName =
109
118
  | 'edit_layer_properties'
110
119
  | 'select_texture'
111
120
  | 'compile_texture_mcmeta'
121
+ | 'register_element_type'
122
+ | 'edit_collection_properties'
112
123
 
113
124
  type IconString = string
114
125
 
@@ -127,6 +138,8 @@ interface MessageBoxOptions {
127
138
  message?: string
128
139
  icon?: string
129
140
  width?: number
141
+ cancelIndex?: number
142
+ confirmIndex?: number
130
143
  /**
131
144
  * Display a list of actions to do in the dialog. When clicked, the message box closes with the string ID of the command as first argument.
132
145
  */
@@ -210,6 +223,7 @@ declare class Property<T extends keyof IPropertyType> extends Deletable {
210
223
  condition: ConditionResolvable
211
224
  exposed: boolean
212
225
  label: any
226
+ inputs?: any
213
227
  merge(instance: IPropertyType[T], data: IPropertyType[T]): void
214
228
  reset(instance: IPropertyType[T]): void
215
229
  getDefault(instance: IPropertyType[T]): IPropertyType[T]
@@ -233,7 +247,7 @@ declare namespace Language {
233
247
  [key: string]: string
234
248
  }
235
249
  /**
236
- * Two letter code indicating the currently selected language
250
+ * Language code indicating the currently selected language
237
251
  */
238
252
  const code: string
239
253
  /**
@@ -250,17 +264,6 @@ interface Object {
250
264
 
251
265
  declare var LZUTF8: any
252
266
 
253
- interface ToastNotificationOptions {
254
- text: string
255
- icon?: string
256
- expire?: number
257
- color?: string
258
- click?: () => boolean
259
- }
260
- declare namespace Blockbench {
261
- function showToastNotification(options: ToastNotificationOptions): Deletable
262
- }
263
-
264
267
  declare function unselectAllElements(): void
265
268
  declare function updateCubeHighlights(hover_cube: Cube, force_off: boolean): void
266
269
  declare function getRescalingFactor(angle: number): number
@@ -10,6 +10,7 @@ declare const elements: OutlinerNode[]
10
10
  declare class OutlinerNode {
11
11
  static properties: Record<string, Property<any>>
12
12
  constructor(uuid: UUID)
13
+ type: string
13
14
  name: string
14
15
  uuid: UUID
15
16
  export: boolean
@@ -21,8 +22,9 @@ declare class OutlinerNode {
21
22
  * Initializes the node. This should always be called when creating nodes that will be used in the outliner.
22
23
  */
23
24
  init(): this
24
- addTo(target?: OutlinerNode): this
25
+ addTo(target?: OutlinerNode | 'root'): this
25
26
  sortInBefore(target?: OutlinerNode, index_modifier?: number): this
27
+ select(event?: any, isOutlinerClick?: boolean): this | void
26
28
  getParentArray(): OutlinerNode[]
27
29
  /**
28
30
  * Unfolds the outliner and scrolls up or down if necessary to show the group or element.
@@ -57,7 +59,7 @@ declare class OutlinerNode {
57
59
  * Displays the context menu of the element
58
60
  * @param event Mouse event, determines where the context menu spawns.
59
61
  */
60
- showContexnu(event: Event | HTMLElement): this
62
+ showContexMenu(event: Event | HTMLElement): this
61
63
  getSaveCopy?(...args: any[]): Record<string, any>
62
64
  sanitizeName(): string
63
65
 
@@ -195,7 +197,8 @@ declare namespace Outliner {
195
197
  declare const markerColors: {
196
198
  pastel: string
197
199
  standard: string
198
- name: string
200
+ id: string
201
+ name?: string
199
202
  }[]
200
203
 
201
204
  declare function compileGroups(undo: boolean, lut?: { [index: number]: number }): any[]