blockbench-types 5.1.0 → 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/README.md +30 -30
- package/custom/animation.d.ts +257 -256
- package/custom/animation_controller.d.ts +124 -124
- package/custom/blockbench.d.ts +73 -73
- package/custom/canvas.d.ts +324 -307
- package/custom/codec.d.ts +182 -182
- package/custom/copy_paste.d.ts +43 -42
- package/custom/cube.d.ts +151 -151
- package/custom/desktop.d.ts +61 -73
- package/custom/display_mode.d.ts +141 -137
- package/custom/edit_session.d.ts +38 -37
- package/custom/global.d.ts +181 -168
- package/custom/group.d.ts +113 -113
- package/custom/interface.d.ts +88 -78
- package/custom/io.d.ts +12 -12
- package/custom/{toolbars.d.ts → keybind.d.ts} +150 -221
- package/custom/keyframe.d.ts +94 -94
- package/custom/libs.d.ts +13 -13
- package/custom/menu_bar.d.ts +66 -0
- package/custom/mesh.d.ts +196 -196
- package/custom/misc.d.ts +196 -199
- package/custom/molang.d.ts +159 -159
- package/custom/outliner.d.ts +158 -158
- package/custom/painter.d.ts +102 -69
- package/custom/preview_scene.d.ts +120 -120
- package/custom/screencam.d.ts +71 -71
- package/custom/spline_mesh.d.ts +190 -189
- package/custom/texture_group.d.ts +68 -68
- package/custom/textures.d.ts +526 -515
- package/custom/timeline.d.ts +66 -66
- package/custom/undo.d.ts +209 -208
- package/custom/util/version_util.d.ts +32 -32
- package/custom/util.d.ts +235 -235
- package/custom/uveditor.d.ts +3 -3
- package/custom/validator.d.ts +99 -99
- package/documentation.md +12 -12
- package/generated/animations/mirror_animating.d.ts +7 -0
- package/generated/animations/timeline_animators.d.ts +1 -1
- package/generated/api.d.ts +8 -1
- package/generated/file_system.d.ts +2 -1
- package/generated/find_replace.d.ts +6 -0
- package/generated/formats/standards/obj.d.ts +9 -11
- package/generated/interface/actions.d.ts +16 -12
- package/generated/interface/form.d.ts +2 -1
- 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/resize_lines.d.ts +2 -0
- package/generated/interface/settings.d.ts +6 -2
- package/generated/interface/shared_actions.d.ts +5 -0
- package/generated/interface/start_screen.d.ts +62 -42
- package/generated/interface/toolbars.d.ts +146 -46
- package/generated/io/format.d.ts +1 -0
- package/generated/io/project.d.ts +10 -2
- package/generated/lib/CanvasFrame.d.ts +1 -0
- package/generated/main.d.ts +4 -1
- package/generated/modeling/mesh/add_mesh.d.ts +6 -0
- package/generated/modeling/mesh/proportional_edit.d.ts +15 -13
- package/generated/modeling/mesh/util.d.ts +8 -2
- package/generated/modeling/mirror_modeling.d.ts +4 -0
- package/generated/modeling/weight_paint.d.ts +11 -0
- 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/texturing/layers.d.ts +140 -0
- package/generated/util/gif.d.ts +12 -3
- package/generated/util/state_memory.d.ts +3 -11
- package/index.d.ts +2 -2
- package/package.json +39 -39
- package/tsconfig.json +19 -19
- package/type_config.json +43 -46
- package/custom/menu.d.ts +0 -136
- package/custom/preview.d.ts +0 -137
- package/custom/start_screen.d.ts +0 -15
- package/custom/texture_layers.d.ts +0 -117
- package/generated/global_types.d.ts +0 -47
- package/generated/io/formats/bedrock.d.ts +0 -4
- package/generated/io/formats/bedrock_old.d.ts +0 -4
- package/generated/io/formats/collada.d.ts +0 -4
- package/generated/io/formats/fbx.d.ts +0 -17
- package/generated/io/formats/gltf.d.ts +0 -6
- package/generated/io/formats/java_block.d.ts +0 -4
- package/generated/io/formats/modded_entity.d.ts +0 -139
- package/generated/io/formats/obj.d.ts +0 -12
- package/generated/io/formats/optifine_jem.d.ts +0 -3
- package/generated/io/formats/optifine_jpm.d.ts +0 -3
- package/generated/io/formats/skin.d.ts +0 -22
package/custom/timeline.d.ts
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
/// <reference types="./blockbench"/>
|
|
2
|
-
declare namespace Timeline {
|
|
3
|
-
const animators: GeneralAnimator[]
|
|
4
|
-
const selected: _Keyframe[]
|
|
5
|
-
const playing_sounds: any[]
|
|
6
|
-
let playback_speed: number
|
|
7
|
-
/**
|
|
8
|
-
* Current time
|
|
9
|
-
*/
|
|
10
|
-
let time: number
|
|
11
|
-
let playing: boolean
|
|
12
|
-
let vue: Vue
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Set the timeline to a specific time
|
|
16
|
-
* @param time Time in seconds
|
|
17
|
-
* @param editing If true, don't update the timeline timecode, because it is currently edited by the user
|
|
18
|
-
*/
|
|
19
|
-
function setTime(time: number, editing?: boolean): void
|
|
20
|
-
/**
|
|
21
|
-
* Reveal the specified time in the timeline by scrolling to it's position
|
|
22
|
-
* @param time Time in seconds
|
|
23
|
-
*/
|
|
24
|
-
function revealTime(time: number): void
|
|
25
|
-
/**
|
|
26
|
-
* Set the time code above the timeline to a specific time
|
|
27
|
-
* @param time Time in seconds
|
|
28
|
-
*/
|
|
29
|
-
function setTimecode(time: number): void
|
|
30
|
-
/**
|
|
31
|
-
* Converts the input time to a time that is snapped to the current timeline snapping setting
|
|
32
|
-
* @param time Input time in seconds
|
|
33
|
-
* @param animation Animation to use the snapping setting from. If unspecified, uses the selected animation
|
|
34
|
-
*/
|
|
35
|
-
function snapTime(time: number, animation?: _Animation): number
|
|
36
|
-
/**
|
|
37
|
-
* Returns the time between two snapping points
|
|
38
|
-
*/
|
|
39
|
-
function getStep(): number
|
|
40
|
-
/**
|
|
41
|
-
* Return the maximum length of the timeline, based on the length of the selected animation and the time of all keyframes
|
|
42
|
-
*/
|
|
43
|
-
function getMaxLength(): number
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Unselect the selected keyframes
|
|
47
|
-
*/
|
|
48
|
-
function unselect(): void
|
|
49
|
-
/**
|
|
50
|
-
* Start playing the animation
|
|
51
|
-
*/
|
|
52
|
-
function start(): void
|
|
53
|
-
/**
|
|
54
|
-
* Run one frame of the animation
|
|
55
|
-
*/
|
|
56
|
-
function loop(): void
|
|
57
|
-
/**
|
|
58
|
-
* Pause playing the animation
|
|
59
|
-
*/
|
|
60
|
-
function pause(): void
|
|
61
|
-
|
|
62
|
-
let keyframes: _Keyframe[]
|
|
63
|
-
let menu: Menu
|
|
64
|
-
function showMenu(event: Event): void
|
|
65
|
-
let selected_animator: GeneralAnimator | null
|
|
66
|
-
}
|
|
1
|
+
/// <reference types="./blockbench"/>
|
|
2
|
+
declare namespace Timeline {
|
|
3
|
+
const animators: GeneralAnimator[]
|
|
4
|
+
const selected: _Keyframe[]
|
|
5
|
+
const playing_sounds: any[]
|
|
6
|
+
let playback_speed: number
|
|
7
|
+
/**
|
|
8
|
+
* Current time
|
|
9
|
+
*/
|
|
10
|
+
let time: number
|
|
11
|
+
let playing: boolean
|
|
12
|
+
let vue: Vue
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Set the timeline to a specific time
|
|
16
|
+
* @param time Time in seconds
|
|
17
|
+
* @param editing If true, don't update the timeline timecode, because it is currently edited by the user
|
|
18
|
+
*/
|
|
19
|
+
function setTime(time: number, editing?: boolean): void
|
|
20
|
+
/**
|
|
21
|
+
* Reveal the specified time in the timeline by scrolling to it's position
|
|
22
|
+
* @param time Time in seconds
|
|
23
|
+
*/
|
|
24
|
+
function revealTime(time: number): void
|
|
25
|
+
/**
|
|
26
|
+
* Set the time code above the timeline to a specific time
|
|
27
|
+
* @param time Time in seconds
|
|
28
|
+
*/
|
|
29
|
+
function setTimecode(time: number): void
|
|
30
|
+
/**
|
|
31
|
+
* Converts the input time to a time that is snapped to the current timeline snapping setting
|
|
32
|
+
* @param time Input time in seconds
|
|
33
|
+
* @param animation Animation to use the snapping setting from. If unspecified, uses the selected animation
|
|
34
|
+
*/
|
|
35
|
+
function snapTime(time: number, animation?: _Animation): number
|
|
36
|
+
/**
|
|
37
|
+
* Returns the time between two snapping points
|
|
38
|
+
*/
|
|
39
|
+
function getStep(): number
|
|
40
|
+
/**
|
|
41
|
+
* Return the maximum length of the timeline, based on the length of the selected animation and the time of all keyframes
|
|
42
|
+
*/
|
|
43
|
+
function getMaxLength(): number
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Unselect the selected keyframes
|
|
47
|
+
*/
|
|
48
|
+
function unselect(): void
|
|
49
|
+
/**
|
|
50
|
+
* Start playing the animation
|
|
51
|
+
*/
|
|
52
|
+
function start(): void
|
|
53
|
+
/**
|
|
54
|
+
* Run one frame of the animation
|
|
55
|
+
*/
|
|
56
|
+
function loop(): void
|
|
57
|
+
/**
|
|
58
|
+
* Pause playing the animation
|
|
59
|
+
*/
|
|
60
|
+
function pause(): void
|
|
61
|
+
|
|
62
|
+
let keyframes: _Keyframe[]
|
|
63
|
+
let menu: Menu
|
|
64
|
+
function showMenu(event: Event): void
|
|
65
|
+
let selected_animator: GeneralAnimator | null
|
|
66
|
+
}
|
package/custom/undo.d.ts
CHANGED
|
@@ -1,208 +1,209 @@
|
|
|
1
|
-
/// <reference types="./blockbench"/>
|
|
2
|
-
interface UndoAspects {
|
|
3
|
-
selection?: boolean
|
|
4
|
-
elements?: OutlinerElement[]
|
|
5
|
-
/**
|
|
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
|
-
*/
|
|
8
|
-
outliner?: boolean
|
|
9
|
-
/**
|
|
10
|
-
* Save individual groups, but not their children or hierarchy position
|
|
11
|
-
*/
|
|
12
|
-
groups?: Group[]
|
|
13
|
-
/**
|
|
14
|
-
* Saves an individual group, but not it's children or hierarchy position
|
|
15
|
-
*/
|
|
16
|
-
group?: Group
|
|
17
|
-
collections?: Collection[]
|
|
18
|
-
/**
|
|
19
|
-
* Textures to save
|
|
20
|
-
*/
|
|
21
|
-
textures?: Texture[]
|
|
22
|
-
texture_order?: boolean
|
|
23
|
-
/**
|
|
24
|
-
* Save which texture is selected
|
|
25
|
-
*/
|
|
26
|
-
selected_texture?: boolean
|
|
27
|
-
/**
|
|
28
|
-
* Set to true to include the image content of the specified textures
|
|
29
|
-
*/
|
|
30
|
-
bitmap?: boolean
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
*
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
*
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
*
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
*
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
*
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
*
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
*
|
|
184
|
-
* @param
|
|
185
|
-
* @param
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
let
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
1
|
+
/// <reference types="./blockbench"/>
|
|
2
|
+
interface UndoAspects {
|
|
3
|
+
selection?: boolean
|
|
4
|
+
elements?: OutlinerElement[]
|
|
5
|
+
/**
|
|
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
|
+
*/
|
|
8
|
+
outliner?: boolean
|
|
9
|
+
/**
|
|
10
|
+
* Save individual groups, but not their children or hierarchy position
|
|
11
|
+
*/
|
|
12
|
+
groups?: Group[]
|
|
13
|
+
/**
|
|
14
|
+
* Saves an individual group, but not it's children or hierarchy position
|
|
15
|
+
*/
|
|
16
|
+
group?: Group
|
|
17
|
+
collections?: Collection[]
|
|
18
|
+
/**
|
|
19
|
+
* Textures to save
|
|
20
|
+
*/
|
|
21
|
+
textures?: Texture[]
|
|
22
|
+
texture_order?: boolean
|
|
23
|
+
/**
|
|
24
|
+
* Save which texture is selected
|
|
25
|
+
*/
|
|
26
|
+
selected_texture?: boolean
|
|
27
|
+
/**
|
|
28
|
+
* Set to true to include the image content of the specified textures
|
|
29
|
+
*/
|
|
30
|
+
bitmap?: boolean
|
|
31
|
+
layers?: TextureLayer[]
|
|
32
|
+
settings?: {}
|
|
33
|
+
uv_mode?: boolean
|
|
34
|
+
animations?: _Animation[]
|
|
35
|
+
animation_controllers?: AnimationController[]
|
|
36
|
+
keyframes?: _Keyframe[]
|
|
37
|
+
display_slots?: string[]
|
|
38
|
+
exploded_view?: boolean
|
|
39
|
+
mirror_modeling?: false
|
|
40
|
+
uv_only?: boolean
|
|
41
|
+
}
|
|
42
|
+
interface UndoSelectionAspects {
|
|
43
|
+
texture_selection?: boolean
|
|
44
|
+
collections?: boolean
|
|
45
|
+
timeline?: boolean
|
|
46
|
+
}
|
|
47
|
+
type UndoSave = {
|
|
48
|
+
aspects: UndoAspects
|
|
49
|
+
selection?: []
|
|
50
|
+
selection_group?: UUID
|
|
51
|
+
elements?: {}
|
|
52
|
+
outliner?: []
|
|
53
|
+
group?: {}
|
|
54
|
+
groups?: {}[]
|
|
55
|
+
collections?: {}[]
|
|
56
|
+
textures?: {}
|
|
57
|
+
texture_order?: UUID[]
|
|
58
|
+
selected_texture?: UUID | null
|
|
59
|
+
settings?: {}
|
|
60
|
+
uv_mode?: {
|
|
61
|
+
box_uv: boolean
|
|
62
|
+
width: number
|
|
63
|
+
height: number
|
|
64
|
+
}
|
|
65
|
+
animations?: {}
|
|
66
|
+
keyframes?: {}
|
|
67
|
+
display_slots?: {}
|
|
68
|
+
exploded_views?: boolean
|
|
69
|
+
/**
|
|
70
|
+
* Load the undo save
|
|
71
|
+
*/
|
|
72
|
+
load(reference: UndoSave, mode?: 'session'): void
|
|
73
|
+
/**
|
|
74
|
+
* Add a texture to an undo edit during the edit
|
|
75
|
+
*/
|
|
76
|
+
addTexture(texture: Texture): void
|
|
77
|
+
/**
|
|
78
|
+
* Add a texture to an undo edit during the edit
|
|
79
|
+
*/
|
|
80
|
+
addTextureOrLayer(texture: Texture): void
|
|
81
|
+
/**
|
|
82
|
+
* Add elements to an undo edit during the edit
|
|
83
|
+
*/
|
|
84
|
+
addElements(elements: OutlinerElement[], aspects?: UndoAspects): void
|
|
85
|
+
}
|
|
86
|
+
type UndoSelectionSave = {
|
|
87
|
+
aspects: UndoSelectionAspects
|
|
88
|
+
elements: string[]
|
|
89
|
+
groups: string[]
|
|
90
|
+
geometry: {
|
|
91
|
+
[uuid: string]: {
|
|
92
|
+
faces: string[]
|
|
93
|
+
edges: string[]
|
|
94
|
+
vertices: string[]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
mode: string
|
|
98
|
+
mesh_selection_mode: string
|
|
99
|
+
texture: string
|
|
100
|
+
texture_selection?: Int8Array | boolean
|
|
101
|
+
animation_item?: string
|
|
102
|
+
timeline?: {}
|
|
103
|
+
graph_editor_channel?: string
|
|
104
|
+
graph_editor_axis?: string
|
|
105
|
+
graph_editor_open?: boolean
|
|
106
|
+
/**
|
|
107
|
+
* Load the selection save
|
|
108
|
+
*/
|
|
109
|
+
load(): void
|
|
110
|
+
/**
|
|
111
|
+
* Test whether the selection save matches another selection
|
|
112
|
+
* @param other Selection save to test against
|
|
113
|
+
*/
|
|
114
|
+
matches(other: UndoSelectionSave): boolean
|
|
115
|
+
}
|
|
116
|
+
type UndoEntry = {
|
|
117
|
+
before?: UndoSave
|
|
118
|
+
post?: UndoSave
|
|
119
|
+
selection_before?: UndoSelectionSave
|
|
120
|
+
selection_post?: UndoSelectionSave
|
|
121
|
+
action: string
|
|
122
|
+
type: 'original' | 'edit' | 'selection'
|
|
123
|
+
time: number
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
declare class UndoSystem {
|
|
127
|
+
constructor()
|
|
128
|
+
/**
|
|
129
|
+
* Starts an edit to the current project by saving the state of the provided aspects
|
|
130
|
+
* @param aspects Aspects to save
|
|
131
|
+
*/
|
|
132
|
+
initEdit(aspects: UndoAspects, amended: boolean = false): UndoEntry
|
|
133
|
+
/**
|
|
134
|
+
* Finishes an edit by saving the state of the project after it was changed
|
|
135
|
+
* @param action Description of the edit
|
|
136
|
+
*/
|
|
137
|
+
finishEdit(action: string, aspects?: UndoAspects): UndoEntry
|
|
138
|
+
/**
|
|
139
|
+
* Cancels an event before it was finished and reset the project to the state before
|
|
140
|
+
*/
|
|
141
|
+
cancelEdit(revert_changes?: boolean = false): void
|
|
142
|
+
/**
|
|
143
|
+
* Add keyframes to the current edit that were indirectly removed by moving other keyframes to their position
|
|
144
|
+
* @param keyframes
|
|
145
|
+
*/
|
|
146
|
+
addKeyframeCasualties(keyframes: _Keyframe[]): void
|
|
147
|
+
/**
|
|
148
|
+
* Undoes the latest edit
|
|
149
|
+
*/
|
|
150
|
+
/**
|
|
151
|
+
* Starts a selection change in the current project
|
|
152
|
+
* @param aspects Aspects to save
|
|
153
|
+
*/
|
|
154
|
+
initSelection(aspects?: UndoSelectionAspects): UndoEntry
|
|
155
|
+
/**
|
|
156
|
+
* Finishes a selection change in the current project
|
|
157
|
+
* @param action Description of the edit
|
|
158
|
+
*/
|
|
159
|
+
finishSelection(action: string, aspects?: UndoSelectionAspects): UndoEntry
|
|
160
|
+
/**
|
|
161
|
+
* Cancel the selection changes
|
|
162
|
+
* @param revert_changes If true, the already tracked selection changes will be reverted to the state before initSelection
|
|
163
|
+
*/
|
|
164
|
+
cancelSelection(revert_changes?: boolean): void
|
|
165
|
+
/**
|
|
166
|
+
* Cancels an event before it was finished and reset the project to the state before
|
|
167
|
+
*/
|
|
168
|
+
undo(remote?: boolean): void
|
|
169
|
+
/**
|
|
170
|
+
* Redoes the latest edit
|
|
171
|
+
*/
|
|
172
|
+
redo(remote?: boolean): void
|
|
173
|
+
/**
|
|
174
|
+
* Provides a menu to amend the latest edit with slightly changed values
|
|
175
|
+
*/
|
|
176
|
+
amendEdit(form: InputFormConfig, callback: (values: any, form: any) => void): void
|
|
177
|
+
/**
|
|
178
|
+
* Closes the amend edit menu
|
|
179
|
+
*/
|
|
180
|
+
closeAmendEditMenu(): void
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Loads a specific undo save
|
|
184
|
+
* @param save The undo save to load
|
|
185
|
+
* @param reference The current undo save for reference
|
|
186
|
+
* @param mode The load save modes
|
|
187
|
+
*/
|
|
188
|
+
loadSave(save: UndoSave, reference: UndoSave, mode?: 'session'): void
|
|
189
|
+
|
|
190
|
+
history: UndoEntry[]
|
|
191
|
+
index: number
|
|
192
|
+
current_save?: UndoSave
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Blockbench's undo system of the current project to register edits to the project and switch between them
|
|
197
|
+
|
|
198
|
+
## Example
|
|
199
|
+
|
|
200
|
+
```javascript
|
|
201
|
+
Undo.initEdit({elements: []});
|
|
202
|
+
|
|
203
|
+
let new_cube = new Cube({name: 'kevin'}).init();
|
|
204
|
+
let other_cube = new Cube({name: 'lars'}).init();
|
|
205
|
+
|
|
206
|
+
Undo.finishEdit('Add new cubes', {elements: [new_cube, other_cube]});
|
|
207
|
+
```
|
|
208
|
+
*/
|
|
209
|
+
declare let Undo: UndoSystem
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
interface ParsedVersion {
|
|
2
|
-
string: string
|
|
3
|
-
version: number[]
|
|
4
|
-
beta?: number[]
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
type Operator = '<=' | '==' | '>=' | '>' | '<'
|
|
8
|
-
|
|
9
|
-
declare namespace VersionUtil {
|
|
10
|
-
function parse(versionString: string): ParsedVersion
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Compare two version strings.
|
|
14
|
-
* @returns 0 if equal, -1 if versionA < versionB, 1 if versionA > versionB
|
|
15
|
-
*/
|
|
16
|
-
function compare(versionA: string, versionB: string): number
|
|
17
|
-
/**
|
|
18
|
-
* Compare two version strings with an operator.
|
|
19
|
-
* @returns true if the comparison is true, false otherwise
|
|
20
|
-
*/
|
|
21
|
-
function compare(versionA: string, operator: Operator, versionB: string): boolean
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Format a version string for display.
|
|
25
|
-
* E.g. "4.8.0-beta.3" becomes "4.8.0 Beta 3"
|
|
26
|
-
*/
|
|
27
|
-
function format(version: string): string
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
declare interface Window {
|
|
31
|
-
VersionUtil: typeof VersionUtil
|
|
32
|
-
}
|
|
1
|
+
interface ParsedVersion {
|
|
2
|
+
string: string
|
|
3
|
+
version: number[]
|
|
4
|
+
beta?: number[]
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
type Operator = '<=' | '==' | '>=' | '>' | '<'
|
|
8
|
+
|
|
9
|
+
declare namespace VersionUtil {
|
|
10
|
+
function parse(versionString: string): ParsedVersion
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Compare two version strings.
|
|
14
|
+
* @returns 0 if equal, -1 if versionA < versionB, 1 if versionA > versionB
|
|
15
|
+
*/
|
|
16
|
+
function compare(versionA: string, versionB: string): number
|
|
17
|
+
/**
|
|
18
|
+
* Compare two version strings with an operator.
|
|
19
|
+
* @returns true if the comparison is true, false otherwise
|
|
20
|
+
*/
|
|
21
|
+
function compare(versionA: string, operator: Operator, versionB: string): boolean
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Format a version string for display.
|
|
25
|
+
* E.g. "4.8.0-beta.3" becomes "4.8.0 Beta 3"
|
|
26
|
+
*/
|
|
27
|
+
function format(version: string): string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
declare interface Window {
|
|
31
|
+
VersionUtil: typeof VersionUtil
|
|
32
|
+
}
|