blockbench-types 5.1.0-beta.3-next.2 → 5.1.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.
Files changed (55) 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 +73 -73
  5. package/custom/canvas.d.ts +307 -307
  6. package/custom/codec.d.ts +182 -182
  7. package/custom/copy_paste.d.ts +42 -42
  8. package/custom/cube.d.ts +151 -151
  9. package/custom/desktop.d.ts +73 -73
  10. package/custom/display_mode.d.ts +137 -137
  11. package/custom/edit_session.d.ts +37 -37
  12. package/custom/global.d.ts +168 -168
  13. package/custom/group.d.ts +113 -113
  14. package/custom/interface.d.ts +78 -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 +136 -136
  19. package/custom/mesh.d.ts +196 -196
  20. package/custom/misc.d.ts +199 -199
  21. package/custom/molang.d.ts +159 -159
  22. package/custom/outliner.d.ts +158 -158
  23. package/custom/painter.d.ts +69 -69
  24. package/custom/preview.d.ts +137 -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/start_screen.d.ts +14 -14
  29. package/custom/texture_group.d.ts +68 -68
  30. package/custom/texture_layers.d.ts +117 -117
  31. package/custom/textures.d.ts +515 -515
  32. package/custom/timeline.d.ts +66 -66
  33. package/custom/toolbars.d.ts +221 -221
  34. package/custom/undo.d.ts +208 -208
  35. package/custom/util/version_util.d.ts +32 -32
  36. package/custom/util.d.ts +235 -235
  37. package/custom/uveditor.d.ts +3 -3
  38. package/custom/validator.d.ts +99 -99
  39. package/documentation.md +12 -12
  40. package/generated/global_types.d.ts +47 -0
  41. package/generated/io/formats/bedrock.d.ts +4 -0
  42. package/generated/io/formats/bedrock_old.d.ts +4 -0
  43. package/generated/io/formats/collada.d.ts +4 -0
  44. package/generated/io/formats/fbx.d.ts +17 -0
  45. package/generated/io/formats/gltf.d.ts +6 -0
  46. package/generated/io/formats/java_block.d.ts +4 -0
  47. package/generated/io/formats/modded_entity.d.ts +139 -0
  48. package/generated/io/formats/obj.d.ts +12 -0
  49. package/generated/io/formats/optifine_jem.d.ts +3 -0
  50. package/generated/io/formats/optifine_jpm.d.ts +3 -0
  51. package/generated/io/formats/skin.d.ts +22 -0
  52. package/index.d.ts +2 -2
  53. package/package.json +39 -39
  54. package/tsconfig.json +19 -19
  55. package/type_config.json +46 -46
package/custom/undo.d.ts CHANGED
@@ -1,208 +1,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
- 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
+ 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,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
+ }