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
@@ -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
+ }
@@ -1,221 +1,221 @@
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
+ * 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 {}