blockbench-types 5.2.0-beta.0-next.1 → 5.2.0-beta.0-next.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/custom/animation.d.ts +2 -1
- package/custom/blockbench.d.ts +5 -3
- package/custom/canvas.d.ts +20 -3
- package/custom/codec.d.ts +2 -2
- package/custom/cube.d.ts +1 -1
- package/custom/display_mode.d.ts +5 -1
- package/custom/global.d.ts +1 -2
- package/custom/interface.d.ts +5 -0
- package/custom/{toolbars.d.ts → keybind.d.ts} +4 -76
- package/custom/menu_bar.d.ts +66 -0
- package/custom/misc.d.ts +13 -5
- package/custom/painter.d.ts +33 -1
- package/custom/screencam.d.ts +1 -1
- package/custom/spline_mesh.d.ts +5 -4
- package/custom/textures.d.ts +2 -0
- package/generated/animations/timeline_animators.d.ts +1 -1
- package/generated/api.d.ts +2 -1
- package/generated/file_system.d.ts +1 -0
- package/generated/find_replace.d.ts +6 -0
- package/generated/interface/actions.d.ts +10 -9
- package/generated/interface/main_tools.d.ts +23 -0
- package/generated/interface/menu.d.ts +141 -0
- package/generated/interface/menu_bar.d.ts +2 -3
- package/generated/interface/shared_actions.d.ts +5 -0
- package/generated/interface/toolbars.d.ts +146 -46
- package/generated/io/format.d.ts +1 -0
- package/generated/io/project.d.ts +1 -1
- package/generated/main.d.ts +3 -0
- package/generated/modeling/mesh/add_mesh.d.ts +6 -0
- package/generated/modeling/mesh/util.d.ts +8 -2
- package/generated/modes.d.ts +2 -2
- package/generated/native_apis.d.ts +3 -0
- package/generated/outliner/abstract/outliner_element.d.ts +1 -0
- package/generated/outliner/abstract/outliner_node.d.ts +1 -0
- package/generated/outliner/types/armature.d.ts +1 -1
- package/generated/outliner/types/armature_bone.d.ts +1 -1
- package/generated/outliner/types/billboard.d.ts +1 -1
- package/generated/outliner/types/bounding_box.d.ts +1 -1
- package/generated/outliner/types/cube.d.ts +1 -1
- package/generated/outliner/types/group.d.ts +1 -1
- package/generated/outliner/types/locator.d.ts +1 -1
- package/generated/outliner/types/mesh.d.ts +1 -1
- package/generated/outliner/types/null_object.d.ts +1 -1
- package/generated/outliner/types/spline_mesh.d.ts +1 -2
- package/generated/outliner/types/texture_mesh.d.ts +1 -1
- package/generated/plugin_loader.d.ts +1 -1
- package/generated/preview/preview.d.ts +280 -0
- package/generated/preview/reference_images.d.ts +1 -1
- package/generated/util/gif.d.ts +12 -3
- package/generated/util/state_memory.d.ts +2 -10
- package/package.json +1 -1
- package/type_config.json +0 -2
- package/custom/menu.d.ts +0 -137
- package/custom/preview.d.ts +0 -147
package/custom/animation.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ declare class _Animation extends AnimationItem {
|
|
|
64
64
|
save(): this | undefined
|
|
65
65
|
select(): this | undefined
|
|
66
66
|
setLength(length?: number): void
|
|
67
|
-
createUniqueName(references
|
|
67
|
+
createUniqueName(references?: _Animation[]): any
|
|
68
68
|
setScopeFromAnimators(): number | undefined
|
|
69
69
|
rename(): this
|
|
70
70
|
togglePlayingState(state: any): any
|
|
@@ -254,3 +254,4 @@ declare class TimelineMarker {
|
|
|
254
254
|
color: number
|
|
255
255
|
time: number
|
|
256
256
|
}
|
|
257
|
+
declare const WinterskyScene: Wintersky.Scene
|
package/custom/blockbench.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/// <reference types="wintersky" />
|
|
6
6
|
|
|
7
7
|
/// <reference types="./texture_group" />
|
|
8
|
-
/// <reference types="./
|
|
8
|
+
/// <reference types="./keybind" />
|
|
9
9
|
/// <reference types="./animation" />
|
|
10
10
|
/// <reference types="./animation_controller" />
|
|
11
11
|
/// <reference types="./canvas_frame" />
|
|
@@ -18,14 +18,13 @@
|
|
|
18
18
|
/// <reference types="./group" />
|
|
19
19
|
/// <reference types="./interface" />
|
|
20
20
|
/// <reference types="./keyframe" />
|
|
21
|
-
/// <reference types="./
|
|
21
|
+
/// <reference types="./menu_bar" />
|
|
22
22
|
/// <reference types="./mesh" />
|
|
23
23
|
/// <reference types="./spline_mesh" />
|
|
24
24
|
/// <reference types="./misc" />
|
|
25
25
|
/// <reference types="./molang" />
|
|
26
26
|
/// <reference types="./outliner" />
|
|
27
27
|
/// <reference types="./painter" />
|
|
28
|
-
/// <reference types="./preview" />
|
|
29
28
|
/// <reference types="./preview_scene" />
|
|
30
29
|
/// <reference types="./edit_session" />
|
|
31
30
|
/// <reference types="./screencam" />
|
|
@@ -69,3 +68,6 @@ declare module "*.bbtheme" {
|
|
|
69
68
|
const value: string | any;
|
|
70
69
|
export default value;
|
|
71
70
|
}
|
|
71
|
+
declare module "*.png"
|
|
72
|
+
declare module "*.webp"
|
|
73
|
+
declare module "*.jpeg"
|
package/custom/canvas.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ declare namespace Canvas {
|
|
|
74
74
|
const bones: {
|
|
75
75
|
[uuid: UUID]: THREE.Object3D
|
|
76
76
|
}
|
|
77
|
+
let outlines: THREE.Object3D
|
|
77
78
|
/**
|
|
78
79
|
* Main scene, shared across all tabs
|
|
79
80
|
*/
|
|
@@ -108,13 +109,17 @@ declare namespace Canvas {
|
|
|
108
109
|
const ground_plane: THREE.Mesh
|
|
109
110
|
const brush_outline: THREE.Mesh
|
|
110
111
|
|
|
111
|
-
|
|
112
|
+
let show_gizmos: boolean
|
|
113
|
+
let ground_animation: boolean
|
|
112
114
|
|
|
113
115
|
const global_light_color: THREE.Color
|
|
114
|
-
|
|
116
|
+
let global_light_side: number
|
|
115
117
|
|
|
116
118
|
const face_order: ['east', 'west', 'up', 'down', 'south', 'north']
|
|
117
119
|
|
|
120
|
+
const hover_helper_line: THREE.LineSegments
|
|
121
|
+
const hover_helper_vertex: THREE.Points
|
|
122
|
+
|
|
118
123
|
/**
|
|
119
124
|
* Raycast on the currently selected preview
|
|
120
125
|
*/
|
|
@@ -129,6 +134,8 @@ declare namespace Canvas {
|
|
|
129
134
|
function clear(): void
|
|
130
135
|
function buildGrid(): void
|
|
131
136
|
function updateShading(): void
|
|
137
|
+
function updateViewMode(): void
|
|
138
|
+
function updateCubeHighlights(hover_cube: OutlinerElement, force_off?: boolean): void
|
|
132
139
|
/**
|
|
133
140
|
* Updates selected aspects of the preview
|
|
134
141
|
* @param options
|
|
@@ -188,7 +195,7 @@ declare namespace Canvas {
|
|
|
188
195
|
/**
|
|
189
196
|
* Update the position of the origin / pivot point gizmo
|
|
190
197
|
*/
|
|
191
|
-
function
|
|
198
|
+
function updatePivotMarker(): boolean
|
|
192
199
|
/**
|
|
193
200
|
* Update the position and shape of the specified cube
|
|
194
201
|
* @param cube Cube to update
|
|
@@ -229,12 +236,14 @@ declare namespace Canvas {
|
|
|
229
236
|
* Calculate the size of the model, in the currently displayed shape. Returns [width, height] in blockbench units
|
|
230
237
|
*/
|
|
231
238
|
function getModelSize(): [number, number]
|
|
239
|
+
function getSelectionBounds(): THREE.Box3
|
|
232
240
|
}
|
|
233
241
|
|
|
234
242
|
/**
|
|
235
243
|
* 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.
|
|
236
244
|
*/
|
|
237
245
|
declare namespace TickUpdates {
|
|
246
|
+
private function Run(): void
|
|
238
247
|
let interface: undefined | true
|
|
239
248
|
let outliner: undefined | true
|
|
240
249
|
let selection: undefined | true
|
|
@@ -269,6 +278,13 @@ interface NodePreviewControllerOptions {
|
|
|
269
278
|
updateHighlight?(element: OutlinerNode, ...args: any[]): void
|
|
270
279
|
[key: string]: any
|
|
271
280
|
}
|
|
281
|
+
interface ViewportRectangleOverlapContext {
|
|
282
|
+
projectPoint: (vector: THREE.Vector3) => ArrayVector2
|
|
283
|
+
extend_selection: boolean
|
|
284
|
+
rect_start: ArrayVector2
|
|
285
|
+
rect_end: ArrayVector2
|
|
286
|
+
preview: Preview
|
|
287
|
+
}
|
|
272
288
|
declare class NodePreviewController {
|
|
273
289
|
constructor(
|
|
274
290
|
type: typeof OutlinerElement | typeof OutlinerNode,
|
|
@@ -304,4 +320,5 @@ declare class NodePreviewController {
|
|
|
304
320
|
updateFaces(instance: OutlinerNode): void
|
|
305
321
|
updatePaintingGrid(instance: OutlinerNode): void
|
|
306
322
|
updateHighlight(instance: OutlinerNode, ...args: any[]): void
|
|
323
|
+
viewportRectangleOverlap(element: OutlinerNode, context: ViewportRectangleOverlapContext)
|
|
307
324
|
}
|
package/custom/codec.d.ts
CHANGED
|
@@ -36,8 +36,8 @@ interface CodecOptions {
|
|
|
36
36
|
support_partial_export?: boolean
|
|
37
37
|
support_offset?: boolean
|
|
38
38
|
load_filter?: {
|
|
39
|
-
extensions: string[]
|
|
40
|
-
type: 'json' | 'text'
|
|
39
|
+
extensions: string[] | (() => string[])
|
|
40
|
+
type: 'json' | 'text' | 'image'
|
|
41
41
|
condition?: ConditionResolvable
|
|
42
42
|
}
|
|
43
43
|
/**
|
package/custom/cube.d.ts
CHANGED
package/custom/display_mode.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ declare const DisplayMode: {
|
|
|
8
8
|
display_slot: string
|
|
9
9
|
display_area: any
|
|
10
10
|
display_base: any
|
|
11
|
+
animate_preview: Preview
|
|
12
|
+
groundAnimation(): void
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
declare type DisplaySlotName =
|
|
@@ -99,7 +101,7 @@ declare const displayReferenceObjects: {
|
|
|
99
101
|
inventory_full: refModel<'inventory_full'>
|
|
100
102
|
hud: refModel<'hud'>
|
|
101
103
|
}
|
|
102
|
-
active: refModel<keyof typeof displayReferenceObjects.refmodels>
|
|
104
|
+
active: refModel<keyof typeof displayReferenceObjects.refmodels>
|
|
103
105
|
/* Clears the active display model */
|
|
104
106
|
clear(): void
|
|
105
107
|
bar(buttons: any): void
|
|
@@ -135,3 +137,5 @@ declare class refModel<ID extends string> {
|
|
|
135
137
|
buildFrameTopInvisible(): void
|
|
136
138
|
updateBasePosition(): void
|
|
137
139
|
}
|
|
140
|
+
|
|
141
|
+
declare function changeDisplaySkin(): void
|
package/custom/global.d.ts
CHANGED
|
@@ -25,7 +25,6 @@ declare global {
|
|
|
25
25
|
* @deprecated Use {@link Outliner.selected} instead
|
|
26
26
|
*/
|
|
27
27
|
let selected: OutlinerElement[]
|
|
28
|
-
const Toolbars: Record<string, Toolbar>
|
|
29
28
|
|
|
30
29
|
function rotateOnAxis(modify: OutlinerNode, axis: number, slider?: boolean): void
|
|
31
30
|
function afterRotateOnAxis(): void
|
|
@@ -71,7 +70,7 @@ declare global {
|
|
|
71
70
|
/**
|
|
72
71
|
* Checks if the absolute difference between a and b is smaller than epsilon
|
|
73
72
|
*/
|
|
74
|
-
epsilon(a: number, b: number, epsilon
|
|
73
|
+
epsilon(a: number, b: number, epsilon?: number): boolean
|
|
75
74
|
/**
|
|
76
75
|
* Take a rotation value in degrees, and trim it to a value between -180 and 180, while keeping the same angle
|
|
77
76
|
*/
|
package/custom/interface.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
/// <reference types="./blockbench"/>
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Update the size of everything in the UI after the window has been resized or other UI size changes have happeped
|
|
5
|
+
* @param event
|
|
6
|
+
*/
|
|
7
|
+
declare function resizeWindow(event?: Event): void
|
|
3
8
|
|
|
4
9
|
declare namespace Interface {
|
|
5
10
|
function createElement(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Keybindings and action control
|
|
3
3
|
*/
|
|
4
4
|
/// <reference types="./blockbench"/>
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ declare global {
|
|
|
8
8
|
/**
|
|
9
9
|
* Main key, can be a numeric keycode or a lower case character
|
|
10
10
|
*/
|
|
11
|
-
key
|
|
11
|
+
key?: number | string
|
|
12
12
|
ctrl?: boolean
|
|
13
13
|
shift?: boolean
|
|
14
14
|
alt?: boolean
|
|
@@ -42,6 +42,7 @@ declare global {
|
|
|
42
42
|
ctrl?: boolean
|
|
43
43
|
shift?: boolean
|
|
44
44
|
alt?: boolean
|
|
45
|
+
meta?: boolean
|
|
45
46
|
variations?: {
|
|
46
47
|
[key: string]: ModifierKey
|
|
47
48
|
}
|
|
@@ -115,75 +116,6 @@ declare global {
|
|
|
115
116
|
static no_overlap(k1: KeybindItem, k2: KeybindItem): boolean
|
|
116
117
|
}
|
|
117
118
|
|
|
118
|
-
|
|
119
|
-
class MenuSeparator {
|
|
120
|
-
constructor(id?: string, label?: string)
|
|
121
|
-
id: string
|
|
122
|
-
menu_node: HTMLLIElement
|
|
123
|
-
label?: string
|
|
124
|
-
menu_node?: HTMLElement
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
interface ToolbarOptions {
|
|
128
|
-
id?: string
|
|
129
|
-
name?: string
|
|
130
|
-
/**
|
|
131
|
-
* If true, the toolbar will display a label abovee
|
|
132
|
-
*/
|
|
133
|
-
label?: boolean
|
|
134
|
-
condition?: ConditionResolvable
|
|
135
|
-
/**
|
|
136
|
-
* If true, the toolbar will only take as much width as needed
|
|
137
|
-
*/
|
|
138
|
-
narrow?: boolean
|
|
139
|
-
vertical?: boolean
|
|
140
|
-
/**
|
|
141
|
-
* Default content of the toolbar. Separators are available, where _ = separator, + = spaces, # = line break
|
|
142
|
-
*/
|
|
143
|
-
children: ('_' | '+' | '#' | string | BarItem)[]
|
|
144
|
-
}
|
|
145
|
-
export class Toolbar {
|
|
146
|
-
id: string
|
|
147
|
-
name: string
|
|
148
|
-
label: boolean
|
|
149
|
-
label_node: HTMLElement
|
|
150
|
-
condition: ConditionResolvable
|
|
151
|
-
children: (BarItem | string)[]
|
|
152
|
-
no_wrap: boolean
|
|
153
|
-
narrow: boolean
|
|
154
|
-
vertical: boolean
|
|
155
|
-
default_children: (BarItem | string)[]
|
|
156
|
-
/*private*/ positionLookup: any
|
|
157
|
-
/*private*/ condition_cache: any
|
|
158
|
-
/*private*/ previously_enabled: any
|
|
159
|
-
/*private*/ postload: any
|
|
160
|
-
/*private*/ menu: any
|
|
161
|
-
node: HTMLElement
|
|
162
|
-
constructor(id: string, data: ToolbarOptions)
|
|
163
|
-
constructor(data: ToolbarOptions)
|
|
164
|
-
build(data: any, force: any): this
|
|
165
|
-
contextmenu(event: Event): void
|
|
166
|
-
editMenu(): this
|
|
167
|
-
add(action: any, position?: number): this
|
|
168
|
-
remove(action: BarItem, update: boolean = false): this
|
|
169
|
-
update(): this
|
|
170
|
-
toPlace(place: any): this
|
|
171
|
-
save(): this
|
|
172
|
-
reset(): this
|
|
173
|
-
condition(): boolean
|
|
174
|
-
}
|
|
175
|
-
export namespace BARS {
|
|
176
|
-
const stored: {}
|
|
177
|
-
const editing_bar: undefined | Toolbar
|
|
178
|
-
const action_definers: (() => void)[]
|
|
179
|
-
const condition: any
|
|
180
|
-
function defineActions(definer: any): void
|
|
181
|
-
function setupActions(): void
|
|
182
|
-
function setupToolbars(): void
|
|
183
|
-
function setupVue(): void
|
|
184
|
-
function updateConditions(): void
|
|
185
|
-
function updateToolToolbar(): void
|
|
186
|
-
}
|
|
187
119
|
/**
|
|
188
120
|
* A dialog-based interface to search and trigger actions and other things
|
|
189
121
|
*/
|
|
@@ -212,11 +144,7 @@ declare global {
|
|
|
212
144
|
function reset(): void
|
|
213
145
|
function loadKeymap(id: string, from_start_screen: boolean = false): true | void
|
|
214
146
|
}
|
|
215
|
-
|
|
216
|
-
selected: Tool
|
|
217
|
-
original: any
|
|
218
|
-
}
|
|
219
|
-
const Toolbox: _ToolToolbar
|
|
147
|
+
const Vertexsnap: any
|
|
220
148
|
}
|
|
221
149
|
|
|
222
150
|
export {}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/// <reference types="./blockbench"/>
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
declare interface BarMenuOptions {
|
|
5
|
+
name?: string
|
|
6
|
+
icon?: IconString
|
|
7
|
+
condition?: ConditionResolvable
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new menu in the menu bar
|
|
12
|
+
*/
|
|
13
|
+
declare class BarMenu extends Menu {
|
|
14
|
+
constructor(id: string, structure: MenuItem[], options?: BarMenuOptions)
|
|
15
|
+
type: 'bar_menu'
|
|
16
|
+
id: string
|
|
17
|
+
condition?: ConditionResolvable
|
|
18
|
+
name: string
|
|
19
|
+
label: HTMLElement
|
|
20
|
+
structure: MenuItem[]
|
|
21
|
+
/**
|
|
22
|
+
* Visually highlights an action within the menu, until the user opens the menu
|
|
23
|
+
*/
|
|
24
|
+
highlight(action: Action): void
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare namespace MenuBar {
|
|
28
|
+
const mode_switcher_button: null | HTMLDivElement
|
|
29
|
+
const menus: {
|
|
30
|
+
file: Menu
|
|
31
|
+
edit: Menu
|
|
32
|
+
transform: Menu
|
|
33
|
+
uv: Menu
|
|
34
|
+
texture: Menu
|
|
35
|
+
animation: Menu
|
|
36
|
+
keyframe: Menu
|
|
37
|
+
display: Menu
|
|
38
|
+
tools: Menu
|
|
39
|
+
view: Menu
|
|
40
|
+
help: Menu
|
|
41
|
+
[id: string]: Menu
|
|
42
|
+
}
|
|
43
|
+
const keys: string[]
|
|
44
|
+
let open: Menu | null
|
|
45
|
+
/**
|
|
46
|
+
* Add a new menu to the menu bar
|
|
47
|
+
* @param menu The BarMenu to add
|
|
48
|
+
* @param position Specify the position in the menu list where to add insert the menu. Can either be an index in the list of all menus, or the ID of the menu to insert right from.
|
|
49
|
+
*/
|
|
50
|
+
function addMenu(menu: BarMenu, position?: number | string): void
|
|
51
|
+
/**
|
|
52
|
+
* Adds an action to the menu structure
|
|
53
|
+
* @param action Action to add
|
|
54
|
+
* @param path Path pointing to the location. Use the ID of each level of the menu, or index or group within a level, separated by a point. For example, `file.export.0` places the action at the top position of the Export submenu in the File menu.
|
|
55
|
+
*/
|
|
56
|
+
function addAction(action: Action, path?: string): void
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @param path Path pointing to the location. Use the ID of each level of the menu, or index or group 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
|
+
*/
|
|
61
|
+
function removeAction(path: string): void
|
|
62
|
+
/**
|
|
63
|
+
* Update the menu bar
|
|
64
|
+
*/
|
|
65
|
+
function update(): void
|
|
66
|
+
}
|
package/custom/misc.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ interface BlockbenchEventMap {
|
|
|
86
86
|
unselect_mode: { mode: Mode }
|
|
87
87
|
change_active_panel: any
|
|
88
88
|
resize_window: {event?: Event}
|
|
89
|
+
change_view_mode: {view_mode: string, previous_view_mode: string}
|
|
89
90
|
press_key: {input_in_focus?: HTMLElement, event: KeyboardEvent, capture: () => void}
|
|
90
91
|
select_format: {format: ModelFormat, project: ModelProject}
|
|
91
92
|
convert_format: {format: ModelFormat, old_format: ModelFormat}
|
|
@@ -155,13 +156,14 @@ declare function updateSelection(): void
|
|
|
155
156
|
declare var LZUTF8: any
|
|
156
157
|
|
|
157
158
|
declare function unselectAllElements(exceptions?: OutlinerNode[]): void
|
|
158
|
-
declare function updateCubeHighlights(hover_cube: Cube, force_off: boolean): void
|
|
159
159
|
declare function getRescalingFactor(angle: number): number
|
|
160
160
|
/**
|
|
161
161
|
* Get the world-space center of the selection
|
|
162
162
|
* @param all If true, calculate the center of all elements instead of just selected
|
|
163
163
|
*/
|
|
164
164
|
declare function getSelectionCenter(all: boolean = false): ArrayVector3
|
|
165
|
+
declare function getSpatialInterval(event?: Event): number;
|
|
166
|
+
declare function getRotationInterval(event?: Event): number;
|
|
165
167
|
|
|
166
168
|
declare const Pressing: {
|
|
167
169
|
shift: boolean
|
|
@@ -175,14 +177,20 @@ declare const Pressing: {
|
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
declare const Prop = {
|
|
178
|
-
active_panel: string
|
|
180
|
+
active_panel: string,
|
|
181
|
+
fps: number,
|
|
182
|
+
show_left_bar: boolean,
|
|
183
|
+
show_right_bar: boolean,
|
|
179
184
|
}
|
|
180
185
|
declare const Project: ModelProject
|
|
181
|
-
|
|
182
|
-
declare function updateCubeHighlights(hover_cube: Cube, force_off: boolean): void
|
|
183
|
-
declare function getRescalingFactor(angle: number): number
|
|
186
|
+
declare const ReferenceImageMode: any
|
|
184
187
|
|
|
185
188
|
declare function isStringNumber(value: any): boolean
|
|
186
189
|
|
|
187
190
|
declare function marked(text: string): string
|
|
188
191
|
declare function pureMarked(text: string): string
|
|
192
|
+
|
|
193
|
+
declare type ReferenceImage = any
|
|
194
|
+
declare const ReferenceImage = any
|
|
195
|
+
declare type SplineMesh = typeof OutlinerElement & Record<string, any>
|
|
196
|
+
declare const SplineMesh: typeof OutlinerElement
|
package/custom/painter.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ declare namespace Painter {
|
|
|
30
30
|
function getMirrorElement(element: OutlinerElement, symmetry_axes: number[]): void
|
|
31
31
|
function updateNslideValues(): void
|
|
32
32
|
function getBlendModeCompositeOperation(blend_mode?: string): string
|
|
33
|
+
function getCanvasToolPixelCoords(uv_point: {x: number, y: number}, texture: Texture): ArrayVector2
|
|
33
34
|
function getCanvas(texture: Texture): HTMLCanvasElement
|
|
34
35
|
function copyCanvas(original_canvas: HTMLCanvasElement): HTMLCanvasElement
|
|
35
36
|
function scanCanvas(
|
|
@@ -40,7 +41,7 @@ declare namespace Painter {
|
|
|
40
41
|
h: number,
|
|
41
42
|
cb: ((px: number, py: number, color: [r: number, g: number, b: number, a: number]) => [number, number, number, number] | void)
|
|
42
43
|
): void
|
|
43
|
-
function getPixelColor(ctx: CanvasRenderingContext2D, x: number, y: number):
|
|
44
|
+
function getPixelColor(ctx: CanvasRenderingContext2D, x: number, y: number): tinycolor
|
|
44
45
|
function modifyCanvasSection(
|
|
45
46
|
ctx: CanvasRenderingContext2D,
|
|
46
47
|
x: number,
|
|
@@ -68,3 +69,34 @@ declare namespace Painter {
|
|
|
68
69
|
function openBrushOptions(): void
|
|
69
70
|
function loadBrushPreset(preset: any): void
|
|
70
71
|
}
|
|
72
|
+
|
|
73
|
+
declare interface BarItemRegistry {
|
|
74
|
+
paint_secondary_color: KeybindItem
|
|
75
|
+
pan_tool: Tool
|
|
76
|
+
brush_tool: Tool
|
|
77
|
+
copy_brush: Tool
|
|
78
|
+
fill_tool: Tool
|
|
79
|
+
eraser: Tool
|
|
80
|
+
color_picker: Tool
|
|
81
|
+
draw_shape_tool: Tool
|
|
82
|
+
gradient_tool: Tool
|
|
83
|
+
move_layer_tool: Tool
|
|
84
|
+
brush_shape: BarSelect
|
|
85
|
+
draw_shape_type: BarSelect
|
|
86
|
+
blend_mode: BarSelect
|
|
87
|
+
fill_mode: BarSelect
|
|
88
|
+
copy_brush_mode: BarSelect
|
|
89
|
+
selection_tool_operation_mode: BarSelect
|
|
90
|
+
expand_texture_selection: Action
|
|
91
|
+
mirror_painting: Toggle
|
|
92
|
+
color_erase_mode: Toggle
|
|
93
|
+
lock_alpha: Toggle
|
|
94
|
+
painting_grid: Toggle
|
|
95
|
+
image_tiled_view: Toggle
|
|
96
|
+
image_onion_skin_view: Toggle
|
|
97
|
+
slider_brush_size: NumSlider
|
|
98
|
+
slider_brush_softness: NumSlider
|
|
99
|
+
slider_brush_opacity: NumSlider
|
|
100
|
+
pixel_perfect_drawing: Toggle
|
|
101
|
+
slider_color_select_threshold: NumSlider
|
|
102
|
+
}
|
package/custom/screencam.d.ts
CHANGED
package/custom/spline_mesh.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="./blockbench"/>
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
declare class SplineTubeFace extends MeshFace {
|
|
5
5
|
constructor(mesh: any, spline: any, data: any);
|
|
6
6
|
get element(): SplineMesh;
|
|
7
7
|
getTexture(): Texture;
|
|
@@ -14,7 +14,7 @@ interface SplineCurveOptions {
|
|
|
14
14
|
start_ctrl: any
|
|
15
15
|
end_ctrl: any
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
declare class SplineCurve {
|
|
18
18
|
constructor(spline: SplineMesh, data: SplineCurveOptions);
|
|
19
19
|
get element(): SplineMesh;
|
|
20
20
|
extend(data: SplineCurveOptions): this;
|
|
@@ -49,7 +49,7 @@ export declare class SplineCurve {
|
|
|
49
49
|
interface SplineHandle {
|
|
50
50
|
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
declare class SplineHandle {
|
|
53
53
|
constructor(spline: SplineMesh, data: SplineHandle);
|
|
54
54
|
get element(): SplineMesh;
|
|
55
55
|
extend(data: SplineHandle): this;
|
|
@@ -67,7 +67,7 @@ export declare class SplineHandle {
|
|
|
67
67
|
interface SplineMeshOptions {
|
|
68
68
|
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
declare class SplineMesh extends OutlinerElement {
|
|
71
71
|
constructor(data: any, uuid: any);
|
|
72
72
|
get vertices(): Record<string, ArrayVector3>;
|
|
73
73
|
get handles(): Record<string, SplineHandle>;
|
|
@@ -77,6 +77,7 @@ export declare class SplineMesh extends OutlinerElement {
|
|
|
77
77
|
set curves(v: Record<string, SplineCurve>);
|
|
78
78
|
get position(): ArrayVector3;
|
|
79
79
|
get vertice_list(): any[];
|
|
80
|
+
faces: Record<string, SplineTubeFace>
|
|
80
81
|
cyclic: boolean
|
|
81
82
|
export: boolean
|
|
82
83
|
display_space: boolean
|
package/custom/textures.d.ts
CHANGED
|
@@ -395,6 +395,7 @@ declare global {
|
|
|
395
395
|
static properties: Record<string, Property<any>>
|
|
396
396
|
|
|
397
397
|
static file_formats: Record<string, FileFormatOptions>
|
|
398
|
+
static getAllExtensions(): string[]
|
|
398
399
|
}
|
|
399
400
|
/**
|
|
400
401
|
* Saves all textures
|
|
@@ -520,5 +521,6 @@ declare global {
|
|
|
520
521
|
function nextFrame(): void
|
|
521
522
|
function reset(): void
|
|
522
523
|
function updateButton(): void
|
|
524
|
+
function playAnimationFrame(anim_time?: number): void
|
|
523
525
|
}
|
|
524
526
|
}
|
package/generated/api.d.ts
CHANGED
|
@@ -105,8 +105,9 @@ export declare const Blockbench: {
|
|
|
105
105
|
removeDragHandler: typeof Filesystem.removeDragHandler;
|
|
106
106
|
};
|
|
107
107
|
declare global {
|
|
108
|
-
interface
|
|
108
|
+
interface Window {
|
|
109
109
|
Blockbench: typeof Blockbench;
|
|
110
|
+
osfs: '/' | '\\';
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
declare const global: {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import MolangParser from "molangjs";
|
|
2
2
|
import tinycolor from "tinycolor2";
|
|
3
|
+
import { RaycastResult } from "../preview/preview";
|
|
4
|
+
import { MenuItem } from "./menu";
|
|
3
5
|
export declare const BarItems: any;
|
|
4
6
|
type SubKeybind = {
|
|
5
7
|
name: string;
|
|
@@ -8,6 +10,7 @@ type SubKeybind = {
|
|
|
8
10
|
trigger: (event: Event) => void;
|
|
9
11
|
};
|
|
10
12
|
export interface KeybindItemOptions {
|
|
13
|
+
id?: string;
|
|
11
14
|
name?: string;
|
|
12
15
|
description?: string;
|
|
13
16
|
category?: string;
|
|
@@ -52,7 +55,7 @@ export declare abstract class BarItem extends EventSystem {
|
|
|
52
55
|
id: string;
|
|
53
56
|
name: string;
|
|
54
57
|
description: string;
|
|
55
|
-
icon?: IconString | (() => IconString);
|
|
58
|
+
icon?: IconString | ((context?: any) => IconString);
|
|
56
59
|
category?: string;
|
|
57
60
|
color?: string;
|
|
58
61
|
condition: ConditionResolvable;
|
|
@@ -112,9 +115,7 @@ export declare class KeybindItem {
|
|
|
112
115
|
description?: string;
|
|
113
116
|
};
|
|
114
117
|
};
|
|
115
|
-
constructor(id: string, data: KeybindItemOptions
|
|
116
|
-
id: string;
|
|
117
|
-
});
|
|
118
|
+
constructor(id: string, data: KeybindItemOptions);
|
|
118
119
|
delete(): void;
|
|
119
120
|
}
|
|
120
121
|
export interface ActionOptions extends BarItemOptions {
|
|
@@ -312,7 +313,7 @@ export interface BrushOptions {
|
|
|
312
313
|
interface ToolSpecificOptions {
|
|
313
314
|
selectFace?: boolean;
|
|
314
315
|
selectElements?: boolean;
|
|
315
|
-
transformerMode?: 'translate' | 'hidden' | '';
|
|
316
|
+
transformerMode?: 'translate' | 'scale' | 'rotate' | 'stretch' | 'hidden' | '';
|
|
316
317
|
cursor?: string;
|
|
317
318
|
animation_channel?: string;
|
|
318
319
|
toolbar?: string;
|
|
@@ -329,7 +330,7 @@ interface ToolSpecificOptions {
|
|
|
329
330
|
onCanvasClick?(raycast_data: RaycastResult): void;
|
|
330
331
|
onSelect?(): void;
|
|
331
332
|
onUnselect?(): void;
|
|
332
|
-
onCanvasMouseMove?(raycast_data: RaycastResult): any;
|
|
333
|
+
onCanvasMouseMove?(raycast_data: RaycastResult | false): any;
|
|
333
334
|
onCanvasRightClick?(raycast_data: RaycastResult): any;
|
|
334
335
|
onTextureEditorClick?(raycast_data: RaycastResult): any;
|
|
335
336
|
}
|
|
@@ -393,13 +394,13 @@ interface WidgetOptions extends BarItemOptions {
|
|
|
393
394
|
export declare abstract class Widget extends BarItem {
|
|
394
395
|
constructor(id: string, data: WidgetOptions);
|
|
395
396
|
}
|
|
396
|
-
type NumSliderOptions = WidgetOptions & {
|
|
397
|
+
export type NumSliderOptions = WidgetOptions & {
|
|
397
398
|
private?: boolean;
|
|
398
399
|
settings?: {
|
|
399
400
|
default?: number;
|
|
400
401
|
min?: number;
|
|
401
402
|
max?: number;
|
|
402
|
-
interval?: number;
|
|
403
|
+
interval?: number | (() => number);
|
|
403
404
|
step?: number;
|
|
404
405
|
show_bar?: boolean;
|
|
405
406
|
limit?: boolean;
|
|
@@ -502,7 +503,7 @@ export declare class BarSlider extends Widget {
|
|
|
502
503
|
type BarSelectPropertyFormat = string | boolean | {
|
|
503
504
|
name: string | true;
|
|
504
505
|
condition?: ConditionResolvable;
|
|
505
|
-
icon?:
|
|
506
|
+
icon?: IconString;
|
|
506
507
|
};
|
|
507
508
|
interface BarSelectOptions extends WidgetOptions {
|
|
508
509
|
value?: string;
|