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
@@ -1,78 +1,88 @@
1
- /// <reference types="./blockbench"/>
2
-
3
-
4
- declare namespace Interface {
5
- function createElement(
6
- type: keyof HTMLElementTagNameMap,
7
- attributes?: {},
8
- content?: string | HTMLElement | HTMLElement[]
9
- ): HTMLElement
10
-
11
- const data: {
12
- left_bar_width: number
13
- right_bar_width: number
14
- quad_view_x: number
15
- quad_view_y: number
16
- timeline_head: number
17
- left_bar: string[]
18
- right_bar: string[]
19
- }
20
- let left_bar_width: number
21
- let right_bar_width: number
22
- let top_panel_height: number
23
- let bottom_panel_height: number
24
- let default_data: any
25
- function getTopPanel(): Panel
26
- function getBottomPanel(): Panel
27
- function getLeftPanels(in_order: boolean = true): Panel[]
28
- function getRightPanels(in_order: boolean = true): Panel[]
29
- function getModeData(): any
30
- const Resizers: {
31
- left: ResizeLine
32
- right: ResizeLine
33
- quad_view_x: ResizeLine
34
- quad_view_y: ResizeLine
35
- top: ResizeLine
36
- bottom: ResizeLine
37
- timeline_head: ResizeLine
38
- }
39
- const status_bar: {
40
- menu: Menu
41
- vue: Vue.Component
42
- }
43
- let tab_bar: Vue
44
- const Panels: {
45
- [key: string]: Panel
46
- }
47
- function toggleSidebar(side: any, status: any): void
48
-
49
- const text_edit_menu: Menu
50
-
51
- function addSuggestedModifierKey(key: 'ctrl' | 'shift' | 'alt', text: string): void
52
- function removeSuggestedModifierKey(key: 'ctrl' | 'shift' | 'alt', text: string): void
53
-
54
- const center_screen: HTMLElement
55
- const page_wrapper: HTMLElement
56
- const preview: HTMLElement
57
- const work_screen: HTMLElement
58
- const right_bar: HTMLElement
59
- const left_bar: HTMLElement
60
-
61
- namespace CustomElements {
62
- class SelectInput<T extends Record<string, string>> {
63
- node: HTMLElement
64
- constructor(
65
- id: string,
66
- options: {
67
- value?: T[keyof T]
68
- default?: T[keyof T]
69
- options: T
70
- onChange?(value: T[keyof T]): void
71
- }
72
- )
73
- set(value: T[keyof T]): void
74
- }
75
- const ResizeLine: any
76
- }
77
- }
78
- declare function updateInterface(): void
1
+ /// <reference types="./blockbench"/>
2
+
3
+ /**
4
+ * Update the size of everything in the UI after the window has been resized or other UI size changes have happeped
5
+ * @param event
6
+ */
7
+ declare function resizeWindow(event?: Event): void
8
+
9
+ declare namespace Interface {
10
+ function createElement(
11
+ type: keyof HTMLElementTagNameMap,
12
+ attributes?: {},
13
+ content?: string | HTMLElement | HTMLElement[]
14
+ ): HTMLElement
15
+
16
+ const data: {
17
+ left_bar_width: number
18
+ right_bar_width: number
19
+ quad_view_x: number
20
+ quad_view_y: number
21
+ timeline_head: number
22
+ start_screen_width: number
23
+ left_bar: string[]
24
+ right_bar: string[]
25
+ }
26
+ let left_bar_width: number
27
+ let right_bar_width: number
28
+ let top_panel_height: number
29
+ let bottom_panel_height: number
30
+ let default_data: any
31
+ function getTopPanel(): Panel
32
+ function getBottomPanel(): Panel
33
+ function getLeftPanels(in_order: boolean = true): Panel[]
34
+ function getRightPanels(in_order: boolean = true): Panel[]
35
+ function getModeData(): any
36
+ const Resizers: {
37
+ left: ResizeLine
38
+ right: ResizeLine
39
+ quad_view_x: ResizeLine
40
+ quad_view_y: ResizeLine
41
+ top: ResizeLine
42
+ bottom: ResizeLine
43
+ timeline_head: ResizeLine
44
+ start_screen_width: ResizeLine
45
+ [id: string]: ResizeLine
46
+ }
47
+ const status_bar: {
48
+ menu: Menu
49
+ vue: Vue.Component
50
+ }
51
+ let tab_bar: Vue
52
+ const Panels: {
53
+ [key: string]: Panel
54
+ }
55
+ function toggleSidebar(side: any, status: any): void
56
+
57
+ const text_edit_menu: Menu
58
+
59
+ function addSuggestedModifierKey(key: 'ctrl' | 'shift' | 'alt', text: string): void
60
+ function removeSuggestedModifierKey(key: 'ctrl' | 'shift' | 'alt', text: string): void
61
+
62
+ function definePanels(callback: () => void): void
63
+
64
+ const center_screen: HTMLElement
65
+ const page_wrapper: HTMLElement
66
+ const preview: HTMLElement
67
+ const work_screen: HTMLElement
68
+ const right_bar: HTMLElement
69
+ const left_bar: HTMLElement
70
+
71
+ namespace CustomElements {
72
+ class SelectInput<T extends Record<string, string>> {
73
+ node: HTMLElement
74
+ constructor(
75
+ id: string,
76
+ options: {
77
+ value?: T[keyof T]
78
+ default?: T[keyof T]
79
+ options: T
80
+ onChange?(value: T[keyof T]): void
81
+ }
82
+ )
83
+ set(value: T[keyof T]): void
84
+ }
85
+ const ResizeLine: any
86
+ }
87
+ }
88
+ declare function updateInterface(): void
package/custom/io.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- declare global {
2
- function setupDragHandlers(): void;
3
- function loadModelFile(file: any, args: any): void;
4
- function loadImages(files: any, event: any): Promise<void>;
5
- function unsupportedFileFormatMessage(file_name: string): void;
6
- namespace Extruder {
7
- function drawImage(file: any): void;
8
- function startConversion(formResult: any): void;
9
- }
10
- }
11
-
12
- export {};
1
+ declare global {
2
+ function setupDragHandlers(): void;
3
+ function loadModelFile(file: any, args?: any): void;
4
+ function loadImages(files: any, event?: Event): Promise<void>;
5
+ function unsupportedFileFormatMessage(file_name: string): void;
6
+ namespace Extruder {
7
+ function drawImage(file: any): void;
8
+ function startConversion(formResult: any): void;
9
+ }
10
+ }
11
+
12
+ export {};
@@ -1,221 +1,150 @@
1
- /**
2
- * Toolbars and related things
3
- */
4
- /// <reference types="./blockbench"/>
5
-
6
- declare global {
7
- export interface KeybindKeys {
8
- /**
9
- * Main key, can be a numeric keycode or a lower case character
10
- */
11
- key: number | string
12
- ctrl?: boolean
13
- shift?: boolean
14
- alt?: boolean
15
- meta?: boolean
16
- }
17
- type VariationModifier =
18
- | 'always'
19
- | 'ctrl'
20
- | 'shift'
21
- | 'alt'
22
- | 'meta'
23
- | 'unless_ctrl'
24
- | 'unless_shift'
25
- | 'unless_alt'
26
- type ModifierKey = 'ctrl' | 'shift' | 'alt' | 'meta'
27
- /**
28
- * A customizable keybind
29
- */
30
- class Keybind {
31
- /**
32
- * Create a keybind
33
- * @param {object} keys Set up the default keys that need to be pressed
34
- * @param {number|string} keys.key Main key. Check keycode.info to find out the numeric value, or simply use letters for letter keys
35
- * @param {boolean} keys.ctrl Control key. On MacOS this automatically works for Cmd
36
- * @param {boolean} keys.shift Shift key
37
- * @param {boolean} keys.alt Alt key
38
- * @param {boolean} keys.meta Meta key
39
- */
40
- constructor(keys?: KeybindKeys | null, variations?: Record<string, VariationModifier>)
41
- key: number
42
- ctrl?: boolean
43
- shift?: boolean
44
- alt?: boolean
45
- variations?: {
46
- [key: string]: ModifierKey
47
- }
48
- label: string
49
- set(keys: KeybindKeys, default_keybind?: Keybind): this
50
- /**
51
- * Unassign the assigned key
52
- */
53
- clear(): this
54
- /**
55
- * Save any changes to local storage
56
- * @param save Save all keybinding changes to local storage. Set to fales if updating multiple at once
57
- */
58
- save(save?: false): this
59
- /**
60
- * Assign an action to the keybind
61
- * @param id ID of the action
62
- * @param sub_id sub keybind ID
63
- */
64
- setAction(id: string, sub_id?: string): this | undefined
65
- /**
66
- * Get display text showing the keybind
67
- * @param formatted If true, the return string will include HTML formatting
68
- */
69
- getText(formatted?: boolean): string
70
- /**
71
- * Get the name of the bound key
72
- */
73
- getCode(key?: string): string
74
- /**
75
- * Check if a key is assigned
76
- */
77
- hasKey(): boolean
78
- /**
79
- * Test if the keybind would be triggered by the event
80
- */
81
- isTriggered(event: Event): boolean
82
- /**
83
- * Test which variation would be triggered by the event. Returns the ID of the variation if triggered
84
- * @param event The event to test
85
- */
86
- additionalModifierTriggered(event: Event): string | undefined
87
- /**
88
- * Test if a variation would be triggered by the event
89
- * @param event The event to test
90
- * @param variation The variation to test againts
91
- */
92
- additionalModifierTriggered(event: Event, variation: string): boolean
93
- /**
94
- * Open a UI to let the user record a new key combination
95
- */
96
- record(): this
97
- /**
98
- * Stop recording a new key combination
99
- */
100
- stopRecording(): this
101
- /**
102
- * Returns the label of the keybinding
103
- */
104
- toString(): string
105
-
106
- /**
107
- * Load an included keymap by ID
108
- * @param id
109
- * @param from_start_screen
110
- */
111
- static loadKeymap(id: string, from_start_screen?: boolean): void | true
112
- /**
113
- * Check if two KeybindItems are mutually exclusive, so only one can be available at the time. This is only the case if they each have a ConditionResolvable that is structured to support this
114
- */
115
- static no_overlap(k1: KeybindItem, k2: KeybindItem): boolean
116
- }
117
-
118
-
119
- class MenuSeparator {
120
- constructor(id?: string, label?: string)
121
- id: string
122
- menu_node: HTMLLIElement
123
- label?: string
124
- menu_node?: HTMLElement
125
- }
126
-
127
- interface ToolbarOptions {
128
- id?: string
129
- name?: string
130
- /**
131
- * If true, the toolbar will display a label abovee
132
- */
133
- label?: boolean
134
- condition?: ConditionResolvable
135
- /**
136
- * If true, the toolbar will only take as much width as needed
137
- */
138
- narrow?: boolean
139
- vertical?: boolean
140
- /**
141
- * Default content of the toolbar. Separators are available, where _ = separator, + = spaces, # = line break
142
- */
143
- children: ('_' | '+' | '#' | string | BarItem)[]
144
- }
145
- export class Toolbar {
146
- id: string
147
- name: string
148
- label: boolean
149
- label_node: HTMLElement
150
- condition: ConditionResolvable
151
- children: (BarItem | string)[]
152
- no_wrap: boolean
153
- narrow: boolean
154
- vertical: boolean
155
- default_children: (BarItem | string)[]
156
- /*private*/ positionLookup: any
157
- /*private*/ condition_cache: any
158
- /*private*/ previously_enabled: any
159
- /*private*/ postload: any
160
- /*private*/ menu: any
161
- node: HTMLElement
162
- constructor(id: string, data: ToolbarOptions)
163
- constructor(data: ToolbarOptions)
164
- build(data: any, force: any): this
165
- contextmenu(event: Event): void
166
- editMenu(): this
167
- add(action: any, position?: number): this
168
- remove(action: BarItem, update: boolean = false): this
169
- update(): this
170
- toPlace(place: any): this
171
- save(): this
172
- reset(): this
173
- condition(): boolean
174
- }
175
- export namespace BARS {
176
- const stored: {}
177
- const editing_bar: undefined | Toolbar
178
- const action_definers: (() => void)[]
179
- const condition: any
180
- function defineActions(definer: any): void
181
- function setupActions(): void
182
- function setupToolbars(): void
183
- function setupVue(): void
184
- function updateConditions(): void
185
- function updateToolToolbar(): void
186
- }
187
- /**
188
- * A dialog-based interface to search and trigger actions and other things
189
- */
190
- namespace ActionControl {
191
- const open: boolean
192
- const type: string
193
- const max_length: number
194
- function select(input?: string): void
195
- function show(input?: string): void
196
- function hide(): void
197
- function confirm(event: Event): void
198
- function cancel(): void
199
- function trigger(action: any, event: Event): void
200
- function click(action: any, event: Event): void
201
- function handleKeys(event: Event): boolean
202
- }
203
- /**
204
- * Stores and handles keybinds
205
- */
206
- namespace Keybinds {
207
- const actions: BarItem[]
208
- const stored: Record<string, { key: number; ctrl: boolean; shift: boolean }>
209
- const extra: Record<string, KeybindItem>
210
- const structure: any
211
- function save(): void
212
- function reset(): void
213
- }
214
- class _ToolToolbar extends Toolbar {
215
- selected: Tool
216
- original: any
217
- }
218
- const Toolbox: _ToolToolbar
219
- }
220
-
221
- export {}
1
+ /**
2
+ * Keybindings and action control
3
+ */
4
+ /// <reference types="./blockbench"/>
5
+
6
+ declare global {
7
+ export interface KeybindKeys {
8
+ /**
9
+ * Main key, can be a numeric keycode or a lower case character
10
+ */
11
+ key?: number | string
12
+ ctrl?: boolean
13
+ shift?: boolean
14
+ alt?: boolean
15
+ meta?: boolean
16
+ }
17
+ type VariationModifier =
18
+ | 'always'
19
+ | 'ctrl'
20
+ | 'shift'
21
+ | 'alt'
22
+ | 'meta'
23
+ | 'unless_ctrl'
24
+ | 'unless_shift'
25
+ | 'unless_alt'
26
+ type ModifierKey = 'ctrl' | 'shift' | 'alt' | 'meta'
27
+ /**
28
+ * A customizable keybind
29
+ */
30
+ class Keybind {
31
+ /**
32
+ * Create a keybind
33
+ * @param {object} keys Set up the default keys that need to be pressed
34
+ * @param {number|string} keys.key Main key. Check keycode.info to find out the numeric value, or simply use letters for letter keys
35
+ * @param {boolean} keys.ctrl Control key. On MacOS this automatically works for Cmd
36
+ * @param {boolean} keys.shift Shift key
37
+ * @param {boolean} keys.alt Alt key
38
+ * @param {boolean} keys.meta Meta key
39
+ */
40
+ constructor(keys?: KeybindKeys | null, variations?: Record<string, VariationModifier>)
41
+ key: number
42
+ ctrl?: boolean
43
+ shift?: boolean
44
+ alt?: boolean
45
+ meta?: boolean
46
+ variations?: {
47
+ [key: string]: ModifierKey
48
+ }
49
+ label: string
50
+ set(keys: KeybindKeys, default_keybind?: Keybind): this
51
+ /**
52
+ * Unassign the assigned key
53
+ */
54
+ clear(): this
55
+ /**
56
+ * Save any changes to local storage
57
+ * @param save Save all keybinding changes to local storage. Set to fales if updating multiple at once
58
+ */
59
+ save(save?: false): this
60
+ /**
61
+ * Assign an action to the keybind
62
+ * @param id ID of the action
63
+ * @param sub_id sub keybind ID
64
+ */
65
+ setAction(id: string, sub_id?: string): this | undefined
66
+ /**
67
+ * Get display text showing the keybind
68
+ * @param formatted If true, the return string will include HTML formatting
69
+ */
70
+ getText(formatted?: boolean): string
71
+ /**
72
+ * Get the name of the bound key
73
+ */
74
+ getCode(key?: string): string
75
+ /**
76
+ * Check if a key is assigned
77
+ */
78
+ hasKey(): boolean
79
+ /**
80
+ * Test if the keybind would be triggered by the event
81
+ */
82
+ isTriggered(event: Event): boolean
83
+ /**
84
+ * Test which variation would be triggered by the event. Returns the ID of the variation if triggered
85
+ * @param event The event to test
86
+ */
87
+ additionalModifierTriggered(event: Event): string | undefined
88
+ /**
89
+ * Test if a variation would be triggered by the event
90
+ * @param event The event to test
91
+ * @param variation The variation to test againts
92
+ */
93
+ additionalModifierTriggered(event: Event, variation: string): boolean
94
+ /**
95
+ * Open a UI to let the user record a new key combination
96
+ */
97
+ record(): this
98
+ /**
99
+ * Stop recording a new key combination
100
+ */
101
+ stopRecording(): this
102
+ /**
103
+ * Returns the label of the keybinding
104
+ */
105
+ toString(): string
106
+
107
+ /**
108
+ * Load an included keymap by ID
109
+ * @param id
110
+ * @param from_start_screen
111
+ */
112
+ static loadKeymap(id: string, from_start_screen?: boolean): void | true
113
+ /**
114
+ * Check if two KeybindItems are mutually exclusive, so only one can be available at the time. This is only the case if they each have a ConditionResolvable that is structured to support this
115
+ */
116
+ static no_overlap(k1: KeybindItem, k2: KeybindItem): boolean
117
+ }
118
+
119
+ /**
120
+ * A dialog-based interface to search and trigger actions and other things
121
+ */
122
+ namespace ActionControl {
123
+ const open: boolean
124
+ const type: string
125
+ const max_length: number
126
+ function select(input?: string): void
127
+ function show(input?: string): void
128
+ function hide(): void
129
+ function confirm(event: Event): void
130
+ function cancel(): void
131
+ function trigger(action: any, event: Event): void
132
+ function click(action: any, event: Event): void
133
+ function handleKeys(event: Event): boolean
134
+ }
135
+ /**
136
+ * Stores and handles keybinds
137
+ */
138
+ namespace Keybinds {
139
+ const actions: BarItem[]
140
+ const stored: Record<string, { key: number; ctrl: boolean; shift: boolean }>
141
+ const extra: Record<string, KeybindItem>
142
+ const structure: any
143
+ function save(): void
144
+ function reset(): void
145
+ function loadKeymap(id: string, from_start_screen: boolean = false): true | void
146
+ }
147
+ const Vertexsnap: any
148
+ }
149
+
150
+ export {}