blockbench-types 4.8.0 → 4.10.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.
- package/.prettierignore +1 -0
- package/.prettierrc.json +9 -0
- package/README.md +1 -0
- package/package.json +43 -33
- package/scripts/generate_docs.js +243 -194
- package/tsconfig.json +13 -14
- package/types/action.d.ts +358 -279
- package/types/animation.d.ts +181 -143
- package/types/animation_controller.d.ts +105 -99
- package/types/blockbench.d.ts +146 -76
- package/types/canvas.d.ts +239 -228
- package/types/canvas_frame.d.ts +2 -2
- package/types/codec.d.ts +36 -32
- package/types/cube.d.ts +32 -11
- package/types/desktop.d.ts +14 -0
- package/types/dialog.d.ts +164 -37
- package/types/display_mode.d.ts +13 -6
- package/types/file_system.d.ts +159 -0
- package/types/format.d.ts +46 -12
- package/types/global.d.ts +49 -3
- package/types/group.d.ts +16 -5
- package/types/index.d.ts +1 -0
- package/types/interface.d.ts +21 -12
- package/types/io.d.ts +2 -0
- package/types/keyframe.d.ts +73 -57
- package/types/legacy.d.ts +2 -1
- package/types/math_util.d.ts +1 -0
- package/types/menu.d.ts +93 -78
- package/types/mesh.d.ts +89 -64
- package/types/misc.d.ts +114 -47
- package/types/mode.d.ts +14 -0
- package/types/molang.d.ts +17 -0
- package/types/outliner.d.ts +42 -23
- package/types/painter.d.ts +49 -11
- package/types/panel.d.ts +49 -21
- package/types/plugin.d.ts +29 -1
- package/types/preview.d.ts +71 -69
- package/types/preview_scene.d.ts +11 -12
- package/types/project.d.ts +56 -34
- package/types/screencam.d.ts +11 -6
- package/types/settings.d.ts +87 -85
- package/types/shared_actions.d.ts +94 -0
- package/types/texture_layers.d.ts +117 -0
- package/types/textures.d.ts +381 -176
- package/types/timeline.d.ts +60 -60
- package/types/undo.d.ts +107 -103
- package/types/util.d.ts +165 -33
- package/types/uveditor.d.ts +3 -0
- package/types/validator.d.ts +3 -2
- package/types/vue.d.ts +7 -0
package/types/textures.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference
|
|
1
|
+
/// <reference path="./blockbench.d.ts"/>
|
|
2
2
|
|
|
3
3
|
interface TextureData {
|
|
4
4
|
path?: string
|
|
@@ -6,202 +6,407 @@ interface TextureData {
|
|
|
6
6
|
folder?: string
|
|
7
7
|
namespace?: string
|
|
8
8
|
id?: string
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
particle?: boolean
|
|
10
|
+
visible?: boolean
|
|
11
|
+
mode?: string
|
|
12
|
+
saved?: boolean
|
|
13
|
+
keep_size?: boolean
|
|
14
|
+
source?: string
|
|
15
|
+
width?: number
|
|
16
|
+
height?: number
|
|
17
|
+
standalone?: boolean
|
|
15
18
|
}
|
|
16
19
|
interface TextureEditOptions {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Edit method. 'canvas' is default
|
|
22
|
+
*/
|
|
23
|
+
method?: 'canvas' | 'jimp'
|
|
24
|
+
/**
|
|
25
|
+
* Name of the undo entry that is created
|
|
26
|
+
*/
|
|
27
|
+
edit_name?: string
|
|
28
|
+
/**
|
|
29
|
+
* Whether to use the cached canvas/jimp instance
|
|
30
|
+
*/
|
|
31
|
+
use_cache?: boolean
|
|
32
|
+
/**
|
|
33
|
+
* If true, no undo point is created. Default is false
|
|
34
|
+
*/
|
|
35
|
+
no_undo?: boolean
|
|
36
|
+
/**
|
|
37
|
+
* If true, the texture is not updated visually
|
|
38
|
+
*/
|
|
39
|
+
no_update?: boolean
|
|
40
|
+
no_undo_init?: boolean
|
|
41
|
+
no_undo_finish?: boolean
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
/**
|
|
42
45
|
* A texture combines the functionality of material, texture, and image, in one. Textures can be linked to files on the local hard drive, or hold the information in RAM.
|
|
43
46
|
*/
|
|
44
47
|
declare class Texture {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
48
|
+
constructor(data: TextureData, uuid?: string)
|
|
49
|
+
readonly frameCount: number | undefined
|
|
50
|
+
readonly display_height: number
|
|
51
|
+
readonly ratio: number
|
|
52
|
+
|
|
53
|
+
path?: string
|
|
54
|
+
name: string
|
|
55
|
+
/** Relative path to the file's directory, used by some formats such as Java Block/Item*/
|
|
56
|
+
folder: string
|
|
57
|
+
namespace: string
|
|
58
|
+
/** Texture ID or key, used by some formats. By default this is a number that increases with every texture that is added */
|
|
59
|
+
id: string
|
|
60
|
+
/** Whether the texture is used for the models particle system. Used by some formats such as Java Block/Item */
|
|
61
|
+
particle: boolean
|
|
62
|
+
render_mode: 'default' | 'emissive' | 'additive' | 'layered' | string
|
|
63
|
+
render_sides: 'auto' | 'front' | 'double' | string
|
|
64
|
+
|
|
65
|
+
/** Texture animation frame time */
|
|
66
|
+
frame_time: number
|
|
67
|
+
frame_order_type: 'custom' | 'loop' | 'backwards' | 'back_and_forth'
|
|
68
|
+
/** Custom frame order */
|
|
69
|
+
frame_order: string
|
|
70
|
+
/** Interpolate between frames */
|
|
71
|
+
frame_interpolate: boolean
|
|
72
|
+
|
|
73
|
+
/** HTML-style source of the texture's displayed data. Can be a path (desktop app only), or a base64 data URL */
|
|
74
|
+
source: string
|
|
75
|
+
selected?: boolean
|
|
76
|
+
show_icon: boolean
|
|
77
|
+
error: number
|
|
78
|
+
/** Whether the texture is visible. Used for layered textures mode */
|
|
79
|
+
visible: boolean
|
|
80
|
+
|
|
81
|
+
width: number
|
|
82
|
+
height: number
|
|
83
|
+
uv_width: number
|
|
84
|
+
uv_height: number
|
|
85
|
+
currentFrame: number
|
|
86
|
+
saved: boolean
|
|
87
|
+
/**
|
|
88
|
+
* Whether the latest version of the texture is currently loaded from and linked to a file on disk, or held in memory as bitmap data
|
|
89
|
+
* @deprecated Use texture.internal instead
|
|
90
|
+
*/
|
|
91
|
+
mode: 'link' | 'bitmap'
|
|
92
|
+
/**
|
|
93
|
+
* If true, the texture is loaded internally. If false, the texture is loaded directly from a file
|
|
94
|
+
*/
|
|
95
|
+
internal: boolean
|
|
96
|
+
uuid: UUID
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Texture selection in paint mode
|
|
100
|
+
*/
|
|
101
|
+
selection: IntMatrix
|
|
102
|
+
layers: TextureLayer[]
|
|
103
|
+
layers_enabled: boolean
|
|
104
|
+
/**
|
|
105
|
+
* The UUID of the project to sync the texture to
|
|
106
|
+
*/
|
|
107
|
+
sync_to_project: UUID | ''
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The texture's associated canvas. Since 4.9, this is the main source of truth for textures in internal mode.
|
|
111
|
+
*/
|
|
112
|
+
canvas: HTMLCanvasElement
|
|
113
|
+
/**
|
|
114
|
+
* The 2D context of the texture's associated canvas.
|
|
115
|
+
*/
|
|
116
|
+
ctx: CanvasRenderingContext2D
|
|
117
|
+
/**
|
|
118
|
+
* Texture image element
|
|
119
|
+
*/
|
|
120
|
+
img: HTMLImageElement
|
|
121
|
+
|
|
122
|
+
relative_path?: string
|
|
123
|
+
|
|
124
|
+
getErrorMessage(): string
|
|
125
|
+
extend(data: TextureData): this
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Get the UV width of the texture if the format uses per texture UV size, otherwise get the project texture width
|
|
129
|
+
*/
|
|
130
|
+
getUVWidth(): number
|
|
131
|
+
/**
|
|
132
|
+
* Get the UV height of the texture if the format uses per texture UV size, otherwise get the project texture height
|
|
133
|
+
*/
|
|
134
|
+
getUVHeight(): number
|
|
135
|
+
getUndoCopy(bitmap?: boolean): any
|
|
136
|
+
getSaveCopy(bitmap?: boolean): any
|
|
137
|
+
/**
|
|
138
|
+
* Start listening for changes to the linked file. Desktop only
|
|
139
|
+
*/
|
|
140
|
+
startWatcher(): void
|
|
141
|
+
/**
|
|
142
|
+
* Stop listening for changes to the linked file. Desktop only
|
|
143
|
+
*/
|
|
144
|
+
stopWatcher(): void
|
|
145
|
+
/**
|
|
146
|
+
* Generate the Java Block/Item folder property from the file path
|
|
147
|
+
*/
|
|
148
|
+
generateFolder(): void
|
|
149
|
+
/**
|
|
150
|
+
* Loads the texture from it's current source
|
|
151
|
+
* @param cb Callback function
|
|
152
|
+
*/
|
|
153
|
+
load(cb?: () => {}): this
|
|
154
|
+
fromJavaLink(link: string, path_array: string[]): this
|
|
155
|
+
fromFile(file: { name: string; content?: string; path: string }): this
|
|
156
|
+
fromPath(path: string): this
|
|
157
|
+
fromDataURL(data_url: string): this
|
|
158
|
+
fromDefaultPack(): true | undefined
|
|
159
|
+
/**
|
|
160
|
+
* Loads the default white error texture
|
|
161
|
+
* @param error_id Sets the error ID of the texture
|
|
162
|
+
*/
|
|
163
|
+
loadEmpty(error_id?: number): this
|
|
164
|
+
|
|
165
|
+
updateSource(dataUrl: string): this
|
|
166
|
+
updateMaterial(): this
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Opens a dialog to replace the texture with another file
|
|
170
|
+
* @param force If true, no warning appears of the texture has unsaved changes
|
|
171
|
+
*/
|
|
172
|
+
reopen(force: boolean): void
|
|
173
|
+
/**
|
|
174
|
+
* Reloads the texture. Only works in the desktop app
|
|
175
|
+
*/
|
|
176
|
+
reloadTexture(): void
|
|
177
|
+
getMaterial(): THREE.MeshLambertMaterial
|
|
178
|
+
select(event?: Event): this
|
|
179
|
+
/**
|
|
180
|
+
* Adds texture to the textures list and initializes it
|
|
181
|
+
* @param undo If true, an undo point is created
|
|
182
|
+
*/
|
|
183
|
+
add(undo?: boolean): Texture
|
|
184
|
+
/**
|
|
185
|
+
* Removes the texture
|
|
186
|
+
* @param no_update If true, the texture is silently removed. The interface is not updated, no undo point is created
|
|
187
|
+
*/
|
|
188
|
+
remove(no_update?: boolean): void
|
|
189
|
+
toggleVisibility(): this
|
|
190
|
+
enableParticle(): this
|
|
191
|
+
/**
|
|
192
|
+
* Enables 'particle' on this texture if it is not enabled on any other texture
|
|
193
|
+
*/
|
|
194
|
+
fillParticle(): this
|
|
195
|
+
/**
|
|
196
|
+
* Applies the texture to the selected elements
|
|
197
|
+
* @param all If true, the texture is applied to all faces of the elements. If 'blank', the texture is only applied to blank faces
|
|
198
|
+
*/
|
|
199
|
+
apply(all: true | false | 'blank'): this
|
|
200
|
+
/**
|
|
201
|
+
* Shows the texture file in the file explorer
|
|
202
|
+
*/
|
|
203
|
+
openFolder(): this
|
|
204
|
+
/**
|
|
205
|
+
* Opens the texture in the configured image editor
|
|
206
|
+
*/
|
|
207
|
+
openEditor(): this
|
|
208
|
+
showContextMenu(event: MouseEvent): void
|
|
209
|
+
openMenu(): void
|
|
210
|
+
resizeDialog(): this
|
|
211
|
+
/**
|
|
212
|
+
* Scroll the texture list to this texture
|
|
213
|
+
*/
|
|
214
|
+
scrollTo(): void
|
|
215
|
+
save(as: any): this
|
|
216
|
+
/**
|
|
217
|
+
* Returns the content of the texture as PNG as a base64 encoded string
|
|
218
|
+
*/
|
|
219
|
+
getBase64(): string
|
|
220
|
+
/**
|
|
221
|
+
* Returns the content of the texture as PNG as a base64 encoded data URL
|
|
222
|
+
*/
|
|
223
|
+
getDataURL(): string
|
|
224
|
+
/**
|
|
225
|
+
* Wrapper to do edits to the texture.
|
|
226
|
+
* @param callback
|
|
227
|
+
* @param options Editing options
|
|
228
|
+
*/
|
|
229
|
+
edit(
|
|
230
|
+
callback: (instance: HTMLCanvasElement | any) => void | HTMLCanvasElement,
|
|
231
|
+
options: TextureEditOptions
|
|
232
|
+
): void
|
|
233
|
+
menu: Menu
|
|
234
|
+
/**
|
|
235
|
+
* Get the selected layer. If no layer is selected, returns the bottom layer
|
|
236
|
+
*/
|
|
237
|
+
getActiveLayer(): TextureLayer
|
|
238
|
+
activateLayers(undo?: boolean): void
|
|
239
|
+
/**
|
|
240
|
+
* Turns the texture selection into a layer
|
|
241
|
+
* @param undo Whether to create an undo entry
|
|
242
|
+
* @param clone When true, the selection is copied into the new layer and also left on the original layer
|
|
243
|
+
*/
|
|
244
|
+
selectionToLayer(undo?: boolean, clone?: boolean): void
|
|
245
|
+
javaTextureLink(): string
|
|
246
|
+
|
|
247
|
+
getMCMetaContent(): {
|
|
248
|
+
animation?: {
|
|
249
|
+
frametime: number
|
|
250
|
+
width?: number
|
|
251
|
+
height?: number
|
|
252
|
+
interpolate?: boolean
|
|
253
|
+
frames?: number[]
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
getAnimationFrameIndices(): number[]
|
|
257
|
+
|
|
258
|
+
exportEmissionMap(): void
|
|
259
|
+
|
|
260
|
+
convertToInternal(data_url?: string): this
|
|
261
|
+
/**
|
|
262
|
+
* Redraws the texture content from the layers
|
|
263
|
+
* @param update_data_url If true, the texture source gets updated as well. This is slower, but is necessary at the end of an edit. During an edit, to preview changes, this can be false
|
|
264
|
+
*/
|
|
265
|
+
updateLayerChanges(update_data_url?: boolean): void
|
|
266
|
+
/**
|
|
267
|
+
* Update everything after a content edit to the texture or one of the layers. Updates the material, the layers, marks the texture as unsaved, syncs changes to other projects
|
|
268
|
+
*/
|
|
269
|
+
updateChangesAfterEdit(): void
|
|
270
|
+
/**
|
|
271
|
+
* Update the attached img element with the content from the texture's canvas
|
|
272
|
+
*/
|
|
273
|
+
updateImageFromCanvas(): void
|
|
274
|
+
/**
|
|
275
|
+
* If layers are enabled, returns the active layer, otherwise returns the texture. Either way, the 'canvas', 'ctx', and 'offset' properties can be used from the returned object
|
|
276
|
+
*/
|
|
277
|
+
getActiveCanvas(): Texture | TextureLayer
|
|
278
|
+
/**
|
|
279
|
+
* When editing the same texture in different tabs (via Edit In Blockbench option), sync changes that were made to the texture to other projects
|
|
280
|
+
*/
|
|
281
|
+
syncToOtherProject(): this
|
|
282
|
+
|
|
283
|
+
getUndoCopy(): Texture
|
|
284
|
+
|
|
285
|
+
static all: Texture[]
|
|
286
|
+
static getDefault(): Texture
|
|
179
287
|
}
|
|
180
288
|
/**
|
|
181
289
|
* Saves all textures
|
|
182
290
|
* @param lazy If true, the texture isn't saved if it doesn't have a local file to save to
|
|
183
291
|
*/
|
|
184
|
-
declare function saveTextures(lazy?: boolean): void
|
|
292
|
+
declare function saveTextures(lazy?: boolean): void
|
|
185
293
|
/**
|
|
186
294
|
* Update the draggable/sortable functionality of the texture list
|
|
187
295
|
*/
|
|
188
|
-
declare function loadTextureDraggable(): void
|
|
296
|
+
declare function loadTextureDraggable(): void
|
|
189
297
|
/**
|
|
190
298
|
* Unselect all textures
|
|
191
299
|
*/
|
|
192
|
-
declare function unselectTextures(): void
|
|
300
|
+
declare function unselectTextures(): void
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* An Int Matrix holds an int (unsigned 8 bit) for each pixel in a matrix, via array. The override property can be used to set an override value for the entire area. This is used for texture selections.
|
|
304
|
+
*/
|
|
305
|
+
declare class IntMatrix {
|
|
306
|
+
constructor(width: number, height: number)
|
|
307
|
+
width: number
|
|
308
|
+
height: number
|
|
309
|
+
array: null | Int8Array
|
|
310
|
+
/**
|
|
311
|
+
* The override can be set to true to indicate that the whole texture is selected, or false, which indicates that nothing is selected. Null indicates a custom selection
|
|
312
|
+
*/
|
|
313
|
+
override: boolean | null
|
|
314
|
+
/**
|
|
315
|
+
* True if there is a custom selection
|
|
316
|
+
*/
|
|
317
|
+
readonly is_custom: boolean
|
|
318
|
+
/**
|
|
319
|
+
* The array does not exist by default to save memory, this activates it.
|
|
320
|
+
*/
|
|
321
|
+
activate(): void
|
|
322
|
+
/**
|
|
323
|
+
* Get the value at the specified pixel
|
|
324
|
+
* @param x X coordinate
|
|
325
|
+
* @param y Y coordinate
|
|
326
|
+
* @returns The value of the targeted pixel
|
|
327
|
+
*/
|
|
328
|
+
get(x: number, y: number): number | boolean
|
|
329
|
+
/**
|
|
330
|
+
* Test whether painting is allowed at a specific pixel
|
|
331
|
+
* @param x X coordinate
|
|
332
|
+
* @param y Y coordinate
|
|
333
|
+
* @returns Boolean or value of the pixel
|
|
334
|
+
*/
|
|
335
|
+
allow(x: number, y: number): number | boolean
|
|
336
|
+
/**
|
|
337
|
+
* Get the value at the specified pixel directly without override and bounds check
|
|
338
|
+
* @param x X coordinate
|
|
339
|
+
* @param y Y coordinate
|
|
340
|
+
* @returns
|
|
341
|
+
*/
|
|
342
|
+
getDirect(x: number, y: number): number
|
|
343
|
+
/**
|
|
344
|
+
* Return the smallest possible rectangle that contains all of the selection
|
|
345
|
+
* @param respect_empty If true, if there is no selection, the bounding box will still cover the entire area
|
|
346
|
+
*/
|
|
347
|
+
getBoundingRect(respect_empty: boolean): Rectangle
|
|
348
|
+
/**
|
|
349
|
+
* Checks whether a selection is present and contains selected pixels
|
|
350
|
+
*/
|
|
351
|
+
hasSelection(): boolean
|
|
352
|
+
/**
|
|
353
|
+
* Set the value at a specified pixel
|
|
354
|
+
* @param {*} x X coordinate
|
|
355
|
+
* @param {*} y Y coordinate
|
|
356
|
+
* @param {number} value
|
|
357
|
+
*/
|
|
358
|
+
set(x: number, y: number, value: number): void
|
|
359
|
+
/**
|
|
360
|
+
* If there was a selection, whether override or not, clear it
|
|
361
|
+
*/
|
|
362
|
+
clear(): void
|
|
363
|
+
/**
|
|
364
|
+
* Change override mode
|
|
365
|
+
* @param {true|false|null} value
|
|
366
|
+
* @returns
|
|
367
|
+
*/
|
|
368
|
+
setOverride(value: boolean | null): void
|
|
369
|
+
/**
|
|
370
|
+
* Change the size of the matrix. Unless using overrides, the selection gets lost.
|
|
371
|
+
* @param {number} width
|
|
372
|
+
* @param {number} height
|
|
373
|
+
* @returns {boolean} Whether the size had to be changed
|
|
374
|
+
*/
|
|
375
|
+
changeSize(width: number, height: number): void
|
|
376
|
+
/**
|
|
377
|
+
* Run a method on each pixel, whether selected or not
|
|
378
|
+
* @param callback Function to run per pixel
|
|
379
|
+
*/
|
|
380
|
+
forEachPixel(callback: (x: number, y: number, value: number, index: number) => void): void
|
|
381
|
+
/**
|
|
382
|
+
* Shift custom selections by a specified offset
|
|
383
|
+
* @param offset_x
|
|
384
|
+
* @param offset_y
|
|
385
|
+
*/
|
|
386
|
+
translate(offset_x: number, offset_y: number): void
|
|
387
|
+
/**
|
|
388
|
+
* Return the selection simplified into non-overlapping boxes. Boxes are [x, y, width, height].
|
|
389
|
+
*/
|
|
390
|
+
toBoxes(): [number, number, number, number][]
|
|
391
|
+
/**
|
|
392
|
+
* Mask the provided canvas using the selection
|
|
393
|
+
* @param ctx Canvas 2D context
|
|
394
|
+
* @param offset Position offset of the canvas, e. g. when using a layer
|
|
395
|
+
*/
|
|
396
|
+
maskCanvas(ctx: CanvasRenderingContext2D, offset: ArrayVector2): void
|
|
397
|
+
}
|
|
193
398
|
|
|
194
399
|
/**
|
|
195
400
|
* Handles playback of animated textures
|
|
196
401
|
*/
|
|
197
402
|
declare namespace TextureAnimator {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
403
|
+
const isPlaying: boolean
|
|
404
|
+
const interval: any
|
|
405
|
+
function start(): void
|
|
406
|
+
function stop(): void
|
|
407
|
+
function toggle(): void
|
|
408
|
+
function updateSpeed(): void
|
|
409
|
+
function nextFrame(): void
|
|
410
|
+
function reset(): void
|
|
411
|
+
function updateButton(): void
|
|
412
|
+
}
|