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 +1 -1
- package/types/action.d.ts +19 -6
- package/types/animation.d.ts +2 -0
- package/types/canvas.d.ts +1 -0
- package/types/dialog.d.ts +1 -0
- package/types/misc.d.ts +3 -1
- package/types/outliner.d.ts +2 -1
- package/types/panel.d.ts +1 -0
- package/types/plugin.d.ts +1 -0
- package/types/shared_actions.d.ts +1 -1
- package/types/undo.d.ts +7 -0
- package/types/util.d.ts +3 -2
package/package.json
CHANGED
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
|
package/types/animation.d.ts
CHANGED
|
@@ -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
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
|
-
*
|
|
238
|
+
* Language code indicating the currently selected language
|
|
237
239
|
*/
|
|
238
240
|
const code: string
|
|
239
241
|
/**
|
package/types/outliner.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
package/types/plugin.d.ts
CHANGED
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
|
-
|
|
|
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
|