blockbench-types 4.10.0 → 4.11.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.
- package/README.md +2 -2
- package/package.json +2 -2
- package/types/dialog.d.ts +33 -1
- package/types/display_mode.d.ts +8 -0
- package/types/format.d.ts +10 -1
- package/types/menu.d.ts +1 -1
- package/types/plugin.d.ts +24 -0
- package/types/preview_scene.d.ts +15 -5
- package/types/undo.d.ts +2 -2
- package/types/util.d.ts +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# blockbench-types
|
|
1
|
+
# Blockbench Types [](https://www.npmjs.com/package/blockbench-types)
|
|
2
2
|
|
|
3
|
-
Blockbench typescript types
|
|
3
|
+
Blockbench typescript types!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blockbench-types",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.11.0",
|
|
4
4
|
"description": "Blockbench typescript types",
|
|
5
5
|
"main": "",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@types/three": "^0.129.2",
|
|
31
31
|
"@types/tinycolor2": "^1.4.6",
|
|
32
32
|
"dompurify": "^3.0.1",
|
|
33
|
-
"electron": "^
|
|
33
|
+
"electron": "^31.4.0",
|
|
34
34
|
"prismjs": "^1.29.0",
|
|
35
35
|
"tinycolor2": "^1.6.0",
|
|
36
36
|
"typescript": "^4.9.5",
|
package/types/dialog.d.ts
CHANGED
|
@@ -172,6 +172,15 @@ interface DialogOptions {
|
|
|
172
172
|
* Menu in the handle bar
|
|
173
173
|
*/
|
|
174
174
|
title_menu?: Menu
|
|
175
|
+
/**
|
|
176
|
+
* Display a progress bar in the dialog
|
|
177
|
+
*/
|
|
178
|
+
progress_bar?: {
|
|
179
|
+
/**
|
|
180
|
+
* A progress value between 0 and 1
|
|
181
|
+
*/
|
|
182
|
+
progress?: number
|
|
183
|
+
}
|
|
175
184
|
/**
|
|
176
185
|
* If true, the dialog will only have one button to close it
|
|
177
186
|
*/
|
|
@@ -226,6 +235,21 @@ declare class Dialog {
|
|
|
226
235
|
component: Vue.Component
|
|
227
236
|
sidebar: DialogSidebar | null
|
|
228
237
|
content_vue: Vue | null
|
|
238
|
+
progress_bar?: {
|
|
239
|
+
/**
|
|
240
|
+
* The current progress
|
|
241
|
+
*/
|
|
242
|
+
progress?: number
|
|
243
|
+
/**
|
|
244
|
+
* Set the progress displayed in the progress bar
|
|
245
|
+
* @param value A progress value between 0 and 1
|
|
246
|
+
*/
|
|
247
|
+
setProgress(value: number): void
|
|
248
|
+
/**
|
|
249
|
+
* The progress bar HTML node
|
|
250
|
+
*/
|
|
251
|
+
node?: HTMLDivElement
|
|
252
|
+
}
|
|
229
253
|
|
|
230
254
|
confirmIndex: number
|
|
231
255
|
cancelIndex: number
|
|
@@ -272,8 +296,16 @@ declare class Dialog {
|
|
|
272
296
|
onFormChange?(form_result: { [key: string]: FormResultValue }): void
|
|
273
297
|
/**
|
|
274
298
|
* Set the values of the dialog form inputs
|
|
299
|
+
* @param values The values to set, by form input key
|
|
300
|
+
* @param update Whether to update the dialog (call onFormChange) after setting the values. Default is true. Set to false when called from onFormChange
|
|
275
301
|
*/
|
|
276
|
-
setFormValues(values: { [key: string]: FormResultValue }): void
|
|
302
|
+
setFormValues(values: { [key: string]: FormResultValue }, update: boolean): void
|
|
303
|
+
/**
|
|
304
|
+
* Set whether the dialog form inputs are toggled on or off. See "toggle_enabled"
|
|
305
|
+
* @param values
|
|
306
|
+
* @param update Whether to update the dialog (call onFormChange) after setting the values. Default is true. Set to false when called from onFormChange
|
|
307
|
+
*/
|
|
308
|
+
setFormToggles(values: { [key: string]: boolean }, update: boolean): void
|
|
277
309
|
/**
|
|
278
310
|
* Delete the dialog any, causing it to be re-build from scratch on next open
|
|
279
311
|
*/
|
package/types/display_mode.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ interface DisplaySlotOptions {
|
|
|
7
7
|
rotation?: ArrayVector3
|
|
8
8
|
translation?: ArrayVector3
|
|
9
9
|
scale?: ArrayVector3
|
|
10
|
+
rotation_pivot?: ArrayVector3
|
|
11
|
+
scale_pivot?: ArrayVector3
|
|
10
12
|
mirror?: [boolean, boolean, boolean]
|
|
11
13
|
}
|
|
12
14
|
|
|
@@ -18,6 +20,8 @@ declare class DisplaySlot {
|
|
|
18
20
|
rotation: ArrayVector3
|
|
19
21
|
translation: ArrayVector3
|
|
20
22
|
scale: ArrayVector3
|
|
23
|
+
rotation_pivot: ArrayVector3
|
|
24
|
+
scale_pivot: ArrayVector3
|
|
21
25
|
mirror: [boolean, boolean, boolean]
|
|
22
26
|
/**
|
|
23
27
|
* Reset slot to default values
|
|
@@ -28,6 +32,8 @@ declare class DisplaySlot {
|
|
|
28
32
|
rotation: ArrayVector3
|
|
29
33
|
translation: ArrayVector3
|
|
30
34
|
scale: ArrayVector3
|
|
35
|
+
rotation_pivot: ArrayVector3
|
|
36
|
+
scale_pivot: ArrayVector3
|
|
31
37
|
mirror: [boolean, boolean, boolean]
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
@@ -38,6 +44,8 @@ declare class DisplaySlot {
|
|
|
38
44
|
rotation: ArrayVector3
|
|
39
45
|
translation: ArrayVector3
|
|
40
46
|
scale: ArrayVector3
|
|
47
|
+
rotation_pivot?: ArrayVector3
|
|
48
|
+
scale_pivot?: ArrayVector3
|
|
41
49
|
}
|
|
42
50
|
| undefined
|
|
43
51
|
/**
|
package/types/format.d.ts
CHANGED
|
@@ -96,7 +96,10 @@ interface FormatOptions {
|
|
|
96
96
|
animation_mode?: boolean
|
|
97
97
|
pose_mode?: boolean
|
|
98
98
|
animation_controllers?: boolean
|
|
99
|
-
|
|
99
|
+
box_uv_float_size: boolean
|
|
100
|
+
java_cube_shading_properties: boolean
|
|
101
|
+
cullfaces: boolean
|
|
102
|
+
render_sides?: 'front' | 'double' | 'back' | (() => ('front' | 'double' | 'back'))
|
|
100
103
|
|
|
101
104
|
cube_size_limiter?: CubeSizeLimiter
|
|
102
105
|
|
|
@@ -157,6 +160,12 @@ declare class ModelFormat extends Deletable {
|
|
|
157
160
|
display_mode: boolean
|
|
158
161
|
animation_mode: boolean
|
|
159
162
|
pose_mode: boolean
|
|
163
|
+
box_uv_float_size: boolean
|
|
164
|
+
java_cube_shading_properties: boolean
|
|
165
|
+
cullfaces: boolean
|
|
166
|
+
animation_controllers: boolean
|
|
167
|
+
render_sides: 'front' | 'double' | 'back' | (() => ('front' | 'double' | 'back'))
|
|
168
|
+
|
|
160
169
|
|
|
161
170
|
codec?: Codec
|
|
162
171
|
|
package/types/menu.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ declare class Menu extends Deletable {
|
|
|
58
58
|
*
|
|
59
59
|
* @param path Path pointing to the location. Use the ID of each level of the menu, or index within a level, or item ID, separated by a point. For example, `export.export_special_format` removes the action "Export Special Format" from the Export submenu.
|
|
60
60
|
*/
|
|
61
|
-
removeAction(path: string): void
|
|
61
|
+
removeAction(path: string | Action): void
|
|
62
62
|
structure: MenuItem[]
|
|
63
63
|
}
|
|
64
64
|
|
package/types/plugin.d.ts
CHANGED
|
@@ -50,6 +50,18 @@ interface PluginOptions {
|
|
|
50
50
|
* In combination with a "Deprecated" tag, this can be used to provide context on why a plugin is deprecated
|
|
51
51
|
*/
|
|
52
52
|
deprecation_note?: string
|
|
53
|
+
/*
|
|
54
|
+
* Link to the plugin's website
|
|
55
|
+
*/
|
|
56
|
+
website?: string
|
|
57
|
+
/*
|
|
58
|
+
* Link to the repository that contains the source for the plugin
|
|
59
|
+
*/
|
|
60
|
+
repository?: string
|
|
61
|
+
/*
|
|
62
|
+
* Link to where users can report issues with the plugin
|
|
63
|
+
*/
|
|
64
|
+
bug_tracker?: string
|
|
53
65
|
/**
|
|
54
66
|
* Runs when the plugin loads
|
|
55
67
|
*/
|
|
@@ -105,6 +117,18 @@ declare class BBPlugin {
|
|
|
105
117
|
* In combination with a "Deprecated" tag, this can be used to provide context on why a plugin is deprecated
|
|
106
118
|
*/
|
|
107
119
|
deprecation_note?: string
|
|
120
|
+
website?: string
|
|
121
|
+
/*
|
|
122
|
+
* Link to the plugin's website
|
|
123
|
+
*/
|
|
124
|
+
repository?: string
|
|
125
|
+
/*
|
|
126
|
+
* Link to the repository that contains the source for the plugin
|
|
127
|
+
*/
|
|
128
|
+
bug_tracker?: string
|
|
129
|
+
/*
|
|
130
|
+
* Link to where users can report issues with the plugin
|
|
131
|
+
*/
|
|
108
132
|
onload(): void
|
|
109
133
|
onunload(): void
|
|
110
134
|
oninstall(): void
|
package/types/preview_scene.d.ts
CHANGED
|
@@ -81,12 +81,22 @@ interface PreviewSceneOptions {
|
|
|
81
81
|
declare class PreviewScene extends Deletable {
|
|
82
82
|
constructor(id: string, options: PreviewSceneOptions)
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
/**
|
|
85
|
+
* All preview scenes, listed by ID
|
|
86
|
+
*/
|
|
87
|
+
static scenes: Record<string, PreviewScene>
|
|
88
|
+
/**
|
|
89
|
+
* The currently active scene
|
|
90
|
+
*/
|
|
87
91
|
static active: PreviewScene | null
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
/**
|
|
93
|
+
* The URL to the source repository that scenes are pulled from
|
|
94
|
+
*/
|
|
95
|
+
static source_repository: string
|
|
96
|
+
static menu_categories: {
|
|
97
|
+
[category_id: string]: {
|
|
98
|
+
[id: string]: string
|
|
99
|
+
}
|
|
90
100
|
}
|
|
91
101
|
|
|
92
102
|
id: string
|
package/types/undo.d.ts
CHANGED
|
@@ -120,8 +120,8 @@ declare class UndoSystem {
|
|
|
120
120
|
```javascript
|
|
121
121
|
Undo.initEdit({elements: []});
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
let new_cube = new Cube({name: 'kevin'}).init();
|
|
124
|
+
let other_cube = new Cube({name: 'lars'}).init();
|
|
125
125
|
|
|
126
126
|
Undo.finishEdit('add new cubes', {elements: [new_cube, other_cube]});
|
|
127
127
|
```
|
package/types/util.d.ts
CHANGED
|
@@ -114,7 +114,7 @@ declare function getAverageRGB(
|
|
|
114
114
|
declare function stringifyLargeInt(int: any): any
|
|
115
115
|
declare function intersectLines(p1: any, p2: any, p3: any, p4: any): boolean
|
|
116
116
|
declare function pointInRectangle(point: any, rect_start: any, rect_end: any): boolean
|
|
117
|
-
declare function
|
|
117
|
+
declare function lineIntersectsRectangle(p1: any, p2: any, rect_start: any, rect_end: any): boolean
|
|
118
118
|
declare function cameraTargetToRotation(position: any, target: any): any[]
|
|
119
119
|
declare function cameraRotationToTarget(position: any, rotation: any): any
|
|
120
120
|
|