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.
- package/README.md +30 -30
- package/custom/animation.d.ts +257 -256
- package/custom/animation_controller.d.ts +124 -124
- package/custom/blockbench.d.ts +73 -73
- package/custom/canvas.d.ts +324 -307
- package/custom/codec.d.ts +182 -182
- package/custom/copy_paste.d.ts +43 -42
- package/custom/cube.d.ts +151 -151
- package/custom/desktop.d.ts +61 -73
- package/custom/display_mode.d.ts +141 -137
- package/custom/edit_session.d.ts +38 -37
- package/custom/global.d.ts +181 -168
- package/custom/group.d.ts +113 -113
- package/custom/interface.d.ts +88 -78
- package/custom/io.d.ts +12 -12
- package/custom/{toolbars.d.ts → keybind.d.ts} +150 -221
- package/custom/keyframe.d.ts +94 -94
- package/custom/libs.d.ts +13 -13
- package/custom/menu_bar.d.ts +66 -0
- package/custom/mesh.d.ts +196 -196
- package/custom/misc.d.ts +196 -199
- package/custom/molang.d.ts +159 -159
- package/custom/outliner.d.ts +158 -158
- package/custom/painter.d.ts +102 -69
- package/custom/preview_scene.d.ts +120 -120
- package/custom/screencam.d.ts +71 -71
- package/custom/spline_mesh.d.ts +190 -189
- package/custom/texture_group.d.ts +68 -68
- package/custom/textures.d.ts +526 -515
- package/custom/timeline.d.ts +66 -66
- package/custom/undo.d.ts +209 -208
- package/custom/util/version_util.d.ts +32 -32
- package/custom/util.d.ts +235 -235
- package/custom/uveditor.d.ts +3 -3
- package/custom/validator.d.ts +99 -99
- package/documentation.md +12 -12
- package/generated/animations/mirror_animating.d.ts +7 -0
- package/generated/animations/timeline_animators.d.ts +1 -1
- package/generated/api.d.ts +8 -1
- package/generated/file_system.d.ts +2 -1
- package/generated/find_replace.d.ts +6 -0
- package/generated/formats/standards/obj.d.ts +9 -11
- package/generated/interface/actions.d.ts +16 -12
- package/generated/interface/form.d.ts +2 -1
- package/generated/interface/main_tools.d.ts +23 -0
- package/generated/interface/menu.d.ts +141 -0
- package/generated/interface/menu_bar.d.ts +2 -3
- package/generated/interface/resize_lines.d.ts +2 -0
- package/generated/interface/settings.d.ts +6 -2
- package/generated/interface/shared_actions.d.ts +5 -0
- package/generated/interface/start_screen.d.ts +62 -42
- package/generated/interface/toolbars.d.ts +146 -46
- package/generated/io/format.d.ts +1 -0
- package/generated/io/project.d.ts +10 -2
- package/generated/lib/CanvasFrame.d.ts +1 -0
- package/generated/main.d.ts +4 -1
- package/generated/modeling/mesh/add_mesh.d.ts +6 -0
- package/generated/modeling/mesh/proportional_edit.d.ts +15 -13
- package/generated/modeling/mesh/util.d.ts +8 -2
- package/generated/modeling/mirror_modeling.d.ts +4 -0
- package/generated/modeling/weight_paint.d.ts +11 -0
- package/generated/modes.d.ts +2 -2
- package/generated/native_apis.d.ts +3 -0
- package/generated/outliner/abstract/outliner_element.d.ts +1 -0
- package/generated/outliner/abstract/outliner_node.d.ts +1 -0
- package/generated/outliner/types/armature.d.ts +1 -1
- package/generated/outliner/types/armature_bone.d.ts +1 -1
- package/generated/outliner/types/billboard.d.ts +1 -1
- package/generated/outliner/types/bounding_box.d.ts +1 -1
- package/generated/outliner/types/cube.d.ts +1 -1
- package/generated/outliner/types/group.d.ts +1 -1
- package/generated/outliner/types/locator.d.ts +1 -1
- package/generated/outliner/types/mesh.d.ts +1 -1
- package/generated/outliner/types/null_object.d.ts +1 -1
- package/generated/outliner/types/spline_mesh.d.ts +1 -2
- package/generated/outliner/types/texture_mesh.d.ts +1 -1
- package/generated/plugin_loader.d.ts +1 -1
- package/generated/preview/preview.d.ts +280 -0
- package/generated/preview/reference_images.d.ts +1 -1
- package/generated/texturing/layers.d.ts +140 -0
- package/generated/util/gif.d.ts +12 -3
- package/generated/util/state_memory.d.ts +3 -11
- package/index.d.ts +2 -2
- package/package.json +39 -39
- package/tsconfig.json +19 -19
- package/type_config.json +43 -46
- package/custom/menu.d.ts +0 -136
- package/custom/preview.d.ts +0 -137
- package/custom/start_screen.d.ts +0 -15
- package/custom/texture_layers.d.ts +0 -117
- package/generated/global_types.d.ts +0 -47
- package/generated/io/formats/bedrock.d.ts +0 -4
- package/generated/io/formats/bedrock_old.d.ts +0 -4
- package/generated/io/formats/collada.d.ts +0 -4
- package/generated/io/formats/fbx.d.ts +0 -17
- package/generated/io/formats/gltf.d.ts +0 -6
- package/generated/io/formats/java_block.d.ts +0 -4
- package/generated/io/formats/modded_entity.d.ts +0 -139
- package/generated/io/formats/obj.d.ts +0 -12
- package/generated/io/formats/optifine_jem.d.ts +0 -3
- package/generated/io/formats/optifine_jpm.d.ts +0 -3
- package/generated/io/formats/skin.d.ts +0 -22
package/custom/painter.d.ts
CHANGED
|
@@ -1,69 +1,102 @@
|
|
|
1
|
-
/// <reference types="./blockbench"/>
|
|
2
|
-
/**
|
|
3
|
-
* A global namespace containing various functionality for Blockbench's 2D and 3D paint tools and texture editor
|
|
4
|
-
*/
|
|
5
|
-
declare namespace Painter {
|
|
6
|
-
const currentPixel: ArrayVector2
|
|
7
|
-
const brushChanges: boolean
|
|
8
|
-
let current: any
|
|
9
|
-
const selection: any
|
|
10
|
-
const mirror_painting: boolean
|
|
11
|
-
const lock_alpha: boolean
|
|
12
|
-
const erase_mode: boolean
|
|
13
|
-
const default_brush_presets: any[]
|
|
14
|
-
|
|
15
|
-
function edit(
|
|
16
|
-
texture: Texture,
|
|
17
|
-
callback: (canvas: HTMLCanvasElement) => void,
|
|
18
|
-
options: TextureEditOptions
|
|
19
|
-
): void
|
|
20
|
-
function setAlphaMatrix(texture: Texture, x: number, y: number, val: number): void
|
|
21
|
-
function getAlphaMatrix(texture: Texture, x: number, y: number): number
|
|
22
|
-
|
|
23
|
-
function combineColors(base: RGBAColor, added: RGBAColor, opacity: number): RGBAColor
|
|
24
|
-
function blendColors(
|
|
25
|
-
base: RGBAColor,
|
|
26
|
-
added: RGBAColor,
|
|
27
|
-
opacity: number,
|
|
28
|
-
blend_mode: string
|
|
29
|
-
): RGBAColor
|
|
30
|
-
function getMirrorElement(element: OutlinerElement, symmetry_axes: number[]): void
|
|
31
|
-
function updateNslideValues(): void
|
|
32
|
-
function getBlendModeCompositeOperation(): string
|
|
33
|
-
function
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
1
|
+
/// <reference types="./blockbench"/>
|
|
2
|
+
/**
|
|
3
|
+
* A global namespace containing various functionality for Blockbench's 2D and 3D paint tools and texture editor
|
|
4
|
+
*/
|
|
5
|
+
declare namespace Painter {
|
|
6
|
+
const currentPixel: ArrayVector2
|
|
7
|
+
const brushChanges: boolean
|
|
8
|
+
let current: any
|
|
9
|
+
const selection: any
|
|
10
|
+
const mirror_painting: boolean
|
|
11
|
+
const lock_alpha: boolean
|
|
12
|
+
const erase_mode: boolean
|
|
13
|
+
const default_brush_presets: any[]
|
|
14
|
+
|
|
15
|
+
function edit(
|
|
16
|
+
texture: Texture,
|
|
17
|
+
callback: (canvas: HTMLCanvasElement) => void,
|
|
18
|
+
options: TextureEditOptions
|
|
19
|
+
): void
|
|
20
|
+
function setAlphaMatrix(texture: Texture, x: number, y: number, val: number): void
|
|
21
|
+
function getAlphaMatrix(texture: Texture, x: number, y: number): number
|
|
22
|
+
|
|
23
|
+
function combineColors(base: RGBAColor, added: RGBAColor, opacity: number): RGBAColor
|
|
24
|
+
function blendColors(
|
|
25
|
+
base: RGBAColor,
|
|
26
|
+
added: RGBAColor,
|
|
27
|
+
opacity: number,
|
|
28
|
+
blend_mode: string
|
|
29
|
+
): RGBAColor
|
|
30
|
+
function getMirrorElement(element: OutlinerElement, symmetry_axes: number[]): void
|
|
31
|
+
function updateNslideValues(): void
|
|
32
|
+
function getBlendModeCompositeOperation(blend_mode?: string): string
|
|
33
|
+
function getCanvasToolPixelCoords(uv_point: {x: number, y: number}, texture: Texture): ArrayVector2
|
|
34
|
+
function getCanvas(texture: Texture): HTMLCanvasElement
|
|
35
|
+
function copyCanvas(original_canvas: HTMLCanvasElement): HTMLCanvasElement
|
|
36
|
+
function scanCanvas(
|
|
37
|
+
ctx: CanvasRenderingContext2D,
|
|
38
|
+
x: number,
|
|
39
|
+
y: number,
|
|
40
|
+
w: number,
|
|
41
|
+
h: number,
|
|
42
|
+
cb: ((px: number, py: number, color: [r: number, g: number, b: number, a: number]) => [number, number, number, number] | void)
|
|
43
|
+
): void
|
|
44
|
+
function getPixelColor(ctx: CanvasRenderingContext2D, x: number, y: number): tinycolor
|
|
45
|
+
function modifyCanvasSection(
|
|
46
|
+
ctx: CanvasRenderingContext2D,
|
|
47
|
+
x: number,
|
|
48
|
+
y: number,
|
|
49
|
+
w: number,
|
|
50
|
+
h: number,
|
|
51
|
+
cb: () => void
|
|
52
|
+
): void
|
|
53
|
+
function editCircle(
|
|
54
|
+
ctx: CanvasRenderingContext2D,
|
|
55
|
+
x: number,
|
|
56
|
+
y: number,
|
|
57
|
+
r: number,
|
|
58
|
+
softness: number,
|
|
59
|
+
editPx: (RGBAColor: any, opacity: number, px: number, py: number) => RGBAColor
|
|
60
|
+
): void
|
|
61
|
+
function editSquare(
|
|
62
|
+
ctx: CanvasRenderingContext2D,
|
|
63
|
+
x: number,
|
|
64
|
+
y: number,
|
|
65
|
+
r: number,
|
|
66
|
+
softness: number,
|
|
67
|
+
editPx: (RGBAColor: any, opacity: number, px: number, py: number) => RGBAColor
|
|
68
|
+
): void
|
|
69
|
+
function openBrushOptions(): void
|
|
70
|
+
function loadBrushPreset(preset: any): void
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare interface BarItemRegistry {
|
|
74
|
+
paint_secondary_color: KeybindItem
|
|
75
|
+
pan_tool: Tool
|
|
76
|
+
brush_tool: Tool
|
|
77
|
+
copy_brush: Tool
|
|
78
|
+
fill_tool: Tool
|
|
79
|
+
eraser: Tool
|
|
80
|
+
color_picker: Tool
|
|
81
|
+
draw_shape_tool: Tool
|
|
82
|
+
gradient_tool: Tool
|
|
83
|
+
move_layer_tool: Tool
|
|
84
|
+
brush_shape: BarSelect
|
|
85
|
+
draw_shape_type: BarSelect
|
|
86
|
+
blend_mode: BarSelect
|
|
87
|
+
fill_mode: BarSelect
|
|
88
|
+
copy_brush_mode: BarSelect
|
|
89
|
+
selection_tool_operation_mode: BarSelect
|
|
90
|
+
expand_texture_selection: Action
|
|
91
|
+
mirror_painting: Toggle
|
|
92
|
+
color_erase_mode: Toggle
|
|
93
|
+
lock_alpha: Toggle
|
|
94
|
+
painting_grid: Toggle
|
|
95
|
+
image_tiled_view: Toggle
|
|
96
|
+
image_onion_skin_view: Toggle
|
|
97
|
+
slider_brush_size: NumSlider
|
|
98
|
+
slider_brush_softness: NumSlider
|
|
99
|
+
slider_brush_opacity: NumSlider
|
|
100
|
+
pixel_perfect_drawing: Toggle
|
|
101
|
+
slider_color_select_threshold: NumSlider
|
|
102
|
+
}
|
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
/// <reference types="./blockbench"/>
|
|
2
|
-
interface PreviewModelCubeTemplate {
|
|
3
|
-
position: ArrayVector3
|
|
4
|
-
size: ArrayVector3
|
|
5
|
-
origin?: ArrayVector3
|
|
6
|
-
rotation?: ArrayVector3
|
|
7
|
-
faces: {
|
|
8
|
-
north?: { uv: ArrayVector4 }
|
|
9
|
-
east?: { uv: ArrayVector4 }
|
|
10
|
-
west?: { uv: ArrayVector4 }
|
|
11
|
-
south?: { uv: ArrayVector4 }
|
|
12
|
-
up?: { uv: ArrayVector4 }
|
|
13
|
-
down?: { uv: ArrayVector4 }
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface PreviewModelOptions {
|
|
18
|
-
condition?: ConditionResolvable
|
|
19
|
-
cubes: PreviewModelCubeTemplate[]
|
|
20
|
-
/**
|
|
21
|
-
* Source of the model's texture
|
|
22
|
-
*/
|
|
23
|
-
texture?: string
|
|
24
|
-
/**
|
|
25
|
-
* Model tint color
|
|
26
|
-
*/
|
|
27
|
-
color?: string
|
|
28
|
-
/**
|
|
29
|
-
* Enable shading on the material
|
|
30
|
-
*/
|
|
31
|
-
shading?: boolean
|
|
32
|
-
/**
|
|
33
|
-
* THREE.JS material render side
|
|
34
|
-
*/
|
|
35
|
-
render_side?: number
|
|
36
|
-
texture_size?: [number, number]
|
|
37
|
-
onUpdate?(): void
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
declare class PreviewModel extends Deletable {
|
|
41
|
-
constructor(id: string, options: PreviewModelOptions)
|
|
42
|
-
|
|
43
|
-
static models: {
|
|
44
|
-
[id: string]: PreviewModel
|
|
45
|
-
}
|
|
46
|
-
static getActiveModels(): PreviewModel[]
|
|
47
|
-
|
|
48
|
-
id: string
|
|
49
|
-
model_3d: THREE.Object3D
|
|
50
|
-
cubes: PreviewModelCubeTemplate[]
|
|
51
|
-
texture?: string
|
|
52
|
-
color?: string
|
|
53
|
-
shading: boolean
|
|
54
|
-
render_side: number
|
|
55
|
-
texture_size: [number, number]
|
|
56
|
-
onUpdate?: () => void
|
|
57
|
-
/**
|
|
58
|
-
* Enables the model in the preview
|
|
59
|
-
*/
|
|
60
|
-
enable(): void
|
|
61
|
-
/**
|
|
62
|
-
* Disables the model in the preview
|
|
63
|
-
*/
|
|
64
|
-
disable(): boolean
|
|
65
|
-
/**
|
|
66
|
-
* Update the appearance and visibility of the model
|
|
67
|
-
*/
|
|
68
|
-
update(): void
|
|
69
|
-
buildModel(): void
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
interface PreviewSceneOptions {
|
|
73
|
-
name?: string
|
|
74
|
-
description?: string
|
|
75
|
-
category?: string
|
|
76
|
-
light_color?: string
|
|
77
|
-
light_side?: number
|
|
78
|
-
condition?: ConditionResolvable
|
|
79
|
-
preview_models?: string[]
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
declare class PreviewScene extends Deletable {
|
|
83
|
-
constructor(id: string, options: PreviewSceneOptions)
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* All preview scenes, listed by ID
|
|
87
|
-
*/
|
|
88
|
-
static scenes: Record<string, PreviewScene>
|
|
89
|
-
/**
|
|
90
|
-
* The currently active scene
|
|
91
|
-
*/
|
|
92
|
-
static active: PreviewScene | null
|
|
93
|
-
/**
|
|
94
|
-
* The URL to the source repository that scenes are pulled from
|
|
95
|
-
*/
|
|
96
|
-
static source_repository: string
|
|
97
|
-
static menu_categories: {
|
|
98
|
-
[category_id: string]: {
|
|
99
|
-
[id: string]: string
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
id: string
|
|
104
|
-
name: string
|
|
105
|
-
description: string
|
|
106
|
-
category?: string
|
|
107
|
-
light_color: string
|
|
108
|
-
light_side: number
|
|
109
|
-
condition?: ConditionResolvable
|
|
110
|
-
preview_models: string[]
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Selects this preview scene
|
|
114
|
-
*/
|
|
115
|
-
select(): void
|
|
116
|
-
/**
|
|
117
|
-
* Unselects this preview scene
|
|
118
|
-
*/
|
|
119
|
-
unselect(): void
|
|
120
|
-
}
|
|
1
|
+
/// <reference types="./blockbench"/>
|
|
2
|
+
interface PreviewModelCubeTemplate {
|
|
3
|
+
position: ArrayVector3
|
|
4
|
+
size: ArrayVector3
|
|
5
|
+
origin?: ArrayVector3
|
|
6
|
+
rotation?: ArrayVector3
|
|
7
|
+
faces: {
|
|
8
|
+
north?: { uv: ArrayVector4 }
|
|
9
|
+
east?: { uv: ArrayVector4 }
|
|
10
|
+
west?: { uv: ArrayVector4 }
|
|
11
|
+
south?: { uv: ArrayVector4 }
|
|
12
|
+
up?: { uv: ArrayVector4 }
|
|
13
|
+
down?: { uv: ArrayVector4 }
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface PreviewModelOptions {
|
|
18
|
+
condition?: ConditionResolvable
|
|
19
|
+
cubes: PreviewModelCubeTemplate[]
|
|
20
|
+
/**
|
|
21
|
+
* Source of the model's texture
|
|
22
|
+
*/
|
|
23
|
+
texture?: string
|
|
24
|
+
/**
|
|
25
|
+
* Model tint color
|
|
26
|
+
*/
|
|
27
|
+
color?: string
|
|
28
|
+
/**
|
|
29
|
+
* Enable shading on the material
|
|
30
|
+
*/
|
|
31
|
+
shading?: boolean
|
|
32
|
+
/**
|
|
33
|
+
* THREE.JS material render side
|
|
34
|
+
*/
|
|
35
|
+
render_side?: number
|
|
36
|
+
texture_size?: [number, number]
|
|
37
|
+
onUpdate?(): void
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare class PreviewModel extends Deletable {
|
|
41
|
+
constructor(id: string, options: PreviewModelOptions)
|
|
42
|
+
|
|
43
|
+
static models: {
|
|
44
|
+
[id: string]: PreviewModel
|
|
45
|
+
}
|
|
46
|
+
static getActiveModels(): PreviewModel[]
|
|
47
|
+
|
|
48
|
+
id: string
|
|
49
|
+
model_3d: THREE.Object3D
|
|
50
|
+
cubes: PreviewModelCubeTemplate[]
|
|
51
|
+
texture?: string
|
|
52
|
+
color?: string
|
|
53
|
+
shading: boolean
|
|
54
|
+
render_side: number
|
|
55
|
+
texture_size: [number, number]
|
|
56
|
+
onUpdate?: () => void
|
|
57
|
+
/**
|
|
58
|
+
* Enables the model in the preview
|
|
59
|
+
*/
|
|
60
|
+
enable(): void
|
|
61
|
+
/**
|
|
62
|
+
* Disables the model in the preview
|
|
63
|
+
*/
|
|
64
|
+
disable(): boolean
|
|
65
|
+
/**
|
|
66
|
+
* Update the appearance and visibility of the model
|
|
67
|
+
*/
|
|
68
|
+
update(): void
|
|
69
|
+
buildModel(): void
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
interface PreviewSceneOptions {
|
|
73
|
+
name?: string
|
|
74
|
+
description?: string
|
|
75
|
+
category?: string
|
|
76
|
+
light_color?: string
|
|
77
|
+
light_side?: number
|
|
78
|
+
condition?: ConditionResolvable
|
|
79
|
+
preview_models?: string[]
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare class PreviewScene extends Deletable {
|
|
83
|
+
constructor(id: string, options: PreviewSceneOptions)
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* All preview scenes, listed by ID
|
|
87
|
+
*/
|
|
88
|
+
static scenes: Record<string, PreviewScene>
|
|
89
|
+
/**
|
|
90
|
+
* The currently active scene
|
|
91
|
+
*/
|
|
92
|
+
static active: PreviewScene | null
|
|
93
|
+
/**
|
|
94
|
+
* The URL to the source repository that scenes are pulled from
|
|
95
|
+
*/
|
|
96
|
+
static source_repository: string
|
|
97
|
+
static menu_categories: {
|
|
98
|
+
[category_id: string]: {
|
|
99
|
+
[id: string]: string
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
id: string
|
|
104
|
+
name: string
|
|
105
|
+
description: string
|
|
106
|
+
category?: string
|
|
107
|
+
light_color: string
|
|
108
|
+
light_side: number
|
|
109
|
+
condition?: ConditionResolvable
|
|
110
|
+
preview_models: string[]
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Selects this preview scene
|
|
114
|
+
*/
|
|
115
|
+
select(): void
|
|
116
|
+
/**
|
|
117
|
+
* Unselects this preview scene
|
|
118
|
+
*/
|
|
119
|
+
unselect(): void
|
|
120
|
+
}
|
package/custom/screencam.d.ts
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
/// <reference types="./blockbench"/>
|
|
2
|
-
interface ScreenshotOptions {
|
|
3
|
-
crop?: boolean
|
|
4
|
-
width?: number
|
|
5
|
-
height?: number
|
|
6
|
-
}
|
|
7
|
-
interface RecordGIFOptions {
|
|
8
|
-
fps: number
|
|
9
|
-
format?: 'gif' | 'apng' | 'png_sequence'
|
|
10
|
-
length_mode?: 'seconds' | 'frames' | 'turntable' | 'animation'
|
|
11
|
-
length?: number
|
|
12
|
-
pixelate?: number
|
|
13
|
-
quality?: number
|
|
14
|
-
background: string
|
|
15
|
-
background_image?: string
|
|
16
|
-
turnspeed?: string
|
|
17
|
-
/** Start playing the selected animation when the animation starts */
|
|
18
|
-
play?: boolean
|
|
19
|
-
repeat?: any
|
|
20
|
-
/** Disable all UI feedback about GIF recording */
|
|
21
|
-
silent?: boolean
|
|
22
|
-
}
|
|
23
|
-
interface RecordTimelapseOptions {
|
|
24
|
-
/** Destination oath */
|
|
25
|
-
destination: string
|
|
26
|
-
source: 'preview' | 'locked' | 'interface'
|
|
27
|
-
/** Interval between frames in seconds */
|
|
28
|
-
interval: number
|
|
29
|
-
}
|
|
30
|
-
type ScreenshotReturn = (dataURL: string) => void
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* A global namespace handling screenshot and GIF recording utilities.
|
|
34
|
-
*/
|
|
35
|
-
declare namespace Screencam {
|
|
36
|
-
/**
|
|
37
|
-
* Provided preview with anti aliasing disabled that can be used for screenshots
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Whether a timelapse is currently being recorded
|
|
42
|
-
*/
|
|
43
|
-
const recording_timelapse: boolean
|
|
44
|
-
const gif_options_dialog: Dialog
|
|
45
|
-
const gif_crop: { top: number; left: number; right: number; bottom: number }
|
|
46
|
-
|
|
47
|
-
function screenshotPreview(
|
|
48
|
-
preview: Preview,
|
|
49
|
-
options: ScreenshotOptions,
|
|
50
|
-
cb: ScreenshotReturn
|
|
51
|
-
): void
|
|
52
|
-
|
|
53
|
-
function fullScreen(options: ScreenshotOptions, cb: ScreenshotReturn): void
|
|
54
|
-
|
|
55
|
-
function screenshot2DEditor(options: ScreenshotOptions, cb: ScreenshotReturn): void
|
|
56
|
-
|
|
57
|
-
function returnScreenshot(dataUrl: any, cb: ScreenshotReturn, blob: any): void
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Runs callback in a clean canvas, where only the model is visible and the control gizmos are hidden
|
|
61
|
-
* @param options
|
|
62
|
-
* @param cb
|
|
63
|
-
*/
|
|
64
|
-
function cleanCanvas(options: any, cb: ScreenshotReturn): void
|
|
65
|
-
|
|
66
|
-
function createGif(options: RecordGIFOptions, cb: ScreenshotReturn): void
|
|
67
|
-
|
|
68
|
-
function recordTimelapse(options: RecordTimelapseOptions): void
|
|
69
|
-
|
|
70
|
-
function stopTimelapse(): void
|
|
71
|
-
}
|
|
1
|
+
/// <reference types="./blockbench"/>
|
|
2
|
+
interface ScreenshotOptions {
|
|
3
|
+
crop?: boolean
|
|
4
|
+
width?: number
|
|
5
|
+
height?: number
|
|
6
|
+
}
|
|
7
|
+
interface RecordGIFOptions {
|
|
8
|
+
fps: number
|
|
9
|
+
format?: 'gif' | 'apng' | 'png_sequence'
|
|
10
|
+
length_mode?: 'seconds' | 'frames' | 'turntable' | 'animation'
|
|
11
|
+
length?: number
|
|
12
|
+
pixelate?: number
|
|
13
|
+
quality?: number
|
|
14
|
+
background: string
|
|
15
|
+
background_image?: string
|
|
16
|
+
turnspeed?: string
|
|
17
|
+
/** Start playing the selected animation when the animation starts */
|
|
18
|
+
play?: boolean
|
|
19
|
+
repeat?: any
|
|
20
|
+
/** Disable all UI feedback about GIF recording */
|
|
21
|
+
silent?: boolean
|
|
22
|
+
}
|
|
23
|
+
interface RecordTimelapseOptions {
|
|
24
|
+
/** Destination oath */
|
|
25
|
+
destination: string
|
|
26
|
+
source: 'preview' | 'locked' | 'interface'
|
|
27
|
+
/** Interval between frames in seconds */
|
|
28
|
+
interval: number
|
|
29
|
+
}
|
|
30
|
+
type ScreenshotReturn = (dataURL: string) => void
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A global namespace handling screenshot and GIF recording utilities.
|
|
34
|
+
*/
|
|
35
|
+
declare namespace Screencam {
|
|
36
|
+
/**
|
|
37
|
+
* Provided preview with anti aliasing disabled that can be used for screenshots
|
|
38
|
+
*/
|
|
39
|
+
let NoAAPreview: Preview
|
|
40
|
+
/**
|
|
41
|
+
* Whether a timelapse is currently being recorded
|
|
42
|
+
*/
|
|
43
|
+
const recording_timelapse: boolean
|
|
44
|
+
const gif_options_dialog: Dialog
|
|
45
|
+
const gif_crop: { top: number; left: number; right: number; bottom: number }
|
|
46
|
+
|
|
47
|
+
function screenshotPreview(
|
|
48
|
+
preview: Preview,
|
|
49
|
+
options: ScreenshotOptions,
|
|
50
|
+
cb: ScreenshotReturn
|
|
51
|
+
): void
|
|
52
|
+
|
|
53
|
+
function fullScreen(options: ScreenshotOptions, cb: ScreenshotReturn): void
|
|
54
|
+
|
|
55
|
+
function screenshot2DEditor(options: ScreenshotOptions, cb: ScreenshotReturn): void
|
|
56
|
+
|
|
57
|
+
function returnScreenshot(dataUrl: any, cb: ScreenshotReturn, blob: any): void
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Runs callback in a clean canvas, where only the model is visible and the control gizmos are hidden
|
|
61
|
+
* @param options
|
|
62
|
+
* @param cb
|
|
63
|
+
*/
|
|
64
|
+
function cleanCanvas(options: any, cb: ScreenshotReturn): void
|
|
65
|
+
|
|
66
|
+
function createGif(options: RecordGIFOptions, cb: ScreenshotReturn): void
|
|
67
|
+
|
|
68
|
+
function recordTimelapse(options: RecordTimelapseOptions): void
|
|
69
|
+
|
|
70
|
+
function stopTimelapse(): void
|
|
71
|
+
}
|