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
@@ -1,168 +1,182 @@
1
- /// <reference types="./blockbench"/>
2
-
3
- declare global {
4
- // const Prism: typeof import('prismjs')
5
- /**
6
- * @deprecated Use {@link Canvas.scene} instead
7
- */
8
- const scene: THREE.Scene
9
- const Transformer: any
10
-
11
- /**
12
- * @deprecated
13
- */
14
- const main_preview: Preview
15
- /**
16
- * @deprecated
17
- */
18
- let open_interface: Dialog | any | undefined
19
-
20
- function confirm(message: string, title: string): boolean
21
-
22
- const PathModule: typeof import('path')
23
-
24
- /**
25
- * @deprecated Use {@link Outliner.selected} instead
26
- */
27
- let selected: OutlinerElement[]
28
- const Toolbars: Record<string, Toolbar>
29
-
30
- function rotateOnAxis(modify: OutlinerNode, axis: number, slider?: boolean): void
31
- function afterRotateOnAxis(): void
32
-
33
- // const Transformer: THREE.TransformControls
34
- interface HTMLImageElement {
35
- src: string
36
- tex: THREE.Texture & {
37
- magFilter: THREE.TextureFilter
38
- minFilter: THREE.TextureFilter
39
- }
40
- }
41
- interface Date {
42
- /**
43
- * Returns a timestamp in the format 16:30
44
- */
45
- getTimestamp(): string
46
- getDateArray(): number[]
47
- getDateString(): string
48
- dayOfYear(): number
49
- }
50
- interface Number {
51
- toDigitString(digits: number): string
52
- }
53
- interface Event {
54
- readonly ctrlOrCmd: boolean
55
- }
56
- interface Math {
57
- limitNumber(number: number, min: number, max: number): number
58
- radToDeg(radians: number): number
59
- degToRad(degrees: number): number
60
- /**
61
- * Rounds the input number to N digits
62
- */
63
- roundTo(number: number, digits: number): number
64
- /**
65
- * Test if the number is between two other numbers
66
- */
67
- isBetween(number: number, limit1: number, limit2: number): boolean
68
- /**
69
- * Checks if the absolute difference between a and b is smaller than epsilon
70
- */
71
- epsilon(a: number, b: number, epsilon: number): boolean
72
- /**
73
- * Take a rotation value in degrees, and trim it to a value between -180 and 180, while keeping the same angle
74
- */
75
- trimDeg(degrees: number): number
76
- isPowerOfTwo(number: number): boolean
77
- /***
78
- * Checks if the input is of type number
79
- */
80
- isNumber(number: any): boolean
81
- /**
82
- * Generates a random float between a and b
83
- */
84
- randomab(a: number, b: number): number
85
- areMultiples(number1: number, number2: number): boolean
86
- /**
87
- * Return the next highest power of n
88
- * @param num Power
89
- * @param min Value that the result should be equal to or higher than
90
- */
91
- getNextPower(num: number, min: number): number
92
- /**
93
- * Snap the value to the closest number in a list of 1 or more snap points
94
- */
95
- snapToValues(number: number, snap_points: number[], epsilon: number): number
96
- /**
97
- * Get the lerp alpha value of m, between points a and b
98
- */
99
- getLerp: (a: number, b: number, m: number) => number
100
- /**
101
- * Lerp between a and b using the 0-1 alpha value
102
- */
103
- lerp: (a: number, b: number, alpha: number) => number
104
- /**
105
- * Return a random integer
106
- */
107
- randomInteger: (a: number, b: number) => number
108
- hermiteBlend: (input: number) => number
109
- clamp: (number: number, min: number, max: number) => number
110
- }
111
- interface Array<T> {
112
- remove(item: any): boolean
113
- /***
114
- * Adds items to the array if they are not yet in the array
115
- */
116
- safePush(...items: any): boolean
117
- equals(array: Array<any>): boolean
118
- replace(items: T[]): boolean
119
- allAre(callback: (item: T, index: number) => boolean): boolean
120
- findInArray(key: string, value: any): number
121
- findHighest(callback: ((item: T) => number)): T
122
- positiveItems(): number
123
- /**
124
- * Empties the array
125
- */
126
- empty(): this
127
- last(): T
128
- /**
129
- * Get the item at the specified index with a modulo applied, so any index will return a value
130
- */
131
- atWrapped(index: number): T
132
- allEqual(item: T): boolean
133
- random(): T
134
- toggle(item: T, state?: boolean): boolean
135
- /**
136
- * Same as forEach, but in reverse order
137
- */
138
- forEachReverse(callback: (item: T, index: number) => void): void
139
- /**
140
- * Returns the amount of items that exist in this array and the reference array
141
- */
142
- overlap(arr: Array<any>): number
143
-
144
- V3_set(x: number, y: number, z: number): ArrayVector3
145
- V3_set(values: ArrayVector3): ArrayVector3
146
- // V3_set(value: THREE.Vector3): this
147
- V3_add(x: number, y: number, z: number): ArrayVector3
148
- V3_add(values: ArrayVector3): ArrayVector3
149
- V3_add(value: THREE.Vector3): ArrayVector3
150
- V3_subtract(x: number, y: number, z: number): ArrayVector3
151
- V3_subtract(values: ArrayVector3): ArrayVector3
152
- V3_subtract(value: THREE.Vector3): ArrayVector3
153
- V3_multiply(x: number, y: number, z: number): ArrayVector3
154
- V3_multiply(values: ArrayVector3): ArrayVector3
155
- V3_multiply(value: THREE.Vector3): ArrayVector3
156
- V3_divide(x: number, y: number, z: number): ArrayVector3
157
- V3_divide(values: ArrayVector3): ArrayVector3
158
- V3_divide(value: THREE.Vector3): ArrayVector3
159
- V3_toThree(): THREE.Vector3
160
- }
161
-
162
- interface Event {
163
- shiftKey?: boolean
164
- }
165
- }
166
-
167
- export { }
168
-
1
+ /// <reference types="./blockbench"/>
2
+
3
+ declare global {
4
+ // const Prism: typeof import('prismjs')
5
+ /**
6
+ * @deprecated Use {@link Canvas.scene} instead
7
+ */
8
+ const scene: THREE.Scene
9
+ const Transformer: any
10
+
11
+ /**
12
+ * @deprecated
13
+ */
14
+ const main_preview: Preview
15
+ /**
16
+ * @deprecated
17
+ */
18
+ let open_interface: Dialog | any | undefined
19
+
20
+ function confirm(message: string, title: string): boolean
21
+
22
+ const PathModule: typeof import('path')
23
+
24
+ /**
25
+ * @deprecated Use {@link Outliner.selected} instead
26
+ */
27
+ let selected: OutlinerElement[]
28
+ const Toolbars: Record<string, Toolbar>
29
+
30
+ function rotateOnAxis(modify: OutlinerNode, axis: number, slider?: boolean): void
31
+ function afterRotateOnAxis(): void
32
+
33
+ // const Transformer: THREE.TransformControls
34
+ interface HTMLImageElement {
35
+ src: string
36
+ tex: THREE.Texture & {
37
+ magFilter: THREE.TextureFilter
38
+ minFilter: THREE.TextureFilter
39
+ }
40
+ }
41
+ interface Date {
42
+ /**
43
+ * Returns a timestamp in the format 16:30
44
+ */
45
+ getTimestamp(): string
46
+ getDateArray(): number[]
47
+ getDateString(): string
48
+ dayOfYear(): number
49
+ }
50
+ interface Number {
51
+ toDigitString(digits: number): string
52
+ }
53
+ interface String {
54
+ hashCode(): number
55
+ }
56
+ interface Event {
57
+ readonly ctrlOrCmd: boolean
58
+ }
59
+ interface Math {
60
+ limitNumber(number: number, min: number, max: number): number
61
+ radToDeg(radians: number): number
62
+ degToRad(degrees: number): number
63
+ /**
64
+ * Rounds the input number to N digits
65
+ */
66
+ roundTo(number: number, digits: number): number
67
+ /**
68
+ * Test if the number is between two other numbers
69
+ */
70
+ isBetween(number: number, limit1: number, limit2: number): boolean
71
+ /**
72
+ * Checks if the absolute difference between a and b is smaller than epsilon
73
+ */
74
+ epsilon(a: number, b: number, epsilon: number): boolean
75
+ /**
76
+ * Take a rotation value in degrees, and trim it to a value between -180 and 180, while keeping the same angle
77
+ */
78
+ trimDeg(degrees: number): number
79
+ isPowerOfTwo(number: number): boolean
80
+ /***
81
+ * Checks if the input is of type number
82
+ */
83
+ isNumber(number: any): boolean
84
+ /**
85
+ * Generates a random float between a and b
86
+ */
87
+ randomab(a: number, b: number): number
88
+ areMultiples(number1: number, number2: number): boolean
89
+ /**
90
+ * Return the next highest power of n
91
+ * @param num Power
92
+ * @param min Value that the result should be equal to or higher than
93
+ */
94
+ getNextPower(num: number, min: number): number
95
+ /**
96
+ * Snap the value to the closest number in a list of 1 or more snap points
97
+ */
98
+ snapToValues(number: number, snap_points: number[], epsilon: number): number
99
+ /**
100
+ * Get the lerp alpha value of m, between points a and b
101
+ */
102
+ getLerp: (a: number, b: number, m: number) => number
103
+ /**
104
+ * Lerp between a and b using the 0-1 alpha value
105
+ */
106
+ lerp: (a: number, b: number, alpha: number) => number
107
+ /**
108
+ * Return a random integer
109
+ */
110
+ randomInteger: (a: number, b: number) => number
111
+ hermiteBlend: (input: number) => number
112
+ clamp: (number: number, min: number, max: number) => number
113
+ }
114
+ interface Array<T> {
115
+ remove(item: any): boolean
116
+ /***
117
+ * Adds items to the array if they are not yet in the array
118
+ */
119
+ safePush(...items: any): boolean
120
+ equals(array: Array<any>): boolean
121
+ replace(items: T[]): boolean
122
+ allAre(callback: (item: T, index: number) => boolean): boolean
123
+ findInArray(key: string, value: any): number
124
+ findHighest(callback: ((item: T) => number)): T
125
+ positiveItems(): number
126
+ /**
127
+ * Empties the array
128
+ */
129
+ empty(): this
130
+ last(): T
131
+ /**
132
+ * Get the item at the specified index with a modulo applied, so any index will return a value
133
+ */
134
+ atWrapped(index: number): T
135
+ allEqual(item: T): boolean
136
+ random(): T
137
+ toggle(item: T, state?: boolean): boolean
138
+ /**
139
+ * Same as forEach, but in reverse order
140
+ */
141
+ forEachReverse(callback: (item: T, index: number) => void): void
142
+ /**
143
+ * Returns the amount of items that exist in this array and the reference array
144
+ */
145
+ overlap(arr: Array<any>): number
146
+
147
+ V3_set(x: number, y: number, z: number): ArrayVector3
148
+ V3_set(values: ArrayVector3): ArrayVector3
149
+ // V3_set(value: THREE.Vector3): this
150
+ V3_add(x: number, y: number, z: number): ArrayVector3
151
+ V3_add(values: ArrayVector3): ArrayVector3
152
+ V3_add(value: THREE.Vector3): ArrayVector3
153
+ V3_subtract(x: number, y: number, z: number): ArrayVector3
154
+ V3_subtract(values: ArrayVector3): ArrayVector3
155
+ V3_subtract(value: THREE.Vector3): ArrayVector3
156
+ V3_multiply(x: number, y: number, z: number): ArrayVector3
157
+ V3_multiply(values: ArrayVector3): ArrayVector3
158
+ V3_multiply(value: THREE.Vector3): ArrayVector3
159
+ V3_divide(x: number, y: number, z: number): ArrayVector3
160
+ V3_divide(values: ArrayVector3): ArrayVector3
161
+ V3_divide(value: THREE.Vector3): ArrayVector3
162
+ V3_toThree(): THREE.Vector3
163
+
164
+ V2_set(x: number, y: number): ArrayVector2
165
+ V2_set(values: ArrayVector2): ArrayVector2
166
+ V2_add(x: number, y: number): ArrayVector2
167
+ V2_add(values: ArrayVector2): ArrayVector2
168
+ V2_subtract(x: number, y: number): ArrayVector2
169
+ V2_subtract(values: ArrayVector2): ArrayVector2
170
+ V2_multiply(x: number, y: number): ArrayVector2
171
+ V2_multiply(values: ArrayVector2): ArrayVector2
172
+ V2_divide(x: number, y: number): ArrayVector2
173
+ V2_divide(values: ArrayVector2): ArrayVector2
174
+ }
175
+
176
+ interface Event {
177
+ shiftKey?: boolean
178
+ }
179
+ }
180
+
181
+ export { }
182
+
package/custom/group.d.ts CHANGED
@@ -1,113 +1,113 @@
1
- interface GroupOptions {
2
- /**Group name */
3
- name: string
4
- /**Array of the group pivot point */
5
- origin: ArrayVector3
6
- /**Array of the group rotation */
7
- rotation: ArrayVector3
8
- /**If a bone, whether to reset the informations of inherited bones in bedrock edition. */
9
- reset: boolean
10
- /**Whether to shade the contents of the group */
11
- shade: boolean
12
- /**Whether the group is selected */
13
- selected: boolean
14
- /**Whether the group is visible */
15
- visibility: boolean
16
- /**Whether to export the entire group */
17
- export: boolean
18
- /**Auto UV setting for the children. Can be 0, 1 or 2. */
19
- autouv: 0 | 1 | 2
20
- mirror_uv: boolean
21
- color: number
22
- }
23
-
24
- declare class Group extends OutlinerNode {
25
- constructor(options: Partial<GroupOptions> | string)
26
- /**
27
- * Returns the selected groups
28
- * @Note This only includes directly selected groups, not groups that are selected because the parent is selected
29
- */
30
- static selected: Group[]
31
- /**
32
- * The first group in {@link Group.multi_selected}
33
- */
34
- static first_selected: Group | undefined
35
- /**
36
- * A list of directly selected groups.
37
- * @Note This only includes directly selected groups, not groups that are selected because the parent is selected
38
- */
39
- static multi_selected: Group[]
40
- /**
41
- * All groups in the current project
42
- */
43
- static all: Group[]
44
- static animator: BoneAnimator
45
- /**Check if any groups are in the project */
46
- static hasAny: () => boolean
47
-
48
- name: string
49
- children: OutlinerNode[]
50
- origin: ArrayVector3
51
- rotation: ArrayVector3
52
- reset: boolean
53
- shade: boolean
54
- selected: boolean
55
- visibility: boolean
56
- autouv: 0 | 1 | 2
57
- mirror_uv: boolean
58
- color: number
59
- isOpen: boolean
60
- ik_enabled: boolean
61
- ik_chain_length: number
62
- texture?: string
63
- skin_original_origin?: ArrayVector3
64
- bedrock_binding?: string
65
- cem_animations?: any[]
66
- cem_attach?: boolean
67
- cem_model?: string
68
- cem_scale?: number
69
- mesh: THREE.Object3D
70
-
71
- [key: string]: any
72
-
73
- static preview_controller: NodePreviewController
74
-
75
- extend(options: Partial<GroupOptions>): this
76
- selectChildren(event: Event): this
77
- /**
78
- * Mark the group as selected
79
- */
80
- markAsSelected(descendants?: boolean): void
81
- select(event?: any, isOutlinerClick?: boolean): this
82
- unselect(): this
83
- matchesSelection(): boolean
84
- /**
85
- * Opens the group and all of its ancestor groups.
86
- */
87
- openUp(): this
88
- /**
89
- * Removes the group
90
- * @param undo If true, an undo point will be created.
91
- */
92
- remove(undo?: boolean): this
93
- /**
94
- * Remove the group and leave all of its children in the parent array.
95
- */
96
- resolve(): OutlinerNode[]
97
- /**
98
- * Move the origin of a bone to a specific location without visually affecting the position of it's content.
99
- */
100
- transferOrigin(origin: ArrayVector3): this
101
- /**
102
- * Sort the content of the group alphabetically. This will automatically create an undo point.
103
- */
104
- sortContent(): this
105
- /**
106
- * Duplicate the group
107
- */
108
- duplicate(): Group
109
- getSaveCopy(): any
110
- getChildlessCopy(): Group
111
- compile(undo: boolean): any
112
- forEachChild(callback: (any: OutlinerNode) => void, type?: any, for_self?: boolean): void
113
- }
1
+ interface GroupOptions {
2
+ /**Group name */
3
+ name: string
4
+ /**Array of the group pivot point */
5
+ origin: ArrayVector3
6
+ /**Array of the group rotation */
7
+ rotation: ArrayVector3
8
+ /**If a bone, whether to reset the informations of inherited bones in bedrock edition. */
9
+ reset: boolean
10
+ /**Whether to shade the contents of the group */
11
+ shade: boolean
12
+ /**Whether the group is selected */
13
+ selected: boolean
14
+ /**Whether the group is visible */
15
+ visibility: boolean
16
+ /**Whether to export the entire group */
17
+ export: boolean
18
+ /**Auto UV setting for the children. Can be 0, 1 or 2. */
19
+ autouv: 0 | 1 | 2
20
+ mirror_uv: boolean
21
+ color: number
22
+ }
23
+
24
+ declare class Group extends OutlinerNode {
25
+ constructor(options: Partial<GroupOptions> | string)
26
+ /**
27
+ * Returns the selected groups
28
+ * @Note This only includes directly selected groups, not groups that are selected because the parent is selected
29
+ */
30
+ static selected: Group[]
31
+ /**
32
+ * The first group in {@link Group.multi_selected}
33
+ */
34
+ static first_selected: Group | undefined
35
+ /**
36
+ * A list of directly selected groups.
37
+ * @Note This only includes directly selected groups, not groups that are selected because the parent is selected
38
+ */
39
+ static multi_selected: Group[]
40
+ /**
41
+ * All groups in the current project
42
+ */
43
+ static all: Group[]
44
+ static animator: BoneAnimator
45
+ /**Check if any groups are in the project */
46
+ static hasAny: () => boolean
47
+
48
+ name: string
49
+ children: OutlinerNode[]
50
+ origin: ArrayVector3
51
+ rotation: ArrayVector3
52
+ reset: boolean
53
+ shade: boolean
54
+ selected: boolean
55
+ visibility: boolean
56
+ autouv: 0 | 1 | 2
57
+ mirror_uv: boolean
58
+ color: number
59
+ isOpen: boolean
60
+ ik_enabled: boolean
61
+ ik_chain_length: number
62
+ texture?: string
63
+ skin_original_origin?: ArrayVector3
64
+ bedrock_binding?: string
65
+ cem_animations?: any[]
66
+ cem_attach?: boolean
67
+ cem_model?: string
68
+ cem_scale?: number
69
+ mesh: THREE.Object3D
70
+
71
+ [key: string]: any
72
+
73
+ static preview_controller: NodePreviewController
74
+
75
+ extend(options: Partial<GroupOptions>): this
76
+ selectChildren(event: Event): this
77
+ /**
78
+ * Mark the group as selected
79
+ */
80
+ markAsSelected(descendants?: boolean): void
81
+ select(event?: any, isOutlinerClick?: boolean): this
82
+ unselect(): this
83
+ matchesSelection(): boolean
84
+ /**
85
+ * Opens the group and all of its ancestor groups.
86
+ */
87
+ openUp(): this
88
+ /**
89
+ * Removes the group
90
+ * @param undo If true, an undo point will be created.
91
+ */
92
+ remove(undo?: boolean): this
93
+ /**
94
+ * Remove the group and leave all of its children in the parent array.
95
+ */
96
+ resolve(): OutlinerNode[]
97
+ /**
98
+ * Move the origin of a bone to a specific location without visually affecting the position of it's content.
99
+ */
100
+ transferOrigin(origin: ArrayVector3): this
101
+ /**
102
+ * Sort the content of the group alphabetically. This will automatically create an undo point.
103
+ */
104
+ sortContent(): this
105
+ /**
106
+ * Duplicate the group
107
+ */
108
+ duplicate(): Group
109
+ getSaveCopy(): any
110
+ getChildlessCopy(): Group
111
+ compile(undo: boolean): any
112
+ forEachChild(callback: (any: OutlinerNode) => void, type?: any, for_self?: boolean): void
113
+ }