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.
Files changed (102) hide show
  1. package/README.md +30 -30
  2. package/custom/animation.d.ts +257 -256
  3. package/custom/animation_controller.d.ts +124 -124
  4. package/custom/blockbench.d.ts +73 -73
  5. package/custom/canvas.d.ts +324 -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 +141 -137
  11. package/custom/edit_session.d.ts +38 -37
  12. package/custom/global.d.ts +181 -168
  13. package/custom/group.d.ts +113 -113
  14. package/custom/interface.d.ts +88 -78
  15. package/custom/io.d.ts +12 -12
  16. package/custom/{toolbars.d.ts → keybind.d.ts} +150 -221
  17. package/custom/keyframe.d.ts +94 -94
  18. package/custom/libs.d.ts +13 -13
  19. package/custom/menu_bar.d.ts +66 -0
  20. package/custom/mesh.d.ts +196 -196
  21. package/custom/misc.d.ts +196 -199
  22. package/custom/molang.d.ts +159 -159
  23. package/custom/outliner.d.ts +158 -158
  24. package/custom/painter.d.ts +102 -69
  25. package/custom/preview_scene.d.ts +120 -120
  26. package/custom/screencam.d.ts +71 -71
  27. package/custom/spline_mesh.d.ts +190 -189
  28. package/custom/texture_group.d.ts +68 -68
  29. package/custom/textures.d.ts +526 -515
  30. package/custom/timeline.d.ts +66 -66
  31. package/custom/undo.d.ts +209 -208
  32. package/custom/util/version_util.d.ts +32 -32
  33. package/custom/util.d.ts +235 -235
  34. package/custom/uveditor.d.ts +3 -3
  35. package/custom/validator.d.ts +99 -99
  36. package/documentation.md +12 -12
  37. package/generated/animations/mirror_animating.d.ts +7 -0
  38. package/generated/animations/timeline_animators.d.ts +1 -1
  39. package/generated/api.d.ts +8 -1
  40. package/generated/file_system.d.ts +2 -1
  41. package/generated/find_replace.d.ts +6 -0
  42. package/generated/formats/standards/obj.d.ts +9 -11
  43. package/generated/interface/actions.d.ts +16 -12
  44. package/generated/interface/form.d.ts +2 -1
  45. package/generated/interface/main_tools.d.ts +23 -0
  46. package/generated/interface/menu.d.ts +141 -0
  47. package/generated/interface/menu_bar.d.ts +2 -3
  48. package/generated/interface/resize_lines.d.ts +2 -0
  49. package/generated/interface/settings.d.ts +6 -2
  50. package/generated/interface/shared_actions.d.ts +5 -0
  51. package/generated/interface/start_screen.d.ts +62 -42
  52. package/generated/interface/toolbars.d.ts +146 -46
  53. package/generated/io/format.d.ts +1 -0
  54. package/generated/io/project.d.ts +10 -2
  55. package/generated/lib/CanvasFrame.d.ts +1 -0
  56. package/generated/main.d.ts +4 -1
  57. package/generated/modeling/mesh/add_mesh.d.ts +6 -0
  58. package/generated/modeling/mesh/proportional_edit.d.ts +15 -13
  59. package/generated/modeling/mesh/util.d.ts +8 -2
  60. package/generated/modeling/mirror_modeling.d.ts +4 -0
  61. package/generated/modeling/weight_paint.d.ts +11 -0
  62. package/generated/modes.d.ts +2 -2
  63. package/generated/native_apis.d.ts +3 -0
  64. package/generated/outliner/abstract/outliner_element.d.ts +1 -0
  65. package/generated/outliner/abstract/outliner_node.d.ts +1 -0
  66. package/generated/outliner/types/armature.d.ts +1 -1
  67. package/generated/outliner/types/armature_bone.d.ts +1 -1
  68. package/generated/outliner/types/billboard.d.ts +1 -1
  69. package/generated/outliner/types/bounding_box.d.ts +1 -1
  70. package/generated/outliner/types/cube.d.ts +1 -1
  71. package/generated/outliner/types/group.d.ts +1 -1
  72. package/generated/outliner/types/locator.d.ts +1 -1
  73. package/generated/outliner/types/mesh.d.ts +1 -1
  74. package/generated/outliner/types/null_object.d.ts +1 -1
  75. package/generated/outliner/types/spline_mesh.d.ts +1 -2
  76. package/generated/outliner/types/texture_mesh.d.ts +1 -1
  77. package/generated/plugin_loader.d.ts +1 -1
  78. package/generated/preview/preview.d.ts +280 -0
  79. package/generated/preview/reference_images.d.ts +1 -1
  80. package/generated/texturing/layers.d.ts +140 -0
  81. package/generated/util/gif.d.ts +12 -3
  82. package/generated/util/state_memory.d.ts +3 -11
  83. package/index.d.ts +2 -2
  84. package/package.json +39 -39
  85. package/tsconfig.json +19 -19
  86. package/type_config.json +43 -46
  87. package/custom/menu.d.ts +0 -136
  88. package/custom/preview.d.ts +0 -137
  89. package/custom/start_screen.d.ts +0 -15
  90. package/custom/texture_layers.d.ts +0 -117
  91. package/generated/global_types.d.ts +0 -47
  92. package/generated/io/formats/bedrock.d.ts +0 -4
  93. package/generated/io/formats/bedrock_old.d.ts +0 -4
  94. package/generated/io/formats/collada.d.ts +0 -4
  95. package/generated/io/formats/fbx.d.ts +0 -17
  96. package/generated/io/formats/gltf.d.ts +0 -6
  97. package/generated/io/formats/java_block.d.ts +0 -4
  98. package/generated/io/formats/modded_entity.d.ts +0 -139
  99. package/generated/io/formats/obj.d.ts +0 -12
  100. package/generated/io/formats/optifine_jem.d.ts +0 -3
  101. package/generated/io/formats/optifine_jpm.d.ts +0 -3
  102. package/generated/io/formats/skin.d.ts +0 -22
package/custom/codec.d.ts CHANGED
@@ -1,182 +1,182 @@
1
- /// <reference types="./blockbench"/>
2
-
3
- interface LoadOptions {
4
- import_to_current_project?: boolean
5
- externalDataLoader?: (path: string) => any
6
- [key: string]: unknown
7
- }
8
- interface CodecOptions {
9
- name: string
10
- load?(model: any, file: FileResult, args?: LoadOptions): void
11
- compile?(options?: any): string | ArrayBuffer | any
12
- parse?(data: any, path: string, args?: LoadOptions): void
13
- export?(): void
14
- /**
15
- * Generate a file name to suggest when exporting
16
- */
17
- fileName?(): string
18
- startPath?(): string
19
- write?(content: any, path: string): void
20
- overwrite?(content: any, path: string, callback: (path: any) => void): void
21
- afterDownload?(path: any): void
22
- afterSave?(path: any): void
23
- exportCollection?(collection: Collection): void
24
- writeCollection?(collection: Collection): void
25
-
26
- dispatchEvent?(event_name: string, data: any): void
27
-
28
- extension?: string
29
- /**
30
- * Whether to remember the models exported using this codec
31
- */
32
- remember?: boolean
33
- /**
34
- * Whether the codec can be used to export a part of the model via a collection
35
- */
36
- support_partial_export?: boolean
37
- support_offset?: boolean
38
- load_filter?: {
39
- extensions: string[]
40
- type: 'json' | 'text'
41
- condition?: ConditionResolvable
42
- }
43
- /**
44
- * List of export option inputs, based on the Dialog form API
45
- */
46
- export_options?: {
47
- [key: string]: FormElementOptions
48
- }
49
- /**
50
- * Default action that is used to export to the codec
51
- */
52
- export_action?: Action
53
- }
54
-
55
- /**
56
- * A codec represents a specific file format that can be imported into and exported from Blockbench. The codec handles the compilation and parsing, as well as the loading and exporting logic
57
- */
58
- declare class Codec extends Deletable {
59
- plugin?: string
60
- /**
61
- * Creates a new codec
62
- * @param id Codec ID
63
- * @param options Codec options
64
- */
65
- constructor(id: string, options: CodecOptions)
66
-
67
- /**
68
- * Load a file into the program
69
- * @param model
70
- * @param file
71
- * @param args Load options
72
- */
73
- load(model: any, file?: FileSystem.FileResult, args?: LoadOptions): void
74
- /**
75
- * Compiles the file content
76
- * @param options
77
- */
78
- compile(options?: any): any
79
- /**
80
- * Takes the content of a file, and loads the model into the current Blockbench project
81
- * @param data File content
82
- * @param path File path
83
- */
84
- parse?(data: any, path: string, args?: LoadOptions): void
85
- /**
86
- * Opens the file browser to export a file of this type
87
- */
88
- export(): void
89
- /**
90
- * Generate a file name to suggest when exporting
91
- */
92
- fileName(): string
93
- /**
94
- * Generates the suggested file path. This is the path that the explorer opens in when exporting this type
95
- */
96
- startPath(): string
97
- /**
98
- * Write the content of this file to the selected location. The default method can be overwritten to achieve custom behavior
99
- * @param content File content, as generated by compile()
100
- * @param path The file export path
101
- */
102
- write(content: any, path: string): void
103
- overwrite(content: any, path: string, callback: (path: string) => void): void
104
- afterDownload(path: string): void
105
- afterSave(path: string): void
106
- exportCollection(collection: Collection): void
107
- writeCollection(collection: Collection): void
108
-
109
- /**
110
- * Return the stored export option values of the current project
111
- */
112
- getExportOptions(): { [key: string]: any }
113
- /**
114
- * Prompt the user to enter their preferred export settings into the dialog
115
- */
116
- promptExportOptions(): Promise<{ [key: string]: any } | null>
117
-
118
- /**
119
- * Adds an event listener to the codec
120
- * @param event_name The event type to listen for
121
- * @param callback
122
- */
123
- on(event_name: string, callback: (data: any) => void): void
124
- /**
125
- * Adds a single-use event listener to the codec
126
- * @param event_name The event type to listen for
127
- * @param callback
128
- */
129
- once(event_name: string, callback: (data: any) => void): void
130
- /**
131
- * Removes an event listener from the codec
132
- * @param event_name
133
- * @param callback
134
- */
135
- removeListener(event_name: string, callback: (data: any) => void): void
136
- dispatchEvent(event_name: string, data: any): void
137
-
138
- /**
139
- * The display name of the codec
140
- */
141
- name: string
142
- /**
143
- * The default file extension that the codec uses
144
- */
145
- extension: string
146
- /**
147
- * Whether to remember files that use this codec in the recent models list
148
- */
149
- remember: boolean
150
- /**
151
- * Whether the codec can be used to export a part of the model via a collection
152
- */
153
- support_partial_export: boolean
154
- support_offset: boolean
155
- /**
156
- * If available, the action that is used to export files using this codec
157
- */
158
- export_action?: Action
159
-
160
- /**
161
- * List of export option inputs
162
- */
163
- export_options: {
164
- [key: string]: FormElement
165
- }
166
-
167
- /**
168
- * Additional properties
169
- */
170
- [key: string]: any
171
-
172
- format: ModelFormat
173
-
174
- /**
175
- * Get a list of all possible extensions of all codecs
176
- */
177
- static getAllExtensions(): string[]
178
- }
179
-
180
- declare const Codecs: {
181
- [id: string]: Codec
182
- }
1
+ /// <reference types="./blockbench"/>
2
+
3
+ interface LoadOptions {
4
+ import_to_current_project?: boolean
5
+ externalDataLoader?: (path: string) => any
6
+ [key: string]: unknown
7
+ }
8
+ interface CodecOptions {
9
+ name: string
10
+ load?(model: any, file: FileResult, args?: LoadOptions): void
11
+ compile?(options?: any): string | ArrayBuffer | any
12
+ parse?(data: any, path: string, args?: LoadOptions): void
13
+ export?(): void
14
+ /**
15
+ * Generate a file name to suggest when exporting
16
+ */
17
+ fileName?(): string
18
+ startPath?(): string
19
+ write?(content: any, path: string): void
20
+ overwrite?(content: any, path: string, callback: (path: any) => void): void
21
+ afterDownload?(path: any): void
22
+ afterSave?(path: any): void
23
+ exportCollection?(collection: Collection): void
24
+ writeCollection?(collection: Collection): void
25
+
26
+ dispatchEvent?(event_name: string, data: any): void
27
+
28
+ extension?: string
29
+ /**
30
+ * Whether to remember the models exported using this codec
31
+ */
32
+ remember?: boolean
33
+ /**
34
+ * Whether the codec can be used to export a part of the model via a collection
35
+ */
36
+ support_partial_export?: boolean
37
+ support_offset?: boolean
38
+ load_filter?: {
39
+ extensions: string[] | (() => string[])
40
+ type: 'json' | 'text' | 'image'
41
+ condition?: ConditionResolvable
42
+ }
43
+ /**
44
+ * List of export option inputs, based on the Dialog form API
45
+ */
46
+ export_options?: {
47
+ [key: string]: FormElementOptions
48
+ }
49
+ /**
50
+ * Default action that is used to export to the codec
51
+ */
52
+ export_action?: Action
53
+ }
54
+
55
+ /**
56
+ * A codec represents a specific file format that can be imported into and exported from Blockbench. The codec handles the compilation and parsing, as well as the loading and exporting logic
57
+ */
58
+ declare class Codec extends Deletable {
59
+ plugin?: string
60
+ /**
61
+ * Creates a new codec
62
+ * @param id Codec ID
63
+ * @param options Codec options
64
+ */
65
+ constructor(id: string, options: CodecOptions)
66
+
67
+ /**
68
+ * Load a file into the program
69
+ * @param model
70
+ * @param file
71
+ * @param args Load options
72
+ */
73
+ load(model: any, file?: FileSystem.FileResult, args?: LoadOptions): void
74
+ /**
75
+ * Compiles the file content
76
+ * @param options
77
+ */
78
+ compile(options?: any): any
79
+ /**
80
+ * Takes the content of a file, and loads the model into the current Blockbench project
81
+ * @param data File content
82
+ * @param path File path
83
+ */
84
+ parse?(data: any, path: string, args?: LoadOptions): void
85
+ /**
86
+ * Opens the file browser to export a file of this type
87
+ */
88
+ export(): void
89
+ /**
90
+ * Generate a file name to suggest when exporting
91
+ */
92
+ fileName(): string
93
+ /**
94
+ * Generates the suggested file path. This is the path that the explorer opens in when exporting this type
95
+ */
96
+ startPath(): string
97
+ /**
98
+ * Write the content of this file to the selected location. The default method can be overwritten to achieve custom behavior
99
+ * @param content File content, as generated by compile()
100
+ * @param path The file export path
101
+ */
102
+ write(content: any, path: string): void
103
+ overwrite(content: any, path: string, callback: (path: string) => void): void
104
+ afterDownload(path: string): void
105
+ afterSave(path: string): void
106
+ exportCollection(collection: Collection): void
107
+ writeCollection(collection: Collection): void
108
+
109
+ /**
110
+ * Return the stored export option values of the current project
111
+ */
112
+ getExportOptions(): { [key: string]: any }
113
+ /**
114
+ * Prompt the user to enter their preferred export settings into the dialog
115
+ */
116
+ promptExportOptions(): Promise<{ [key: string]: any } | null>
117
+
118
+ /**
119
+ * Adds an event listener to the codec
120
+ * @param event_name The event type to listen for
121
+ * @param callback
122
+ */
123
+ on(event_name: string, callback: (data: any) => void): void
124
+ /**
125
+ * Adds a single-use event listener to the codec
126
+ * @param event_name The event type to listen for
127
+ * @param callback
128
+ */
129
+ once(event_name: string, callback: (data: any) => void): void
130
+ /**
131
+ * Removes an event listener from the codec
132
+ * @param event_name
133
+ * @param callback
134
+ */
135
+ removeListener(event_name: string, callback: (data: any) => void): void
136
+ dispatchEvent(event_name: string, data: any): void
137
+
138
+ /**
139
+ * The display name of the codec
140
+ */
141
+ name: string
142
+ /**
143
+ * The default file extension that the codec uses
144
+ */
145
+ extension: string
146
+ /**
147
+ * Whether to remember files that use this codec in the recent models list
148
+ */
149
+ remember: boolean
150
+ /**
151
+ * Whether the codec can be used to export a part of the model via a collection
152
+ */
153
+ support_partial_export: boolean
154
+ support_offset: boolean
155
+ /**
156
+ * If available, the action that is used to export files using this codec
157
+ */
158
+ export_action?: Action
159
+
160
+ /**
161
+ * List of export option inputs
162
+ */
163
+ export_options: {
164
+ [key: string]: FormElement
165
+ }
166
+
167
+ /**
168
+ * Additional properties
169
+ */
170
+ [key: string]: any
171
+
172
+ format: ModelFormat
173
+
174
+ /**
175
+ * Get a list of all possible extensions of all codecs
176
+ */
177
+ static getAllExtensions(): string[]
178
+ }
179
+
180
+ declare const Codecs: {
181
+ [id: string]: Codec
182
+ }
@@ -1,42 +1,43 @@
1
- declare global {
2
- namespace Clipbench {
3
- let elements: any[];
4
- enum types {
5
- text = 'text',
6
- display_slot = 'display_slot',
7
- keyframe = 'keyframe',
8
- animation = 'animation',
9
- face = 'face',
10
- mesh_selection = 'mesh_selection',
11
- texture = 'texture',
12
- layer = 'layer',
13
- outliner = 'outliner',
14
- texture_selection = 'texture_selection',
15
- image = 'image',
16
- }
17
- let image: undefined | {
18
- x: number,
19
- y: number,
20
- frame?: number
21
- data: string
22
- }
23
- namespace type_icons {
24
- let face = 'aspect_ratio';
25
- let mesh_selection = 'fa-gem';
26
- let outliner = 'fas.fa-cube';
27
- }
28
- function getCopyType(mode: any, check: any): Clipbench.types;
29
- function getPasteType(): Promise<Clipbench.types>;
30
- function copy(event: Event, cut: any): void;
31
- function paste(event: Event): Promise<void>;
32
- function setGroups(groups: Group[]): void;
33
- function setElements(arr: OutlinerElement[]): void;
34
- function setText(text: string): void;
35
- function setMeshSelection(mesh: Mesh): void;
36
- function pasteMeshSelection(): void;
37
- function pasteOutliner(event: Event): void;
38
- function pasteImage(): void;
39
- }
40
- }
41
-
42
- export {};
1
+ declare global {
2
+ namespace Clipbench {
3
+ let elements: any[];
4
+ let layer: any;
5
+ enum types {
6
+ text = 'text',
7
+ display_slot = 'display_slot',
8
+ keyframe = 'keyframe',
9
+ animation = 'animation',
10
+ face = 'face',
11
+ mesh_selection = 'mesh_selection',
12
+ texture = 'texture',
13
+ layer = 'layer',
14
+ outliner = 'outliner',
15
+ texture_selection = 'texture_selection',
16
+ image = 'image',
17
+ }
18
+ let image: undefined | {
19
+ x: number,
20
+ y: number,
21
+ frame?: number
22
+ data: string
23
+ }
24
+ namespace type_icons {
25
+ let face = 'aspect_ratio';
26
+ let mesh_selection = 'fa-gem';
27
+ let outliner = 'fas.fa-cube';
28
+ }
29
+ function getCopyType(mode: any, check: any): Clipbench.types;
30
+ function getPasteType(): Promise<Clipbench.types>;
31
+ function copy(event: Event, cut: any): void;
32
+ function paste(event: Event): Promise<void>;
33
+ function setGroups(groups: Group[]): void;
34
+ function setElements(arr: OutlinerElement[]): void;
35
+ function setText(text: string): void;
36
+ function setMeshSelection(mesh: Mesh): void;
37
+ function pasteMeshSelection(): void;
38
+ function pasteOutliner(event: Event): void;
39
+ function pasteImage(): void;
40
+ }
41
+ }
42
+
43
+ export {};