blockbench-types 4.9.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/.prettierignore +1 -0
- package/.prettierrc.json +9 -0
- package/README.md +3 -2
- package/package.json +43 -33
- package/scripts/generate_docs.js +243 -196
- package/tsconfig.json +13 -14
- package/types/action.d.ts +358 -279
- package/types/animation.d.ts +181 -147
- package/types/animation_controller.d.ts +105 -99
- package/types/blockbench.d.ts +136 -76
- package/types/canvas.d.ts +239 -228
- package/types/canvas_frame.d.ts +2 -2
- package/types/codec.d.ts +36 -32
- package/types/cube.d.ts +32 -11
- package/types/desktop.d.ts +14 -0
- package/types/dialog.d.ts +175 -38
- package/types/display_mode.d.ts +17 -6
- package/types/file_system.d.ts +159 -0
- package/types/format.d.ts +55 -12
- package/types/global.d.ts +49 -3
- package/types/group.d.ts +16 -5
- package/types/index.d.ts +1 -0
- package/types/interface.d.ts +21 -12
- package/types/io.d.ts +2 -2
- package/types/keyframe.d.ts +72 -58
- package/types/legacy.d.ts +2 -1
- package/types/math_util.d.ts +1 -1
- package/types/menu.d.ts +93 -78
- package/types/mesh.d.ts +89 -64
- package/types/misc.d.ts +114 -47
- package/types/mode.d.ts +14 -1
- package/types/molang.d.ts +17 -0
- package/types/outliner.d.ts +42 -23
- package/types/painter.d.ts +49 -11
- package/types/panel.d.ts +49 -21
- package/types/plugin.d.ts +52 -0
- package/types/preview.d.ts +71 -69
- package/types/preview_scene.d.ts +26 -17
- package/types/project.d.ts +54 -37
- package/types/screencam.d.ts +11 -6
- package/types/settings.d.ts +87 -85
- package/types/shared_actions.d.ts +25 -9
- package/types/texture_layers.d.ts +104 -105
- package/types/textures.d.ts +322 -313
- package/types/timeline.d.ts +60 -60
- package/types/undo.d.ts +109 -105
- package/types/util.d.ts +152 -37
- package/types/uveditor.d.ts +3 -0
- package/types/validator.d.ts +3 -2
- package/types/vue.d.ts +7 -0
package/types/animation.d.ts
CHANGED
|
@@ -1,177 +1,211 @@
|
|
|
1
|
+
/// <reference path="./blockbench.d.ts"/>
|
|
2
|
+
|
|
1
3
|
declare class AnimationItem {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
+
static all: _Animation[]
|
|
5
|
+
static selected: _Animation | null
|
|
6
|
+
getUndoCopy?(options?: any, save?: any): AnimationOptions
|
|
4
7
|
}
|
|
5
8
|
|
|
6
9
|
interface AnimationOptions {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
name?: string
|
|
11
|
+
uuid?: string
|
|
12
|
+
path?: string
|
|
13
|
+
loop?: 'once' | 'hold' | 'loop'
|
|
14
|
+
override?: boolean
|
|
15
|
+
anim_time_update?: string
|
|
16
|
+
blend_weight?: string
|
|
17
|
+
length?: number
|
|
18
|
+
snapping?: number
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface AnimationUndoCopy {
|
|
22
|
+
uuid: any
|
|
23
|
+
name: any
|
|
24
|
+
loop: any
|
|
25
|
+
override: any
|
|
26
|
+
anim_time_update: any
|
|
27
|
+
blend_weight: any
|
|
28
|
+
length: any
|
|
29
|
+
snapping: any
|
|
30
|
+
selected: any
|
|
15
31
|
}
|
|
16
32
|
|
|
17
33
|
declare class _Animation extends AnimationItem {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
getMaxLength(): number;
|
|
53
|
-
setLoop(value: any, undo: any): void;
|
|
54
|
-
/**
|
|
55
|
-
* Calculate the snapping value that the animation should use, based on the time codes of the keyframes that it holds. Directly updates the value, but also returns it as a number (snaps per second)
|
|
56
|
-
*/
|
|
57
|
-
calculateSnappingFromKeyframes(): number;
|
|
58
|
-
/**
|
|
59
|
-
* Opens the properties dialog
|
|
60
|
-
*/
|
|
61
|
-
propertiesDialog(): void;
|
|
34
|
+
constructor(data?: AnimationOptions)
|
|
35
|
+
extend(data?: AnimationOptions): this
|
|
36
|
+
getUndoCopy(options?: {}, save?: any): AnimationUndoCopy
|
|
37
|
+
/**
|
|
38
|
+
* Compiles the JSON tree of the animation for the Minecraft Bedrock Edition animation format.
|
|
39
|
+
*/
|
|
40
|
+
compileBedrockAnimation(): any
|
|
41
|
+
save(): this | undefined
|
|
42
|
+
select(): this | undefined
|
|
43
|
+
setLength(length?: number): void
|
|
44
|
+
createUniqueName(references: _Animation[]): any
|
|
45
|
+
rename(): this
|
|
46
|
+
togglePlayingState(state: any): any
|
|
47
|
+
showContextMenu(event: any): this
|
|
48
|
+
/**
|
|
49
|
+
* Returns (if necessary creates) the animator of a specific outliner node of this animation
|
|
50
|
+
*/
|
|
51
|
+
getBoneAnimator(node?: OutlinerNode): BoneAnimator
|
|
52
|
+
/**
|
|
53
|
+
* Adds the animation to the current project and to the interface
|
|
54
|
+
* @param undo If true, the addition of the animation will be registered as an edit
|
|
55
|
+
*/
|
|
56
|
+
add(undo?: boolean): this
|
|
57
|
+
remove(undo: boolean, remove_from_file?: boolean): this
|
|
58
|
+
getMaxLength(): number
|
|
59
|
+
setLoop(value: any, undo: any): void
|
|
60
|
+
/**
|
|
61
|
+
* Calculate the snapping value that the animation should use, based on the time codes of the keyframes that it holds. Directly updates the value, but also returns it as a number (snaps per second)
|
|
62
|
+
*/
|
|
63
|
+
calculateSnappingFromKeyframes(): number
|
|
64
|
+
/**
|
|
65
|
+
* Opens the properties dialog
|
|
66
|
+
*/
|
|
67
|
+
propertiesDialog(): void
|
|
62
68
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
name: string
|
|
70
|
+
uuid: string
|
|
71
|
+
loop: 'once' | 'hold' | 'loop'
|
|
72
|
+
override: boolean
|
|
73
|
+
anim_time_update: string
|
|
74
|
+
blend_weight: string
|
|
75
|
+
length: number
|
|
76
|
+
snapping: number
|
|
77
|
+
loop_delay: string
|
|
78
|
+
start_delay: string
|
|
79
|
+
path: string
|
|
80
|
+
playing: boolean
|
|
81
|
+
saved: boolean
|
|
82
|
+
time: number
|
|
75
83
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
effects?: EffectAnimator
|
|
85
|
+
|
|
86
|
+
markers: TimelineMarker[]
|
|
87
|
+
animators: {
|
|
88
|
+
[id: string]: GeneralAnimator | undefined
|
|
89
|
+
}
|
|
90
|
+
saved_name?: string
|
|
91
|
+
selected: boolean
|
|
92
|
+
type: string
|
|
84
93
|
}
|
|
85
94
|
|
|
95
|
+
interface MolangAutoCompletionItem {
|
|
96
|
+
text: string
|
|
97
|
+
label: string | undefined
|
|
98
|
+
overlap: number
|
|
99
|
+
}
|
|
86
100
|
|
|
87
101
|
declare namespace Animator {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
102
|
+
const open: boolean
|
|
103
|
+
const MolangParser: Molang
|
|
104
|
+
const possible_channels: unknown[]
|
|
105
|
+
const motion_trail: THREE.Object3D
|
|
106
|
+
const motion_trail_lock: boolean
|
|
107
|
+
const particle_effects: any
|
|
108
|
+
const animations: _Animation[]
|
|
109
|
+
const selected: _Animation | undefined
|
|
110
|
+
function showDefaultPose(no_matrix_update?: boolean): void
|
|
111
|
+
function resetParticles(): void
|
|
112
|
+
function showMotionTrail(target?: Group): void
|
|
113
|
+
/**
|
|
114
|
+
* Updates the preview based on the current time
|
|
115
|
+
*/
|
|
116
|
+
function preview(in_loop?: boolean): void
|
|
117
|
+
function loadParticleEmitter(path: string, content: string): void
|
|
118
|
+
/**
|
|
119
|
+
* Import a Bedrock animation file
|
|
120
|
+
* @param file File any
|
|
121
|
+
* @param animation_filter List of names of animations to import
|
|
122
|
+
*/
|
|
123
|
+
function loadFile(file: any, animation_filter?: string[]): void
|
|
124
|
+
function resetLastValues(): void
|
|
125
|
+
function autocompleteMolang(
|
|
126
|
+
text: string,
|
|
127
|
+
position: number,
|
|
128
|
+
type: string
|
|
129
|
+
): MolangAutoCompletionItem[]
|
|
110
130
|
}
|
|
111
131
|
|
|
112
132
|
interface AddChannelOptions {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
133
|
+
name?: string
|
|
134
|
+
transform?: boolean
|
|
135
|
+
mutable?: boolean
|
|
136
|
+
max_data_points?: number
|
|
137
|
+
}
|
|
138
|
+
interface Channel {
|
|
139
|
+
name: string
|
|
140
|
+
transform: boolean
|
|
141
|
+
mutable: boolean
|
|
142
|
+
max_data_points: number
|
|
117
143
|
}
|
|
118
144
|
declare class GeneralAnimator {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
145
|
+
constructor(uuid: string | null, animation: _Animation, name: string)
|
|
146
|
+
uuid: string
|
|
147
|
+
keyframes: _Keyframe[]
|
|
148
|
+
animation: _Animation
|
|
149
|
+
expanded: boolean
|
|
150
|
+
selected: boolean
|
|
151
|
+
select(): this
|
|
152
|
+
addToTimeline(): this
|
|
153
|
+
addKeyframe(data: KeyframeOptions, uuid?: string): _Keyframe
|
|
154
|
+
createKeyframe(): _Keyframe
|
|
155
|
+
getOrMakeKeyframe(): { before: _Keyframe; result: _Keyframe }
|
|
156
|
+
toggleMuted(channel: string): this
|
|
157
|
+
scrollTo(): this
|
|
129
158
|
|
|
130
|
-
|
|
159
|
+
static addChannel(channel: string, options: AddChannelOptions): void
|
|
160
|
+
channels: {
|
|
161
|
+
[channel: string]: Channel
|
|
162
|
+
}
|
|
163
|
+
muted: {
|
|
164
|
+
[channel: string]: boolean | undefined
|
|
165
|
+
};
|
|
166
|
+
[channel: string]: any
|
|
131
167
|
}
|
|
132
168
|
|
|
133
169
|
declare class BoneAnimator extends GeneralAnimator {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
170
|
+
name: string
|
|
171
|
+
uuid: string
|
|
172
|
+
rotations: _Keyframe[]
|
|
173
|
+
position: _Keyframe[]
|
|
174
|
+
scale: _Keyframe[]
|
|
175
|
+
getGroup(): Group
|
|
176
|
+
fillValues(): void
|
|
177
|
+
pushKeyframe(): void
|
|
178
|
+
doRender(): boolean
|
|
179
|
+
displayRotation(): void
|
|
180
|
+
displayPosition(): void
|
|
181
|
+
displayScale(): void
|
|
182
|
+
interpolate(channel: string, allow_expression?: boolean, axis?: string): ArrayVector3
|
|
183
|
+
displayFrame(multiplier?: number): void
|
|
148
184
|
}
|
|
149
185
|
declare class NullObjectAnimator extends GeneralAnimator {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
186
|
+
name: string
|
|
187
|
+
uuid: string
|
|
188
|
+
rotations: _Keyframe[]
|
|
189
|
+
position: _Keyframe[]
|
|
190
|
+
scale: _Keyframe[]
|
|
191
|
+
getElement(): NullObject
|
|
192
|
+
doRender(): void
|
|
193
|
+
displayPosition(): void
|
|
194
|
+
displayIK(): void
|
|
195
|
+
displayFrame(): void
|
|
160
196
|
}
|
|
161
197
|
declare class EffectAnimator extends GeneralAnimator {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
startPreviousSounds(): void
|
|
198
|
+
name: string
|
|
199
|
+
uuid: string
|
|
200
|
+
rotations: _Keyframe[]
|
|
201
|
+
position: _Keyframe[]
|
|
202
|
+
scale: _Keyframe[]
|
|
203
|
+
pushKeyframe(keyframe: _Keyframe): this
|
|
204
|
+
displayFrame(in_loop?: boolean): void
|
|
205
|
+
startPreviousSounds(): void
|
|
171
206
|
}
|
|
172
207
|
|
|
173
208
|
declare class TimelineMarker {
|
|
174
|
-
|
|
175
|
-
|
|
209
|
+
color: number
|
|
210
|
+
time: number
|
|
176
211
|
}
|
|
177
|
-
|
|
@@ -1,118 +1,124 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/// <reference path="./blockbench.d.ts"/>
|
|
2
|
+
|
|
3
|
+
type StateAnimationInput =
|
|
4
|
+
| string
|
|
5
|
+
| {
|
|
6
|
+
[key: string]: string
|
|
7
|
+
}
|
|
8
|
+
| {
|
|
9
|
+
uuid: string
|
|
10
|
+
key?: string
|
|
11
|
+
animation?: string
|
|
12
|
+
blend_value?: number
|
|
13
|
+
}
|
|
9
14
|
type StateAnimation = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
uuid: string
|
|
16
|
+
key: string
|
|
17
|
+
animation: string
|
|
18
|
+
blend_value: number
|
|
14
19
|
}
|
|
15
20
|
|
|
16
21
|
interface AnimationControllerStateOptions {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
name?: string
|
|
23
|
+
animations?: StateAnimationInput[]
|
|
24
|
+
transitions?: any[]
|
|
25
|
+
sounds?: any[]
|
|
26
|
+
particles?: any[]
|
|
27
|
+
on_entry?: string
|
|
28
|
+
on_exit?: string
|
|
29
|
+
blend_transition?: number
|
|
30
|
+
blend_via_shortest_path?: boolean
|
|
26
31
|
}
|
|
27
32
|
|
|
28
33
|
declare class AnimationControllerState {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
34
|
+
constructor(controller: AnimationController, options?: AnimationControllerStateOptions)
|
|
35
|
+
controller: AnimationController
|
|
36
|
+
uuid: string
|
|
37
|
+
name: string
|
|
38
|
+
fold: {
|
|
39
|
+
animations: boolean
|
|
40
|
+
particles: boolean
|
|
41
|
+
sounds: boolean
|
|
42
|
+
on_entry: boolean
|
|
43
|
+
on_exit: boolean
|
|
44
|
+
transitions: boolean
|
|
45
|
+
}
|
|
46
|
+
muted: {
|
|
47
|
+
sound: boolean
|
|
48
|
+
particle: boolean
|
|
49
|
+
}
|
|
50
|
+
playing_sounds: HTMLAudioElement[]
|
|
51
|
+
animations: StateAnimation[]
|
|
52
|
+
transitions: any[]
|
|
53
|
+
sounds: any[]
|
|
54
|
+
particles: any[]
|
|
55
|
+
on_entry: string
|
|
56
|
+
on_exit: string
|
|
57
|
+
blend_transition: number
|
|
58
|
+
blend_via_shortest_path: boolean
|
|
54
59
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
extend(data: AnimationControllerStateOptions): void
|
|
61
|
+
getUndoCopy(): any
|
|
62
|
+
compileForBedrock(): any
|
|
63
|
+
select(force?: boolean): void
|
|
64
|
+
unselect(): void
|
|
65
|
+
playEffects(): void
|
|
66
|
+
scrollTo(): void
|
|
67
|
+
rename(): void
|
|
68
|
+
remove(undo?: boolean): void
|
|
69
|
+
createUniqueName(): void
|
|
65
70
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
addAnimation(animation?: _Animation): void
|
|
72
|
+
addTransition(target_uuid?: string): void
|
|
73
|
+
addParticle(options?: { effect: string }): void
|
|
74
|
+
addSound(options?: { effect: string; file: string }): void
|
|
75
|
+
openMenu(event: Event): void
|
|
76
|
+
/**
|
|
77
|
+
* Returns the current animation time of the state in seconds
|
|
78
|
+
*/
|
|
79
|
+
getStateTime(): number
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
interface AnimationControllerOptions {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
83
|
+
name?: string
|
|
84
|
+
uuid?: string
|
|
85
|
+
path?: string
|
|
86
|
+
initial_state?: string
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
/**
|
|
84
90
|
* Animation Controllers are state machines used for Minecraft: Bedrock Edition models to control and blend between animations.
|
|
85
91
|
*/
|
|
86
92
|
declare class AnimationController extends AnimationItem {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
93
|
+
constructor(data?: AnimationControllerOptions)
|
|
94
|
+
name: string
|
|
95
|
+
path: string
|
|
96
|
+
uuid: string
|
|
97
|
+
playing: boolean
|
|
98
|
+
saved: boolean
|
|
99
|
+
selected: boolean
|
|
100
|
+
saved_name: string
|
|
101
|
+
states: AnimationControllerState[]
|
|
102
|
+
initial_state: string
|
|
103
|
+
selected_state: null | AnimationControllerState
|
|
104
|
+
extend(data: AnimationControllerOptions): this
|
|
105
|
+
getUndoCopy(): any
|
|
106
|
+
compileForBedrock(): any
|
|
107
|
+
save(): this | undefined
|
|
108
|
+
select(): this | undefined
|
|
109
|
+
createUniqueName(references: AnimationController[]): string | boolean
|
|
110
|
+
rename(): this
|
|
111
|
+
/**
|
|
112
|
+
* Adds the animation controller to the current project and to the interface
|
|
113
|
+
* @param undo If true, the addition of the animation controller will be registered as an edit
|
|
114
|
+
*/
|
|
115
|
+
add(undo?: boolean): this
|
|
116
|
+
remove(undo?: boolean, remove_from_file?: boolean): this
|
|
117
|
+
propertiesDialog(): void
|
|
118
|
+
/**
|
|
119
|
+
* Updates the preview of the controller, including updating the animations and switching states if preview mode is set to play
|
|
120
|
+
*/
|
|
121
|
+
updatePreview(): void
|
|
122
|
+
togglePlayingState(state?: boolean): boolean
|
|
123
|
+
showContextMenu(event: Event | HTMLElement): void
|
|
118
124
|
}
|