blockbench-types 4.0.0 → 4.2.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/package.json +2 -2
- package/types/animation.d.ts +63 -1
- package/types/format.d.ts +5 -0
- package/types/index.d.ts +1 -19
- package/types/interface.d.ts +2 -10
- package/types/menu.d.ts +15 -1
- package/types/panel.d.ts +54 -0
- package/types/project.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blockbench-types",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Blockbench typescript types",
|
|
5
5
|
"main": "",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
"@types/jquery": "^3.5.4",
|
|
22
22
|
"three": "^0.129.0",
|
|
23
23
|
"vue": "^2.6.14",
|
|
24
|
-
"wintersky": "^1.0
|
|
24
|
+
"wintersky": "^1.1.0"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/types/animation.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ interface AnimationOptions {
|
|
|
8
8
|
snapping?: number
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
class Animation {
|
|
11
|
+
declare class Animation {
|
|
12
12
|
constructor(data: AnimationOptions);
|
|
13
13
|
extend(data: AnimationOptions): this;
|
|
14
14
|
getUndoCopy(options: any, save: any): {
|
|
@@ -62,3 +62,65 @@ namespace Animator {
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
}
|
|
65
|
+
|
|
66
|
+
interface AddChannelOptions {
|
|
67
|
+
name?: string
|
|
68
|
+
transform?: boolean
|
|
69
|
+
mutable?: boolean
|
|
70
|
+
max_data_points?: number
|
|
71
|
+
}
|
|
72
|
+
declare class GeneralAnimator {
|
|
73
|
+
constructor(uuid: string, animation: Animation)
|
|
74
|
+
keyframes: Keyframe[]
|
|
75
|
+
select(): this
|
|
76
|
+
addToTimeline(): this
|
|
77
|
+
addKeyframe(data: KeyframeOptions, uuid: string): Keyframe
|
|
78
|
+
createKeyframe(): Keyframe
|
|
79
|
+
getOrMakeKeyframe(): {before: Keyframe, result: Keyframe}
|
|
80
|
+
toggleMuted(channel: string): this
|
|
81
|
+
scrollTo(): this
|
|
82
|
+
|
|
83
|
+
static addChannel(channel: string, options: AddChannelOptions)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
declare class BoneAnimator extends GeneralAnimator {
|
|
87
|
+
name: string
|
|
88
|
+
uuid: string
|
|
89
|
+
rotations: Keyframe[]
|
|
90
|
+
position: Keyframe[]
|
|
91
|
+
scale: Keyframe[]
|
|
92
|
+
getGroup(): Group
|
|
93
|
+
select
|
|
94
|
+
fillValues
|
|
95
|
+
pushKeyframe
|
|
96
|
+
doRender
|
|
97
|
+
displayRotation
|
|
98
|
+
displayPosition
|
|
99
|
+
displayScale
|
|
100
|
+
interpolate
|
|
101
|
+
displayFrame
|
|
102
|
+
}
|
|
103
|
+
declare class NullObjectAnimator extends GeneralAnimator {
|
|
104
|
+
name: string
|
|
105
|
+
uuid: string
|
|
106
|
+
rotations: Keyframe[]
|
|
107
|
+
position: Keyframe[]
|
|
108
|
+
scale: Keyframe[]
|
|
109
|
+
getElement(): NullObject
|
|
110
|
+
select
|
|
111
|
+
doRender
|
|
112
|
+
displayPosition
|
|
113
|
+
displayIK
|
|
114
|
+
displayFrame
|
|
115
|
+
}
|
|
116
|
+
declare class EffectAnimator extends GeneralAnimator {
|
|
117
|
+
name: string
|
|
118
|
+
uuid: string
|
|
119
|
+
rotations: Keyframe[]
|
|
120
|
+
position: Keyframe[]
|
|
121
|
+
scale: Keyframe[]
|
|
122
|
+
pushKeyframe(keyframe): this
|
|
123
|
+
displayFrame(in_loop): this
|
|
124
|
+
startPreviousSounds
|
|
125
|
+
}
|
|
126
|
+
|
package/types/format.d.ts
CHANGED
|
@@ -13,12 +13,17 @@ interface FormatOptions {
|
|
|
13
13
|
centered_grid?: boolean
|
|
14
14
|
rotate_cubes?: boolean
|
|
15
15
|
integer_size?: boolean
|
|
16
|
+
meshes?: boolean
|
|
17
|
+
texture_meshes?: boolean
|
|
16
18
|
locators?: boolean
|
|
17
19
|
canvas_limit?: boolean
|
|
18
20
|
rotation_limit?: boolean
|
|
19
21
|
uv_rotation?: boolean
|
|
20
22
|
display_mode?: boolean
|
|
21
23
|
animation_mode?: boolean
|
|
24
|
+
animation_files?: boolean
|
|
25
|
+
pose_mode?: boolean
|
|
26
|
+
texture_folder?: boolean
|
|
22
27
|
|
|
23
28
|
codec?: Codec
|
|
24
29
|
onActivation?(): void
|
package/types/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
/// <reference types="./format" />
|
|
12
12
|
/// <reference types="./global" />
|
|
13
13
|
/// <reference types="./interface" />
|
|
14
|
+
/// <reference types="./panel" />
|
|
14
15
|
/// <reference types="./keyframe" />
|
|
15
16
|
/// <reference types="./legacy" />
|
|
16
17
|
/// <reference types="./menu" />
|
|
@@ -205,25 +206,6 @@ declare class Plugin {
|
|
|
205
206
|
|
|
206
207
|
type Condition = any
|
|
207
208
|
|
|
208
|
-
interface PanelOptions {
|
|
209
|
-
id: string
|
|
210
|
-
icon: string
|
|
211
|
-
menu?: any
|
|
212
|
-
growable?: boolean
|
|
213
|
-
name: string
|
|
214
|
-
selection_only?: boolean
|
|
215
|
-
condition?: Condition
|
|
216
|
-
onResize: () => void
|
|
217
|
-
toolbars: object
|
|
218
|
-
component: Vue.Component
|
|
219
|
-
default_side: any
|
|
220
|
-
insert_before: any
|
|
221
|
-
insert_after: any
|
|
222
|
-
}
|
|
223
|
-
declare class Panel {
|
|
224
|
-
constructor (options: PanelOptions)
|
|
225
|
-
}
|
|
226
|
-
|
|
227
209
|
|
|
228
210
|
interface PropertyOptions {
|
|
229
211
|
default?: any
|
package/types/interface.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface DialogFormElement {
|
|
2
2
|
label: string
|
|
3
3
|
description?: string
|
|
4
|
-
type: 'text' | 'number' | 'checkbox' | 'select' | 'radio' | 'textarea' | 'vector' | 'color' | 'file' | 'folder' | 'save' | 'info'
|
|
4
|
+
type: 'text' | 'number' | 'checkbox' | 'select' | 'radio' | 'textarea' | 'vector' | 'color' | 'file' | 'folder' | 'save' | 'info'
|
|
5
5
|
nocolon?: boolean
|
|
6
6
|
readonly?: boolean
|
|
7
7
|
value?: any
|
|
@@ -27,14 +27,6 @@ interface ActionInterface {
|
|
|
27
27
|
interface DialogOptions {
|
|
28
28
|
title: string
|
|
29
29
|
id: string
|
|
30
|
-
/**
|
|
31
|
-
* If false, the confirm button of the dialog is disabled
|
|
32
|
-
*/
|
|
33
|
-
confirmEnabled?: boolean
|
|
34
|
-
/**
|
|
35
|
-
* If false, the cancel button of the dialog is disabled
|
|
36
|
-
*/
|
|
37
|
-
cancelEnabled?: boolean
|
|
38
30
|
/**
|
|
39
31
|
* Default button to press to confirm the dialog. Defaults to the first button.
|
|
40
32
|
*/
|
|
@@ -98,7 +90,7 @@ interface DialogOptions {
|
|
|
98
90
|
|
|
99
91
|
interface DialogSidebarOptions {
|
|
100
92
|
pages?: {
|
|
101
|
-
[key: string]: string
|
|
93
|
+
[key: string]: string | {label: string, icon: IconString, color?: string}
|
|
102
94
|
}
|
|
103
95
|
page?: string
|
|
104
96
|
actions?: (Action|ActionInterface|string)[],
|
package/types/menu.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
interface CustomMenuItem {
|
|
2
2
|
name: string
|
|
3
|
+
id: string
|
|
4
|
+
icon: IconString
|
|
5
|
+
color?: string
|
|
6
|
+
description?: string
|
|
7
|
+
/**
|
|
8
|
+
* Keybind or string to display in the menu, won't work as an actual keybinding by default
|
|
9
|
+
*/
|
|
10
|
+
keybind?: Keybind | string
|
|
11
|
+
/**
|
|
12
|
+
* Adds a search bar to the menu or submenu
|
|
13
|
+
*/
|
|
14
|
+
searchable?: boolean
|
|
15
|
+
children?: MenuItem[] | (() => MenuItem[])
|
|
16
|
+
click?: (context?: any, event: Event)
|
|
3
17
|
}
|
|
4
|
-
type MenuItem = CustomMenuItem | Action | string;
|
|
18
|
+
type MenuItem = CustomMenuItem | Action | BarSelect | string;
|
|
5
19
|
|
|
6
20
|
/**
|
|
7
21
|
* Creates a new context menu
|
package/types/panel.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
interface PanelOptions {
|
|
2
|
+
id: string
|
|
3
|
+
name: string
|
|
4
|
+
icon: string
|
|
5
|
+
menu?: any
|
|
6
|
+
growable?: boolean
|
|
7
|
+
selection_only?: boolean
|
|
8
|
+
condition?: Condition
|
|
9
|
+
display_condition?: Condition
|
|
10
|
+
expand_button: boolean
|
|
11
|
+
toolbars: {
|
|
12
|
+
[id: string]: Toolbar
|
|
13
|
+
}
|
|
14
|
+
default_position: {
|
|
15
|
+
slot: string
|
|
16
|
+
float_position: [number, number]
|
|
17
|
+
float_size: [number, number]
|
|
18
|
+
height: number
|
|
19
|
+
folded: boolean
|
|
20
|
+
}
|
|
21
|
+
component: Vue.Component
|
|
22
|
+
default_side: 'right' | 'left'
|
|
23
|
+
insert_before: string
|
|
24
|
+
insert_after: string
|
|
25
|
+
onResize: () => void
|
|
26
|
+
onFold: () => void
|
|
27
|
+
}
|
|
28
|
+
type PanelEvent = 'drag' | 'fold' | 'change_zindex' | 'move_to' | 'moved_to' | 'update'
|
|
29
|
+
|
|
30
|
+
declare class Panel {
|
|
31
|
+
constructor (id: string, options: PanelOptions)
|
|
32
|
+
constructor (options: PanelOptions)
|
|
33
|
+
isVisible(): boolean
|
|
34
|
+
isInSidebar(): boolean
|
|
35
|
+
slot: string
|
|
36
|
+
folded: boolean
|
|
37
|
+
fold(state?: boolean): this
|
|
38
|
+
/**
|
|
39
|
+
* If the panel is floating, move it up to the front
|
|
40
|
+
*/
|
|
41
|
+
moveToFront(): this
|
|
42
|
+
moveTo(slot: string, ref_panel?: Panel, before?: boolean): this
|
|
43
|
+
update(dragging?: boolean): this
|
|
44
|
+
dispatchEvent(event_name: PanelEvent, data?: any): void
|
|
45
|
+
/**
|
|
46
|
+
* Add an event listener
|
|
47
|
+
*/
|
|
48
|
+
on(event_name: PanelEvent, callback: (data?) => void): void
|
|
49
|
+
removeListener(event_name: PanelEvent, callback: (data?) => void): void
|
|
50
|
+
delete(): void
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
declare function updateInterfacePanels(): void
|
|
54
|
+
declare function setActivePanel(panel_id: string): void
|