blockbench-types 5.1.0 → 5.2.0-beta.0-next.1

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.
Files changed (72) hide show
  1. package/README.md +30 -30
  2. package/custom/animation.d.ts +256 -256
  3. package/custom/animation_controller.d.ts +124 -124
  4. package/custom/blockbench.d.ts +71 -73
  5. package/custom/canvas.d.ts +307 -307
  6. package/custom/codec.d.ts +182 -182
  7. package/custom/copy_paste.d.ts +43 -42
  8. package/custom/cube.d.ts +151 -151
  9. package/custom/desktop.d.ts +61 -73
  10. package/custom/display_mode.d.ts +137 -137
  11. package/custom/edit_session.d.ts +38 -37
  12. package/custom/global.d.ts +182 -168
  13. package/custom/group.d.ts +113 -113
  14. package/custom/interface.d.ts +83 -78
  15. package/custom/io.d.ts +12 -12
  16. package/custom/keyframe.d.ts +94 -94
  17. package/custom/libs.d.ts +13 -13
  18. package/custom/menu.d.ts +137 -136
  19. package/custom/mesh.d.ts +196 -196
  20. package/custom/misc.d.ts +188 -199
  21. package/custom/molang.d.ts +159 -159
  22. package/custom/outliner.d.ts +158 -158
  23. package/custom/painter.d.ts +70 -69
  24. package/custom/preview.d.ts +147 -137
  25. package/custom/preview_scene.d.ts +120 -120
  26. package/custom/screencam.d.ts +71 -71
  27. package/custom/spline_mesh.d.ts +189 -189
  28. package/custom/texture_group.d.ts +68 -68
  29. package/custom/textures.d.ts +524 -515
  30. package/custom/timeline.d.ts +66 -66
  31. package/custom/toolbars.d.ts +222 -221
  32. package/custom/undo.d.ts +209 -208
  33. package/custom/util/version_util.d.ts +32 -32
  34. package/custom/util.d.ts +235 -235
  35. package/custom/uveditor.d.ts +3 -3
  36. package/custom/validator.d.ts +99 -99
  37. package/documentation.md +12 -12
  38. package/generated/animations/mirror_animating.d.ts +7 -0
  39. package/generated/api.d.ts +6 -0
  40. package/generated/file_system.d.ts +1 -1
  41. package/generated/formats/standards/obj.d.ts +9 -11
  42. package/generated/interface/actions.d.ts +6 -3
  43. package/generated/interface/form.d.ts +2 -1
  44. package/generated/interface/resize_lines.d.ts +2 -0
  45. package/generated/interface/settings.d.ts +6 -2
  46. package/generated/interface/start_screen.d.ts +62 -42
  47. package/generated/io/project.d.ts +9 -1
  48. package/generated/lib/CanvasFrame.d.ts +1 -0
  49. package/generated/main.d.ts +1 -1
  50. package/generated/modeling/mesh/proportional_edit.d.ts +15 -13
  51. package/generated/modeling/mirror_modeling.d.ts +4 -0
  52. package/generated/modeling/weight_paint.d.ts +11 -0
  53. package/generated/texturing/layers.d.ts +140 -0
  54. package/generated/util/state_memory.d.ts +1 -1
  55. package/index.d.ts +2 -2
  56. package/package.json +39 -39
  57. package/tsconfig.json +19 -19
  58. package/type_config.json +45 -46
  59. package/custom/start_screen.d.ts +0 -15
  60. package/custom/texture_layers.d.ts +0 -117
  61. package/generated/global_types.d.ts +0 -47
  62. package/generated/io/formats/bedrock.d.ts +0 -4
  63. package/generated/io/formats/bedrock_old.d.ts +0 -4
  64. package/generated/io/formats/collada.d.ts +0 -4
  65. package/generated/io/formats/fbx.d.ts +0 -17
  66. package/generated/io/formats/gltf.d.ts +0 -6
  67. package/generated/io/formats/java_block.d.ts +0 -4
  68. package/generated/io/formats/modded_entity.d.ts +0 -139
  69. package/generated/io/formats/obj.d.ts +0 -12
  70. package/generated/io/formats/optifine_jem.d.ts +0 -3
  71. package/generated/io/formats/optifine_jpm.d.ts +0 -3
  72. package/generated/io/formats/skin.d.ts +0 -22
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
- settings?: {}
32
- uv_mode?: boolean
33
- animations?: _Animation[]
34
- animation_controllers?: AnimationController[]
35
- keyframes?: _Keyframe[]
36
- display_slots?: string[]
37
- exploded_view?: boolean
38
- mirror_modeling?: false
39
- uv_only?: boolean
40
- }
41
- interface UndoSelectionAspects {
42
- texture_selection?: boolean
43
- collections?: boolean
44
- timeline?: boolean
45
- }
46
- type UndoSave = {
47
- aspects: UndoAspects
48
- selection?: []
49
- selection_group?: UUID
50
- elements?: {}
51
- outliner?: []
52
- group?: {}
53
- groups?: {}[]
54
- collections?: {}[]
55
- textures?: {}
56
- texture_order?: UUID[]
57
- selected_texture?: UUID | null
58
- settings?: {}
59
- uv_mode?: {
60
- box_uv: boolean
61
- width: number
62
- height: number
63
- }
64
- animations?: {}
65
- keyframes?: {}
66
- display_slots?: {}
67
- exploded_views?: boolean
68
- /**
69
- * Load the undo save
70
- */
71
- load(reference: UndoSave, mode?: 'session'): void
72
- /**
73
- * Add a texture to an undo edit during the edit
74
- */
75
- addTexture(texture: Texture): void
76
- /**
77
- * Add a texture to an undo edit during the edit
78
- */
79
- addTextureOrLayer(texture: Texture): void
80
- /**
81
- * Add elements to an undo edit during the edit
82
- */
83
- addElements(elements: OutlinerElement[], aspects?: UndoAspects): void
84
- }
85
- type UndoSelectionSave = {
86
- aspects: UndoSelectionAspects
87
- elements: string[]
88
- groups: string[]
89
- geometry: {
90
- [uuid: string]: {
91
- faces: string[]
92
- edges: string[]
93
- vertices: string[]
94
- }
95
- }
96
- mode: string
97
- mesh_selection_mode: string
98
- texture: string
99
- texture_selection?: Int8Array | boolean
100
- animation_item?: string
101
- timeline?: {}
102
- graph_editor_channel?: string
103
- graph_editor_axis?: string
104
- graph_editor_open?: boolean
105
- /**
106
- * Load the selection save
107
- */
108
- load(): void
109
- /**
110
- * Test whether the selection save matches another selection
111
- * @param other Selection save to test against
112
- */
113
- matches(other: UndoSelectionSave): boolean
114
- }
115
- type UndoEntry = {
116
- before?: UndoSave
117
- post?: UndoSave
118
- selection_before?: UndoSelectionSave
119
- selection_post?: UndoSelectionSave
120
- action: string
121
- type: 'original' | 'edit' | 'selection'
122
- time: number
123
- }
124
-
125
- declare class UndoSystem {
126
- constructor()
127
- /**
128
- * Starts an edit to the current project by saving the state of the provided aspects
129
- * @param aspects Aspects to save
130
- */
131
- initEdit(aspects: UndoAspects, amended: boolean = false): UndoEntry
132
- /**
133
- * Finishes an edit by saving the state of the project after it was changed
134
- * @param action Description of the edit
135
- */
136
- finishEdit(action: string, aspects?: UndoAspects): UndoEntry
137
- /**
138
- * Cancels an event before it was finished and reset the project to the state before
139
- */
140
- cancelEdit(revert_changes?: boolean = false): void
141
- /**
142
- * Add keyframes to the current edit that were indirectly removed by moving other keyframes to their position
143
- * @param keyframes
144
- */
145
- addKeyframeCasualties(keyframes: _Keyframe[]): void
146
- /**
147
- * Undoes the latest edit
148
- */
149
- /**
150
- * Starts a selection change in the current project
151
- * @param aspects Aspects to save
152
- */
153
- initSelection(aspects?: UndoSelectionAspects): UndoEntry
154
- /**
155
- * Finishes a selection change in the current project
156
- * @param action Description of the edit
157
- */
158
- finishSelection(action: string, aspects?: UndoSelectionAspects): UndoEntry
159
- /**
160
- * Cancel the selection changes
161
- * @param revert_changes If true, the already tracked selection changes will be reverted to the state before initSelection
162
- */
163
- cancelSelection(revert_changes?: boolean): void
164
- /**
165
- * Cancels an event before it was finished and reset the project to the state before
166
- */
167
- undo(remote?: boolean): void
168
- /**
169
- * Redoes the latest edit
170
- */
171
- redo(remote?: boolean): void
172
- /**
173
- * Provides a menu to amend the latest edit with slightly changed values
174
- */
175
- amendEdit(form: InputFormConfig, callback: (values: any, form: any) => void): void
176
- /**
177
- * Closes the amend edit menu
178
- */
179
- closeAmendEditMenu(): void
180
-
181
- /**
182
- * Loads a specific undo save
183
- * @param save The undo save to load
184
- * @param reference The current undo save for reference
185
- * @param mode The load save modes
186
- */
187
- loadSave(save: UndoSave, reference: UndoSave, mode?: 'session'): void
188
-
189
- history: UndoEntry[]
190
- index: number
191
- current_save?: UndoSave
192
- }
193
-
194
- /**
195
- * Blockbench's undo system of the current project to register edits to the project and switch between them
196
-
197
- ## Example
198
-
199
- ```javascript
200
- Undo.initEdit({elements: []});
201
-
202
- let new_cube = new Cube({name: 'kevin'}).init();
203
- let other_cube = new Cube({name: 'lars'}).init();
204
-
205
- Undo.finishEdit('Add new cubes', {elements: [new_cube, other_cube]});
206
- ```
207
- */
208
- declare let Undo: UndoSystem
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
+ }