blockbench-types 4.12.1 → 4.12.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blockbench-types",
3
- "version": "4.12.1",
3
+ "version": "4.12.2",
4
4
  "description": "Blockbench typescript types",
5
5
  "main": "",
6
6
  "types": "types/index.d.ts",
package/types/action.d.ts CHANGED
@@ -128,6 +128,7 @@ declare global {
128
128
  class KeybindItem extends Deletable {
129
129
  constructor(id: string, options: KeybindItemOptions)
130
130
  keybind: Keybind
131
+ condition?: ConditionResolvable
131
132
  variations?: {
132
133
  [key: string]: { name: string; description?: string }
133
134
  }
@@ -161,6 +162,11 @@ declare global {
161
162
  class BarItem extends KeybindItem {
162
163
  constructor(id: string, options: BarItemOptions)
163
164
  id: string
165
+ name: string
166
+ description: string
167
+ icon?: string
168
+ category?: string
169
+
164
170
  node: HTMLElement
165
171
  nodes: HTMLElement[]
166
172
  conditionMet(): boolean
@@ -228,10 +234,6 @@ declare global {
228
234
  * Icon color. Can be a CSS color string, or an axis letter to use an axis color.
229
235
  */
230
236
  color?: string
231
- /**
232
- * ID of a setting that the action is slinked to
233
- */
234
- linked_setting?: string
235
237
  children?: any[]
236
238
  /**
237
239
  * Show the full label in toolbars
@@ -251,6 +253,7 @@ declare global {
251
253
  */
252
254
  class Action extends BarItem {
253
255
  constructor(id: string, options: ActionOptions)
256
+ icon: string
254
257
  nodes: HTMLElement[]
255
258
  /**
256
259
  * Provide a menu that belongs to the action, and gets displayed as a small arrow next to it in toolbars.
@@ -276,11 +279,15 @@ declare global {
276
279
  setIcon(icon: IconString): void
277
280
  toggleLinkedSetting(change: any): void
278
281
  }
279
- interface ToggleOptions extends ActionOptions {
282
+ interface ToggleOptions extends Omit<ActionOptions, 'click'> {
280
283
  /**
281
284
  * Default value of the toggle
282
285
  */
283
286
  default?: boolean
287
+ /**
288
+ * ID of a setting that the toggle is linked to
289
+ */
290
+ linked_setting?: string
284
291
  /**
285
292
  * Method that gets called when the user changes the value of the toggle
286
293
  */
@@ -296,6 +303,10 @@ declare global {
296
303
  * Updates the state of the toggle in the UI
297
304
  */
298
305
  updateEnabledState(): void
306
+ /**
307
+ * ID of a setting that the toggle is linked to
308
+ */
309
+ linked_setting?: string
299
310
  set(value: boolean): this
300
311
  setIcon(icon: IconString): void
301
312
  }
@@ -457,6 +468,7 @@ declare global {
457
468
  constructor(id: string, options: WidgetOptions)
458
469
  }
459
470
  type NumSliderOptions = WidgetOptions & {
471
+ private?: boolean
460
472
  settings?: {
461
473
  default?: number
462
474
  min?: number
@@ -580,7 +592,8 @@ declare global {
580
592
  const open: boolean
581
593
  const type: string
582
594
  const max_length: number
583
- function select(): void
595
+ function select(input?: string): void
596
+ function show(input?: string): void
584
597
  function hide(): void
585
598
  function confirm(event: Event): void
586
599
  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
package/types/canvas.d.ts CHANGED
@@ -215,6 +215,7 @@ declare namespace Canvas {
215
215
  * 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
216
  */
217
217
  declare namespace TickUpdates {
218
+ let interface: undefined | true
218
219
  let outliner: undefined | true
219
220
  let selection: undefined | true
220
221
  let main_uv: undefined | true
package/types/dialog.d.ts CHANGED
@@ -47,6 +47,7 @@ interface FormElement {
47
47
  * When using 'text' type, the text to display. Markdown is supported
48
48
  */
49
49
  text?: string
50
+ condition?: ConditionResolvable
50
51
  /**
51
52
  * When using 'range' type, allow users to modify the numeric input
52
53
  */
package/types/misc.d.ts CHANGED
@@ -127,6 +127,8 @@ interface MessageBoxOptions {
127
127
  message?: string
128
128
  icon?: string
129
129
  width?: number
130
+ cancelIndex?: number
131
+ confirmIndex?: number
130
132
  /**
131
133
  * 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
134
  */
@@ -233,7 +235,7 @@ declare namespace Language {
233
235
  [key: string]: string
234
236
  }
235
237
  /**
236
- * Two letter code indicating the currently selected language
238
+ * Language code indicating the currently selected language
237
239
  */
238
240
  const code: string
239
241
  /**
@@ -23,6 +23,7 @@ declare class OutlinerNode {
23
23
  init(): this
24
24
  addTo(target?: OutlinerNode): this
25
25
  sortInBefore(target?: OutlinerNode, index_modifier?: number): this
26
+ select(event?: any, isOutlinerClick?: boolean): this | void
26
27
  getParentArray(): OutlinerNode[]
27
28
  /**
28
29
  * Unfolds the outliner and scrolls up or down if necessary to show the group or element.
@@ -195,7 +196,7 @@ declare namespace Outliner {
195
196
  declare const markerColors: {
196
197
  pastel: string
197
198
  standard: string
198
- name: string
199
+ id: string
199
200
  }[]
200
201
 
201
202
  declare function compileGroups(undo: boolean, lut?: { [index: number]: number }): any[]
package/types/panel.d.ts CHANGED
@@ -64,6 +64,7 @@ declare class Panel {
64
64
  inside_vue: Vue
65
65
  resizable: boolean
66
66
  fixed_height?: boolean
67
+ condition?: ConditionResolvable
67
68
 
68
69
  fold(state?: boolean): this
69
70
  vue: Vue.Component
package/types/plugin.d.ts CHANGED
@@ -179,4 +179,5 @@ declare namespace Plugins {
179
179
  * Dev reload all side-loaded plugins
180
180
  */
181
181
  function devReload(): void
182
+ const currently_loading: string
182
183
  }
@@ -80,7 +80,7 @@ declare namespace SharedActions {
80
80
  }
81
81
 
82
82
  interface SharedActionHandler {
83
- priority: number
83
+ priority?: number
84
84
  subject: string
85
85
  condition: ConditionResolvable
86
86
  run: (event?: Event, context?: any) => void
package/types/undo.d.ts CHANGED
@@ -6,10 +6,15 @@ interface UndoAspects {
6
6
  * Saves the entire outliner structure and hierarchy, including all groups. This is required when adding, or removing any elements, or changing their position in the outliner.
7
7
  */
8
8
  outliner?: boolean
9
+ /**
10
+ * Save individual groups, but not their children or hierarchy position
11
+ */
12
+ groups?: Group[]
9
13
  /**
10
14
  * Saves an individual group, but not it's children or hierarchy position
11
15
  */
12
16
  group?: Group
17
+ collections: Collection[]
13
18
  /**
14
19
  * Textures to save
15
20
  */
@@ -37,6 +42,8 @@ type UndoSave = {
37
42
  elements?: {}
38
43
  outliner?: []
39
44
  group?: {}
45
+ groups?: {}[]
46
+ collections: {}[]
40
47
  textures?: {}
41
48
  texture_order?: UUID[]
42
49
  selected_texture?: UUID | null
package/types/util.d.ts CHANGED
@@ -2,7 +2,8 @@
2
2
  type ConditionResolvable =
3
3
  | undefined
4
4
  | boolean
5
- | ((context: any) => boolean)
5
+ | any
6
+ | ((context: any) => any)
6
7
  | Partial<{
7
8
  modes: string[]
8
9
  formats: string[]
@@ -95,7 +96,7 @@ declare function onVueSetup(func: any): void
95
96
  declare function capitalizeFirstLetter(string: any): any
96
97
  declare function autoStringify(any: any): string
97
98
  declare function pluralS(arr: any): '' | 's'
98
- declare function pathToName(path: string, extension: boolean): string | ''
99
+ declare function pathToName(path: string, extension: boolean = false): string | ''
99
100
  declare function pathToExtension(path: string): string | ''
100
101
  declare function intToRGBA(int: any): {
101
102
  r: number