blockbench-types 5.0.6 → 5.1.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.
- package/custom/action.d.ts +3 -3
- package/custom/animation.d.ts +1 -0
- package/custom/cube.d.ts +1 -20
- package/custom/group.d.ts +1 -1
- package/custom/mesh.d.ts +1 -0
- package/custom/misc.d.ts +3 -1
- package/custom/molang.d.ts +5 -4
- package/custom/outliner.d.ts +99 -66
- package/custom/preview_scene.d.ts +3 -1
- package/custom/util.d.ts +7 -12
- package/generated/animations/timeline_animators.d.ts +2 -1
- package/generated/api.d.ts +84 -6
- package/generated/auto_backup.d.ts +48 -0
- package/generated/file_system.d.ts +6 -1
- package/generated/interface/dialog.d.ts +16 -0
- package/generated/interface/form.d.ts +8 -0
- package/generated/interface/panels.d.ts +20 -0
- package/generated/interface/settings.d.ts +46 -0
- package/generated/interface/start_screen.d.ts +1 -16
- package/generated/interface/themes.d.ts +6 -0
- package/generated/io/format.d.ts +9 -1
- package/generated/io/formats/bedrock_old.d.ts +1 -1
- package/generated/languages.d.ts +45 -0
- package/generated/lib/CanvasFrame.d.ts +6 -1
- package/generated/main.d.ts +10 -11
- package/generated/misc.d.ts +0 -11
- package/generated/modeling/mirror_modeling.d.ts +25 -1
- package/generated/modeling/scale.d.ts +1 -9
- package/generated/modes.d.ts +20 -0
- package/generated/outliner/abstract/face.d.ts +40 -0
- package/generated/outliner/abstract/outliner_element.d.ts +42 -0
- package/generated/outliner/abstract/outliner_node.d.ts +96 -0
- package/generated/outliner/billboard.d.ts +0 -1
- package/generated/outliner/collections.d.ts +7 -2
- package/generated/outliner/spline_mesh.d.ts +0 -1
- package/generated/outliner/types/armature.d.ts +59 -0
- package/generated/outliner/types/armature_bone.d.ts +90 -0
- package/generated/outliner/types/billboard.d.ts +80 -0
- package/generated/outliner/types/cube.d.ts +169 -0
- package/generated/outliner/types/group.d.ts +65 -0
- package/generated/outliner/types/locator.d.ts +26 -0
- package/generated/outliner/types/mesh.d.ts +115 -0
- package/generated/outliner/types/null_object.d.ts +22 -0
- package/generated/outliner/types/spline_mesh.d.ts +219 -0
- package/generated/outliner/types/texture_mesh.d.ts +26 -0
- package/generated/plugin_loader.d.ts +43 -0
- package/generated/preview/reference_images.d.ts +1 -1
- package/generated/util/event_system.d.ts +6 -0
- package/generated/util/json.d.ts +17 -0
- package/generated/util/molang.d.ts +8 -1
- package/generated/util/property.d.ts +6 -0
- package/generated/util/state_memory.d.ts +14 -1
- package/package.json +1 -1
- package/custom/io.d.ts +0 -2
package/custom/action.d.ts
CHANGED
|
@@ -523,18 +523,18 @@ declare global {
|
|
|
523
523
|
get(): number
|
|
524
524
|
}
|
|
525
525
|
interface BarSelectOptions<T> extends WidgetOptions {
|
|
526
|
-
value?:
|
|
526
|
+
value?: string
|
|
527
527
|
options: Record<string, T>
|
|
528
528
|
}
|
|
529
529
|
class BarSelect<T> extends Widget {
|
|
530
530
|
constructor(id: string, options: BarSelectOptions<T>)
|
|
531
531
|
open(event: Event): void
|
|
532
532
|
trigger(event: Event): boolean | undefined
|
|
533
|
-
change(value:
|
|
533
|
+
change(value: string, event: Event): this
|
|
534
534
|
getNameFor(key: string): string
|
|
535
535
|
set(key: string): this
|
|
536
536
|
get(): string
|
|
537
|
-
value:
|
|
537
|
+
value: string
|
|
538
538
|
}
|
|
539
539
|
class BarText extends Widget {
|
|
540
540
|
constructor(
|
package/custom/animation.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ declare class _Animation extends AnimationItem {
|
|
|
71
71
|
* Returns (if necessary creates) the animator of a specific outliner node of this animation
|
|
72
72
|
*/
|
|
73
73
|
getBoneAnimator(node?: OutlinerNode): BoneAnimator
|
|
74
|
+
removeAnimator(id: string): void
|
|
74
75
|
/**
|
|
75
76
|
* Adds the animation to the current project and to the interface
|
|
76
77
|
* @param undo If true, the addition of the animation will be registered as an edit
|
package/custom/cube.d.ts
CHANGED
|
@@ -82,7 +82,7 @@ declare class Cube extends OutlinerElement {
|
|
|
82
82
|
*/
|
|
83
83
|
size(axis: number, floored?: boolean): number
|
|
84
84
|
rotationAxis(): string
|
|
85
|
-
getUndoCopy(aspects?: any):
|
|
85
|
+
getUndoCopy(aspects?: any): any
|
|
86
86
|
getSaveCopy(): Cube
|
|
87
87
|
/**
|
|
88
88
|
* Rotate the cube around axis in 90 degree steps
|
|
@@ -124,25 +124,6 @@ declare class Cube extends OutlinerElement {
|
|
|
124
124
|
interface FaceOptions {
|
|
125
125
|
texture?: Texture | UUID | false
|
|
126
126
|
}
|
|
127
|
-
declare class Face {
|
|
128
|
-
constructor()
|
|
129
|
-
texture: UUID | false | undefined
|
|
130
|
-
|
|
131
|
-
getTexture(): Texture | undefined
|
|
132
|
-
/**
|
|
133
|
-
* Returns a 2D rectangle around the UV face
|
|
134
|
-
*/
|
|
135
|
-
getBoundingRect(): any
|
|
136
|
-
reset(): void
|
|
137
|
-
/**
|
|
138
|
-
* Returns a save copy of the face, ready for serialization
|
|
139
|
-
*/
|
|
140
|
-
getSaveCopy(): any
|
|
141
|
-
/**
|
|
142
|
-
* Get a copy for undo tracking
|
|
143
|
-
*/
|
|
144
|
-
getUndoCopy(): Face
|
|
145
|
-
}
|
|
146
127
|
|
|
147
128
|
type CubeFaceDirection = 'north' | 'south' | 'east' | 'west' | 'up' | 'down'
|
|
148
129
|
interface CubeFaceOptions extends FaceOptions {
|
package/custom/group.d.ts
CHANGED
package/custom/mesh.d.ts
CHANGED
package/custom/misc.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ type EventName =
|
|
|
37
37
|
| 'process_chat_message'
|
|
38
38
|
| 'loaded_plugin'
|
|
39
39
|
| 'unloaded_plugin'
|
|
40
|
+
| 'installed_plugin'
|
|
41
|
+
| 'uninstalled_plugin'
|
|
40
42
|
| 'update_settings'
|
|
41
43
|
| 'update_project_settings'
|
|
42
44
|
| 'save_project'
|
|
@@ -137,7 +139,7 @@ declare function updateSelection(): void
|
|
|
137
139
|
|
|
138
140
|
declare var LZUTF8: any
|
|
139
141
|
|
|
140
|
-
declare function unselectAllElements(): void
|
|
142
|
+
declare function unselectAllElements(exceptions?: OutlinerNode[]): void
|
|
141
143
|
declare function updateCubeHighlights(hover_cube: Cube, force_off: boolean): void
|
|
142
144
|
declare function getRescalingFactor(angle: number): number
|
|
143
145
|
|
package/custom/molang.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import MolangParser from "molangjs"
|
|
2
|
+
|
|
3
|
+
type MolangParserClass = typeof MolangParser
|
|
4
|
+
declare global {
|
|
5
|
+
const MolangParser: MolangParserClass
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
declare interface MolangExpression {
|
package/custom/outliner.d.ts
CHANGED
|
@@ -12,105 +12,138 @@ declare const elements: OutlinerNode[]
|
|
|
12
12
|
/**
|
|
13
13
|
* @private
|
|
14
14
|
*/
|
|
15
|
-
declare class OutlinerNode {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
static
|
|
29
|
-
|
|
30
|
-
|
|
15
|
+
declare abstract class OutlinerNode {
|
|
16
|
+
name: string;
|
|
17
|
+
uuid: UUID;
|
|
18
|
+
export: boolean;
|
|
19
|
+
locked: boolean;
|
|
20
|
+
parent: (OutlinerNode & OutlinerNodeParentTraits) | 'root';
|
|
21
|
+
selected: boolean;
|
|
22
|
+
menu?: Menu;
|
|
23
|
+
old_name?: string;
|
|
24
|
+
children?: OutlinerNode[];
|
|
25
|
+
name_regex: ((element?: OutlinerNode) => string | boolean) | undefined;
|
|
26
|
+
static animator?: BoneAnimator;
|
|
27
|
+
static isParent: false;
|
|
28
|
+
static all: OutlinerNode[];
|
|
29
|
+
static selected: OutlinerNode[];
|
|
30
|
+
static preview_controller: NodePreviewController;
|
|
31
|
+
static properties: Record<string, Property<any>>;
|
|
32
|
+
static behavior: Record<string, any>;
|
|
33
|
+
get preview_controller(): NodePreviewController;
|
|
31
34
|
/**
|
|
32
|
-
*
|
|
35
|
+
* Mark the element as selected
|
|
33
36
|
*/
|
|
34
|
-
|
|
35
|
-
extend(data: any): void
|
|
36
|
-
addTo(target?: OutlinerNode | 'root'): this
|
|
37
|
-
sortInBefore(target?: OutlinerNode, index_modifier?: number): this
|
|
38
|
-
select(event?: any, isOutlinerClick?: boolean): this
|
|
37
|
+
markAsSelected(descendants?: boolean): void;
|
|
39
38
|
/**
|
|
40
|
-
*
|
|
39
|
+
* Displays the context menu of the element
|
|
40
|
+
* @param event Mouse event, determines where the context menu spawns.
|
|
41
|
+
*/
|
|
42
|
+
showContexMenu(event: Event | HTMLElement): this;
|
|
43
|
+
getSaveCopy?(...args: any[]): Record<string, any>;
|
|
44
|
+
extend?(data: any): void;
|
|
45
|
+
constructor(uuid: UUID);
|
|
46
|
+
/**
|
|
47
|
+
* Initializes the node. This should always be called when creating nodes that will be used in the outliner.
|
|
41
48
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
init(): this;
|
|
50
|
+
select(event?: Event, outliner_click?: boolean): false | this;
|
|
51
|
+
unselect(unselect_parent?: boolean): void;
|
|
52
|
+
clickSelect(event: MouseEvent, outliner_click?: boolean): void;
|
|
53
|
+
getTypeBehavior(flag: string): boolean | string | any;
|
|
54
|
+
sortInBefore(element?: OutlinerNode, index_modifier?: number): this;
|
|
55
|
+
addTo(target?: OutlinerNode | 'root', index?: number): this;
|
|
56
|
+
removeFromParent(): this;
|
|
57
|
+
getParentArray(): OutlinerNode[];
|
|
58
|
+
showContextMenu(event: any): this;
|
|
44
59
|
/**
|
|
45
60
|
* Unfolds the outliner and scrolls up or down if necessary to show the group or element.
|
|
46
61
|
*/
|
|
47
|
-
showInOutliner():
|
|
62
|
+
showInOutliner(): void;
|
|
48
63
|
/**
|
|
49
64
|
* Updates the Vue node of the element. This is only necessary in some rare situations
|
|
50
65
|
*/
|
|
51
|
-
updateElement(): this
|
|
66
|
+
updateElement(): this;
|
|
67
|
+
get mesh(): import("three").Object3D;
|
|
68
|
+
get scene_object(): THREE.Object3D;
|
|
69
|
+
getDepth(): number;
|
|
70
|
+
duplicate(): OutlinerNode;
|
|
52
71
|
/**
|
|
53
|
-
* Removes the
|
|
72
|
+
* Removes the node.
|
|
54
73
|
*/
|
|
55
|
-
remove(
|
|
74
|
+
remove(remove_children?: boolean): void;
|
|
56
75
|
/**
|
|
57
76
|
* Marks the name of the group or element in the outliner for renaming.
|
|
58
77
|
*/
|
|
59
|
-
rename(): this
|
|
78
|
+
rename(): this;
|
|
60
79
|
/**
|
|
61
80
|
* Saves the changed name of the element by creating an undo point and making the name unique if necessary.
|
|
62
81
|
*/
|
|
63
|
-
saveName(save?: boolean): this
|
|
82
|
+
saveName(save?: boolean): this;
|
|
83
|
+
sanitizeName(): string;
|
|
64
84
|
/**
|
|
65
85
|
* Create a unique name for the group or element by adding a number at the end or increasing it.
|
|
66
86
|
*/
|
|
67
|
-
createUniqueName(others?: OutlinerNode[]):
|
|
87
|
+
createUniqueName(others?: OutlinerNode[]): string | false;
|
|
88
|
+
isIconEnabled(toggle: any): any;
|
|
89
|
+
matchesFilter(search_term_lowercase: any): any;
|
|
68
90
|
/**
|
|
69
91
|
* Checks of the group or element is a child of `group`.
|
|
70
92
|
* @param max_levels The maximum number of generations that can be between the element and the group
|
|
71
93
|
*/
|
|
72
|
-
isChildOf(node: OutlinerNode, max_levels: number): boolean
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
sanitizeName(): string
|
|
80
|
-
|
|
81
|
-
getTypeBehavior(flag: string): boolean | string | any
|
|
82
|
-
|
|
83
|
-
static addBehaviorOverride(override_options: {condition: ConditionResolvable, priority?: number, behavior: Record<string, any>}): Deletable
|
|
84
|
-
static behavior_overrides = [];
|
|
85
|
-
|
|
94
|
+
isChildOf(node: OutlinerNode, max_levels: number): boolean;
|
|
95
|
+
static addBehaviorOverride(override_options: {
|
|
96
|
+
condition: ConditionResolvable;
|
|
97
|
+
priority?: number;
|
|
98
|
+
behavior: Record<string, any>;
|
|
99
|
+
}): Deletable;
|
|
100
|
+
static behavior_overrides: any[];
|
|
86
101
|
static uuids: {
|
|
87
|
-
[uuid: UUID]: OutlinerNode
|
|
88
|
-
}
|
|
102
|
+
[uuid: UUID]: OutlinerNode;
|
|
103
|
+
};
|
|
104
|
+
type: string;
|
|
89
105
|
}
|
|
90
106
|
|
|
107
|
+
|
|
91
108
|
/**
|
|
92
109
|
* @private
|
|
93
110
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
static
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
111
|
+
type ElementTypeConstructor = {
|
|
112
|
+
new (...args: any[]): OutlinerElement;
|
|
113
|
+
init?(): void;
|
|
114
|
+
behavior: any;
|
|
115
|
+
properties: Record<string, Property<any>>
|
|
116
|
+
selected: OutlinerElement[]
|
|
117
|
+
};
|
|
118
|
+
interface OutlinerElementData {
|
|
119
|
+
name?: string;
|
|
120
|
+
}
|
|
121
|
+
declare abstract class OutlinerElement extends OutlinerNode {
|
|
122
|
+
allow_mirror_modeling?: boolean;
|
|
123
|
+
static animator?: BoneAnimator;
|
|
124
|
+
static isParent: false;
|
|
125
|
+
static all: OutlinerElement[];
|
|
126
|
+
static selected: OutlinerElement[];
|
|
127
|
+
constructor(data: OutlinerElementData, uuid?: string);
|
|
128
|
+
init(): this;
|
|
129
|
+
remove(): this;
|
|
130
|
+
showContextMenu(event: MouseEvent): this;
|
|
131
|
+
forSelected(fc: (element: OutlinerElement) => void, undo_tag?: string, selection_method?: 'all_selected' | 'all_in_group'): OutlinerElement[];
|
|
132
|
+
duplicate(): OutlinerElement;
|
|
133
|
+
select(event?: Event, is_outliner_click?: boolean): false | this;
|
|
134
|
+
clickSelect(event: any, outliner_click?: boolean): void;
|
|
135
|
+
markAsSelected(select_children?: boolean): this;
|
|
136
|
+
unselect(unselect_parent?: boolean): this;
|
|
137
|
+
getUndoCopy(): OutlinerElement;
|
|
138
|
+
getSaveCopy(): any;
|
|
139
|
+
static fromSave(obj: any, keep_uuid?: boolean): OutlinerElement;
|
|
140
|
+
static isTypePermitted(type: string): boolean;
|
|
110
141
|
/**Check if any elements of the type are in the project */
|
|
111
|
-
static hasAny
|
|
142
|
+
static hasAny(): boolean;
|
|
112
143
|
/**Check if any elements of the type are currently selected */
|
|
113
|
-
static hasSelected
|
|
144
|
+
static hasSelected(): boolean;
|
|
145
|
+
static types: Record<string, ElementTypeConstructor>;
|
|
146
|
+
static registerType(constructor: ElementTypeConstructor, id: string): void;
|
|
114
147
|
}
|
|
115
148
|
|
|
116
149
|
interface LocatorOptions {
|
|
@@ -41,7 +41,7 @@ declare class PreviewModel extends Deletable {
|
|
|
41
41
|
constructor(id: string, options: PreviewModelOptions)
|
|
42
42
|
|
|
43
43
|
static models: {
|
|
44
|
-
|
|
44
|
+
[id: string]: PreviewModel
|
|
45
45
|
}
|
|
46
46
|
static getActiveModels(): PreviewModel[]
|
|
47
47
|
|
|
@@ -72,6 +72,7 @@ declare class PreviewModel extends Deletable {
|
|
|
72
72
|
interface PreviewSceneOptions {
|
|
73
73
|
name?: string
|
|
74
74
|
description?: string
|
|
75
|
+
category?: string
|
|
75
76
|
light_color?: string
|
|
76
77
|
light_side?: number
|
|
77
78
|
condition?: ConditionResolvable
|
|
@@ -102,6 +103,7 @@ declare class PreviewScene extends Deletable {
|
|
|
102
103
|
id: string
|
|
103
104
|
name: string
|
|
104
105
|
description: string
|
|
106
|
+
category?: string
|
|
105
107
|
light_color: string
|
|
106
108
|
light_side: number
|
|
107
109
|
condition?: ConditionResolvable
|
package/custom/util.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="./blockbench"/>
|
|
2
|
-
type ConditionResolvable =
|
|
2
|
+
type ConditionResolvable<Context extends any = any> =
|
|
3
3
|
| undefined
|
|
4
4
|
| boolean
|
|
5
|
-
|
|
|
6
|
-
| ((context: any) => any)
|
|
5
|
+
| ((context: Context) => boolean)
|
|
7
6
|
| Partial<{
|
|
8
7
|
modes: string[]
|
|
9
8
|
formats: string[]
|
|
@@ -23,21 +22,18 @@ type ConditionResolvable =
|
|
|
23
22
|
null_any?: boolean
|
|
24
23
|
texture_mesh?: boolean
|
|
25
24
|
outliner?: boolean
|
|
25
|
+
spline?: boolean
|
|
26
26
|
}
|
|
27
27
|
project: boolean
|
|
28
|
-
method(context:
|
|
28
|
+
method(context: Context): boolean
|
|
29
29
|
}>
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* Tests if a condition is truthy
|
|
32
|
+
* Tests if a condition is truthy or falsy. Returns true if the condition is unspecified
|
|
33
33
|
* @param condition Boolean, function, any or anything else
|
|
34
34
|
*/
|
|
35
|
-
declare function Condition(condition: ConditionResolvable): boolean
|
|
35
|
+
declare function Condition<Context extends any = any>(condition: ConditionResolvable<Context>, context?: Context): boolean
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* Wrapper for anys that tells the custom JSON exporter to write in one line
|
|
39
|
-
*/
|
|
40
|
-
const oneLiner: new <T>(data?: T) => T
|
|
41
37
|
|
|
42
38
|
/**
|
|
43
39
|
* If the input event is a touch event, convert touch event to a compatible mouse event
|
|
@@ -72,7 +68,7 @@ declare function convertTouchEvent(event: TouchEvent | MouseEvent): MouseEvent
|
|
|
72
68
|
declare function guid(): string
|
|
73
69
|
declare function isUUID(s: any): any
|
|
74
70
|
declare function bbuid(l: any): string
|
|
75
|
-
declare function trimFloatNumber(value: number): string
|
|
71
|
+
declare function trimFloatNumber(value: number, decimal_places: number = 4): string
|
|
76
72
|
declare function getAxisLetter(axisNumber: number): string
|
|
77
73
|
declare function getAxisNumber(axisLetter: string): number
|
|
78
74
|
declare function limitNumber(number: any, min: any, max: any): any
|
|
@@ -98,7 +94,6 @@ declare function get(options: any, name: any, defaultValue: any): any
|
|
|
98
94
|
declare function getKeyByValue(any: any, value: any): any
|
|
99
95
|
declare function onVueSetup(func: any): void
|
|
100
96
|
declare function capitalizeFirstLetter(string: any): any
|
|
101
|
-
declare function autoStringify(any: any): string
|
|
102
97
|
declare function pluralS(arr: any): '' | 's'
|
|
103
98
|
declare function pathToName(path: string, extension: boolean = false): string | ''
|
|
104
99
|
declare function pathToExtension(path: string): string | ''
|
|
@@ -41,7 +41,7 @@ declare global {
|
|
|
41
41
|
select(group_is_selected: any): this;
|
|
42
42
|
fillValues(keyframe: any, values: any, allow_expression: any, round?: boolean): void;
|
|
43
43
|
pushKeyframe(keyframe: any): this;
|
|
44
|
-
doRender():
|
|
44
|
+
doRender(): import("three").Euler;
|
|
45
45
|
displayRotation(arr: any, multiplier?: number): this;
|
|
46
46
|
displayPosition(arr: any, multiplier?: number): this;
|
|
47
47
|
displayScale(arr: any, multiplier?: number): this;
|
|
@@ -78,6 +78,7 @@ declare global {
|
|
|
78
78
|
getElement(): OutlinerNode;
|
|
79
79
|
element: OutlinerNode;
|
|
80
80
|
select(element_is_selected: any): this;
|
|
81
|
+
doRender(): import("three").Object3D;
|
|
81
82
|
displayPosition(arr: any, multiplier?: number): this;
|
|
82
83
|
displayIK(get_samples: any): {};
|
|
83
84
|
channels: {
|
package/generated/api.d.ts
CHANGED
|
@@ -101,12 +101,90 @@ declare global {
|
|
|
101
101
|
findFileFromContent: typeof Filesystem.findFileFromContent;
|
|
102
102
|
addDragHandler: typeof Filesystem.addDragHandler;
|
|
103
103
|
removeDragHandler: typeof Filesystem.removeDragHandler;
|
|
104
|
-
queries: {};
|
|
105
|
-
ModelFormat: typeof ModelFormat;
|
|
106
|
-
settings: typeof import("./interface/settings").settings;
|
|
107
|
-
Setting: typeof import("./interface/settings").Setting;
|
|
108
|
-
SettingsProfile: typeof import("./interface/settings").SettingsProfile;
|
|
109
|
-
Settings: typeof import("./interface/settings").Settings;
|
|
110
104
|
};
|
|
111
105
|
}
|
|
106
|
+
declare const global: {
|
|
107
|
+
LastVersion: string;
|
|
108
|
+
Blockbench: {
|
|
109
|
+
isWeb: boolean;
|
|
110
|
+
isMobile: boolean;
|
|
111
|
+
isLandscape: boolean;
|
|
112
|
+
isTouch: boolean;
|
|
113
|
+
isPWA: boolean;
|
|
114
|
+
version: string;
|
|
115
|
+
operating_system: string;
|
|
116
|
+
platform: string;
|
|
117
|
+
flags: any[];
|
|
118
|
+
drag_handlers: {};
|
|
119
|
+
events: {};
|
|
120
|
+
openTime: Date;
|
|
121
|
+
setup_successful: null | true;
|
|
122
|
+
argv: string[];
|
|
123
|
+
/**
|
|
124
|
+
* @deprecated Use Undo.initEdit and Undo.finishEdit instead
|
|
125
|
+
*/
|
|
126
|
+
edit(aspects: UndoAspects, cb: () => void): void;
|
|
127
|
+
reload(): void;
|
|
128
|
+
isNewerThan(version: string): boolean;
|
|
129
|
+
isOlderThan(version: string): boolean;
|
|
130
|
+
registerEdit(): void;
|
|
131
|
+
getIconNode(icon: IconString | boolean | HTMLElement | (() => (IconString | boolean | HTMLElement)), color?: string): any;
|
|
132
|
+
showQuickMessage(message: any, time?: number): void;
|
|
133
|
+
showToastNotification(options: ToastNotificationOptions): any;
|
|
134
|
+
setCursorTooltip(text?: string): void;
|
|
135
|
+
setProgress(progress: number, time?: number, bar?: string): void;
|
|
136
|
+
showStatusMessage(message: string, time?: number): void;
|
|
137
|
+
setStatusBarText(text?: string): void;
|
|
138
|
+
showMessage(message: any, location: any): void;
|
|
139
|
+
showMessageBox(options: MessageBoxOptions, cb?: (button: number | string, result?: Record<string, boolean>, event?: Event) => void): import("./interface/dialog").MessageBox;
|
|
140
|
+
/**
|
|
141
|
+
*
|
|
142
|
+
* @param {*} title
|
|
143
|
+
* @param {*} value
|
|
144
|
+
* @param {*} callback
|
|
145
|
+
* @param {object} options Options
|
|
146
|
+
* @param {string} options.info Info text
|
|
147
|
+
* @param {string} options.description Description for the text input
|
|
148
|
+
* @returns {Promise<string>} Input value
|
|
149
|
+
*/
|
|
150
|
+
textPrompt(title: string, value: string, callback: (text: string) => void, options?: {
|
|
151
|
+
placeholder?: string;
|
|
152
|
+
description?: string;
|
|
153
|
+
info?: string;
|
|
154
|
+
}): Promise<unknown>;
|
|
155
|
+
addMenuEntry(name: string, icon: IconString, click: any): void;
|
|
156
|
+
removeMenuEntry(name: string): void;
|
|
157
|
+
openLink(link: string): void;
|
|
158
|
+
notification(title: string, text: string, icon?: string): void;
|
|
159
|
+
addCSS(css: string, layer?: string): Deletable;
|
|
160
|
+
addFlag(flag: string): void;
|
|
161
|
+
removeFlag(flag: string): void;
|
|
162
|
+
hasFlag(flag: string): boolean | undefined;
|
|
163
|
+
dispatchEvent(event_name: EventName, data: any): any[];
|
|
164
|
+
on(event_name: EventName, cb: any): any;
|
|
165
|
+
once(event_name: EventName, cb: any): any;
|
|
166
|
+
addListener(event_name: EventName, cb: any): any;
|
|
167
|
+
removeListener(event_name: EventName, cb: any): any;
|
|
168
|
+
onUpdateTo(version: any, callback: any): void;
|
|
169
|
+
Format: (ModelFormat | number);
|
|
170
|
+
Project: (ModelProject | number);
|
|
171
|
+
Undo: UndoSystem;
|
|
172
|
+
import: typeof Filesystem.importFile;
|
|
173
|
+
importFile: typeof Filesystem.importFile;
|
|
174
|
+
pickDirectory: typeof Filesystem.pickDirectory;
|
|
175
|
+
read: typeof Filesystem.readFile;
|
|
176
|
+
readFile: typeof Filesystem.readFile;
|
|
177
|
+
export: typeof Filesystem.exportFile;
|
|
178
|
+
exportFile: typeof Filesystem.exportFile;
|
|
179
|
+
writeFile: typeof Filesystem.writeFile;
|
|
180
|
+
findFileFromContent: typeof Filesystem.findFileFromContent;
|
|
181
|
+
addDragHandler: typeof Filesystem.addDragHandler;
|
|
182
|
+
removeDragHandler: typeof Filesystem.removeDragHandler;
|
|
183
|
+
};
|
|
184
|
+
isApp: boolean;
|
|
185
|
+
};
|
|
186
|
+
declare global {
|
|
187
|
+
const LastVersion: typeof global.LastVersion;
|
|
188
|
+
const Blockbench: typeof global.Blockbench;
|
|
189
|
+
}
|
|
112
190
|
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
const AutoBackup: {
|
|
3
|
+
/**
|
|
4
|
+
* IndexedDB Database
|
|
5
|
+
*/
|
|
6
|
+
db: (null | IDBDatabase);
|
|
7
|
+
initialize(): void;
|
|
8
|
+
backupOpenProject(): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Test if saved backups exist
|
|
11
|
+
*/
|
|
12
|
+
hasBackups(): Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Recover all saved backups
|
|
15
|
+
*/
|
|
16
|
+
recoverAllBackups(confirm_selection?: boolean): Promise<void>;
|
|
17
|
+
removeBackup(uuid: string): Promise<unknown>;
|
|
18
|
+
removeAllBackups(): Promise<unknown>;
|
|
19
|
+
loop_timeout: any;
|
|
20
|
+
backupProjectLoop(run_save?: boolean): void;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
declare const global: {
|
|
24
|
+
AutoBackup: {
|
|
25
|
+
/**
|
|
26
|
+
* IndexedDB Database
|
|
27
|
+
*/
|
|
28
|
+
db: (null | IDBDatabase);
|
|
29
|
+
initialize(): void;
|
|
30
|
+
backupOpenProject(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Test if saved backups exist
|
|
33
|
+
*/
|
|
34
|
+
hasBackups(): Promise<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* Recover all saved backups
|
|
37
|
+
*/
|
|
38
|
+
recoverAllBackups(confirm_selection?: boolean): Promise<void>;
|
|
39
|
+
removeBackup(uuid: string): Promise<unknown>;
|
|
40
|
+
removeAllBackups(): Promise<unknown>;
|
|
41
|
+
loop_timeout: any;
|
|
42
|
+
backupProjectLoop(run_save?: boolean): void;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
declare global {
|
|
46
|
+
const AutoBackup: typeof global.AutoBackup;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -386,4 +386,20 @@ declare global {
|
|
|
386
386
|
close(): void;
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
|
+
declare const global: {
|
|
390
|
+
DialogSidebar: typeof import("./dialog").DialogSidebar;
|
|
391
|
+
Dialog: typeof import("./dialog").Dialog;
|
|
392
|
+
ShapelessDialog: typeof import("./dialog").ShapelessDialog;
|
|
393
|
+
MessageBox: typeof import("./dialog").MessageBox;
|
|
394
|
+
ConfigDialog: typeof import("./dialog").ConfigDialog;
|
|
395
|
+
ToolConfig: typeof import("./dialog").ToolConfig;
|
|
396
|
+
};
|
|
397
|
+
declare global {
|
|
398
|
+
const Dialog: typeof global.Dialog;
|
|
399
|
+
const ConfigDialog: typeof global.ConfigDialog;
|
|
400
|
+
const DialogSidebar: typeof global.DialogSidebar;
|
|
401
|
+
const MessageBox: typeof global.MessageBox;
|
|
402
|
+
const ShapelessDialog: typeof global.ShapelessDialog;
|
|
403
|
+
const ToolConfig: typeof global.ToolConfig;
|
|
404
|
+
}
|
|
389
405
|
export {};
|
|
@@ -187,4 +187,12 @@ declare global {
|
|
|
187
187
|
static registerType(id: string, type_class: typeof FormElement): void;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
+
declare const global: {
|
|
191
|
+
InputForm: typeof import("./form").InputForm;
|
|
192
|
+
FormElement: typeof import("./form").FormElement;
|
|
193
|
+
};
|
|
194
|
+
declare global {
|
|
195
|
+
const InputForm: typeof global.InputForm;
|
|
196
|
+
const FormElement: typeof global.FormElement;
|
|
197
|
+
}
|
|
190
198
|
export {};
|
|
@@ -155,4 +155,24 @@ declare global {
|
|
|
155
155
|
function setActivePanel(panel_id: string): void;
|
|
156
156
|
function setupMobilePanelSelector(): void;
|
|
157
157
|
}
|
|
158
|
+
declare const global: {
|
|
159
|
+
Panel: typeof import("./panels").Panel;
|
|
160
|
+
Panels: Record<string, Panel>;
|
|
161
|
+
setupPanels: typeof import("./panels").setupPanels;
|
|
162
|
+
updateInterfacePanels: typeof import("./panels").updateInterfacePanels;
|
|
163
|
+
updateSidebarOrder: typeof import("./panels").updateSidebarOrder;
|
|
164
|
+
updatePanelSelector: typeof import("./panels").updatePanelSelector;
|
|
165
|
+
setActivePanel: typeof import("./panels").setActivePanel;
|
|
166
|
+
setupMobilePanelSelector: typeof import("./panels").setupMobilePanelSelector;
|
|
167
|
+
};
|
|
168
|
+
declare global {
|
|
169
|
+
const Panel: typeof global.Panel;
|
|
170
|
+
const Panels: typeof global.Panels;
|
|
171
|
+
const setupPanels: typeof global.setupPanels;
|
|
172
|
+
const updateInterfacePanels: typeof global.updateInterfacePanels;
|
|
173
|
+
const updateSidebarOrder: typeof global.updateSidebarOrder;
|
|
174
|
+
const updatePanelSelector: typeof global.updatePanelSelector;
|
|
175
|
+
const setActivePanel: typeof global.setActivePanel;
|
|
176
|
+
const setupMobilePanelSelector: typeof global.setupMobilePanelSelector;
|
|
177
|
+
}
|
|
158
178
|
export {};
|