blockbench-types 5.2.0-beta.0-next.1 → 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.
Files changed (54) hide show
  1. package/custom/animation.d.ts +2 -1
  2. package/custom/blockbench.d.ts +5 -3
  3. package/custom/canvas.d.ts +20 -3
  4. package/custom/codec.d.ts +2 -2
  5. package/custom/cube.d.ts +1 -1
  6. package/custom/display_mode.d.ts +5 -1
  7. package/custom/global.d.ts +1 -2
  8. package/custom/interface.d.ts +5 -0
  9. package/custom/{toolbars.d.ts → keybind.d.ts} +4 -76
  10. package/custom/menu_bar.d.ts +66 -0
  11. package/custom/misc.d.ts +13 -5
  12. package/custom/painter.d.ts +33 -1
  13. package/custom/screencam.d.ts +1 -1
  14. package/custom/spline_mesh.d.ts +5 -4
  15. package/custom/textures.d.ts +2 -0
  16. package/generated/animations/timeline_animators.d.ts +1 -1
  17. package/generated/api.d.ts +2 -1
  18. package/generated/file_system.d.ts +1 -0
  19. package/generated/find_replace.d.ts +6 -0
  20. package/generated/interface/actions.d.ts +10 -9
  21. package/generated/interface/main_tools.d.ts +23 -0
  22. package/generated/interface/menu.d.ts +141 -0
  23. package/generated/interface/menu_bar.d.ts +2 -3
  24. package/generated/interface/shared_actions.d.ts +5 -0
  25. package/generated/interface/toolbars.d.ts +146 -46
  26. package/generated/io/format.d.ts +1 -0
  27. package/generated/io/project.d.ts +1 -1
  28. package/generated/main.d.ts +3 -0
  29. package/generated/modeling/mesh/add_mesh.d.ts +6 -0
  30. package/generated/modeling/mesh/util.d.ts +8 -2
  31. package/generated/modes.d.ts +2 -2
  32. package/generated/native_apis.d.ts +3 -0
  33. package/generated/outliner/abstract/outliner_element.d.ts +1 -0
  34. package/generated/outliner/abstract/outliner_node.d.ts +1 -0
  35. package/generated/outliner/types/armature.d.ts +1 -1
  36. package/generated/outliner/types/armature_bone.d.ts +1 -1
  37. package/generated/outliner/types/billboard.d.ts +1 -1
  38. package/generated/outliner/types/bounding_box.d.ts +1 -1
  39. package/generated/outliner/types/cube.d.ts +1 -1
  40. package/generated/outliner/types/group.d.ts +1 -1
  41. package/generated/outliner/types/locator.d.ts +1 -1
  42. package/generated/outliner/types/mesh.d.ts +1 -1
  43. package/generated/outliner/types/null_object.d.ts +1 -1
  44. package/generated/outliner/types/spline_mesh.d.ts +1 -2
  45. package/generated/outliner/types/texture_mesh.d.ts +1 -1
  46. package/generated/plugin_loader.d.ts +1 -1
  47. package/generated/preview/preview.d.ts +280 -0
  48. package/generated/preview/reference_images.d.ts +1 -1
  49. package/generated/util/gif.d.ts +12 -3
  50. package/generated/util/state_memory.d.ts +2 -10
  51. package/package.json +1 -1
  52. package/type_config.json +0 -2
  53. package/custom/menu.d.ts +0 -137
  54. package/custom/preview.d.ts +0 -147
@@ -0,0 +1,280 @@
1
+ import { ConfigDialog } from '../interface/dialog';
2
+ interface AnglePreset {
3
+ name?: string;
4
+ id?: string;
5
+ color?: string;
6
+ condition?: ConditionResolvable;
7
+ default?: true;
8
+ position: ArrayVector3;
9
+ target?: ArrayVector3;
10
+ rotation?: ArrayVector3;
11
+ projection: 'unset' | 'orthographic' | 'perspective';
12
+ zoom?: number;
13
+ focal_length?: number;
14
+ fov?: number;
15
+ aspect_ratio?: number;
16
+ locked_angle?: number;
17
+ }
18
+ type PreviewAnnotation = {
19
+ node: HTMLElement;
20
+ object: THREE.Object3D;
21
+ };
22
+ export type RaycastResult = {
23
+ type: 'element' | 'keyframe' | 'vertex' | 'cube' | 'line' | 'none';
24
+ event: PointerEvent | MouseEvent | TouchEvent;
25
+ cube?: Cube;
26
+ intersects?: THREE.Intersection[];
27
+ intersect?: THREE.Intersection;
28
+ face?: string;
29
+ vertex?: any;
30
+ vertices?: [string, string];
31
+ keyframe?: _Keyframe;
32
+ vertex_index?: number;
33
+ element?: OutlinerElement;
34
+ };
35
+ type SplitScreenMode = 'single' | 'double_horizontal' | 'double_vertical' | 'quad' | 'triple_left' | 'triple_right' | 'triple_top' | 'triple_bottom';
36
+ export declare const three_grid: import("three").Object3D;
37
+ export declare const gizmo_colors: {
38
+ r: import("three").Color;
39
+ g: import("three").Color;
40
+ b: import("three").Color;
41
+ grid: import("three").Color;
42
+ solid: import("three").Color;
43
+ outline: import("three").Color;
44
+ gizmo_hover: import("three").Color;
45
+ spline_handle_aligned: import("three").Color;
46
+ spline_handle_mirrored: import("three").Color;
47
+ spline_handle_free: import("three").Color;
48
+ u: import("three").Color;
49
+ v: import("three").Color;
50
+ w: import("three").Color;
51
+ };
52
+ export declare const DefaultCameraPresets: AnglePreset[];
53
+ interface PreviewOptions {
54
+ id: string;
55
+ antialias?: boolean;
56
+ offscreen?: boolean;
57
+ }
58
+ /**
59
+ * Previews are 3D viewports, that can either be used as a viewport for the user, or as an offscreen view to record media.
60
+ */
61
+ export declare class Preview {
62
+ id: string;
63
+ canvas: HTMLCanvasElement;
64
+ height: number;
65
+ width: number;
66
+ aspect_ratio?: number;
67
+ node: HTMLElement;
68
+ label: HTMLLabelElement;
69
+ /**
70
+ * True if the preview is in orthographic camera mode
71
+ */
72
+ isOrtho: boolean;
73
+ /**
74
+ * Angle, when in a specific side view
75
+ */
76
+ angle: null | string;
77
+ default_angle: AnglePreset;
78
+ camPers: THREE.PerspectiveCamera;
79
+ camOrtho: THREE.OrthographicCamera & {
80
+ axis: string;
81
+ backgroundHandle: any;
82
+ };
83
+ controls: any;
84
+ annotations: Record<string, PreviewAnnotation>;
85
+ offscreen?: boolean;
86
+ renderer: THREE.WebGLRenderer;
87
+ background: {
88
+ name: string;
89
+ image: any;
90
+ size: number;
91
+ x: number;
92
+ y: number;
93
+ lock: boolean;
94
+ };
95
+ side_view_target: THREE.Vector3;
96
+ raycaster: THREE.Raycaster;
97
+ orbit_gizmo?: OrbitGizmo;
98
+ selection: {
99
+ box: HTMLElement;
100
+ frustum: THREE.Frustum;
101
+ activated: boolean;
102
+ start_x: number;
103
+ start_y: number;
104
+ client_x: number;
105
+ client_y: number;
106
+ sr_move_f?: any;
107
+ sr_stop_f?: any;
108
+ click_target?: RaycastResult;
109
+ old_selected?: OutlinerElement[];
110
+ old_mesh_selection?: any;
111
+ old_spline_selection?: any;
112
+ };
113
+ static_rclick: boolean;
114
+ rclick_cooldown: any;
115
+ event_start?: ArrayVector2;
116
+ mouse: THREE.Vector2;
117
+ constructor(options: PreviewOptions);
118
+ /**
119
+ * Set a size of the preview in pixels. With no arguments, and if the preview node is connected to the DOM, it will adjust to the size of the parent element
120
+ */
121
+ resize(width?: number, height?: number): this;
122
+ updateToneMapping(): void;
123
+ raycast(event: MouseEvent, options?: {
124
+ edges?: boolean;
125
+ vertices?: boolean;
126
+ }): false | RaycastResult;
127
+ render(): void;
128
+ get camera(): THREE.PerspectiveCamera | THREE.OrthographicCamera;
129
+ setProjectionMode(orthographic: boolean, toggle?: boolean): this;
130
+ setFOV(fov: number): void;
131
+ setNormalCamera(): this;
132
+ setLockedAngle(angle?: number): this;
133
+ setDefaultAnglePreset(preset: AnglePreset): this;
134
+ loadAnglePreset(preset: AnglePreset): this;
135
+ /**
136
+ * Opens a dialog to create and save a new angle preset
137
+ */
138
+ newAnglePreset(): this;
139
+ getFacingDirection(): 'north' | 'south' | 'east' | 'west';
140
+ getFacingHeight(): 'up' | 'middle' | 'down';
141
+ click(event?: PointerEvent): boolean;
142
+ mousemove(event: MouseEvent): void;
143
+ mouseup(event: MouseEvent): this;
144
+ raycastMouseCoords(x: number, y: number): import("three").Vector3;
145
+ vectorToScreenPosition(vector: any): {
146
+ x: any;
147
+ y: any;
148
+ };
149
+ showContextMenu(event: MouseEvent): this;
150
+ occupyTransformer(event?: MouseEvent | TouchEvent): this;
151
+ calculateControlScale(position: any): number;
152
+ updateAnnotations(): void;
153
+ addAnnotation(key: string, tag: PreviewAnnotation): void;
154
+ removeAnnotation(key: any): void;
155
+ startSelRect(event: PointerEvent): void;
156
+ moveSelRect(event: MouseEvent): void;
157
+ stopSelRect(event: any): void;
158
+ loadBackground(): void;
159
+ updateBackground(): void;
160
+ copyView(preview: Preview): void;
161
+ /**
162
+ * Take a screenshot of the current view of the preview
163
+ */
164
+ screenshot(options: ScreenshotOptions, callback: ScreenshotReturn): void;
165
+ fullscreen(): this;
166
+ toggleFullscreen(): void;
167
+ delete(): void;
168
+ /**
169
+ * The last used preview
170
+ */
171
+ static selected: any;
172
+ /**
173
+ * List of all previews
174
+ */
175
+ static all: Preview[];
176
+ /**
177
+ * Utility regarding split screen preview mode
178
+ */
179
+ static split_screen: {
180
+ /**
181
+ * Whether the split screen is enabled
182
+ */
183
+ enabled: boolean;
184
+ /**
185
+ * The current split screen mode
186
+ */
187
+ mode: string;
188
+ before: any;
189
+ previews: Preview[];
190
+ lazyLoadPreview(index: number, camera_preset?: AnglePreset): Preview;
191
+ /**
192
+ * Set a split screen mode
193
+ */
194
+ setMode(mode?: SplitScreenMode): void;
195
+ /**
196
+ * Update the size of the split screens
197
+ */
198
+ updateSize(): void;
199
+ };
200
+ menu: Menu;
201
+ }
202
+ export declare const ViewOptionsDialog: ConfigDialog;
203
+ export declare function editCameraPreset(preset: any, presets: any): void;
204
+ export declare class OrbitGizmo {
205
+ preview: Preview;
206
+ node: HTMLDivElement;
207
+ lines: Record<axisLetter, SVGPathElement>;
208
+ sides: Record<string, {
209
+ opposite: string;
210
+ axis: axisLetter;
211
+ sign: 1 | -1;
212
+ label?: string;
213
+ node?: HTMLDivElement;
214
+ }>;
215
+ constructor(preview: Preview, options?: {});
216
+ update(): void;
217
+ hide(): void;
218
+ unhide(): void;
219
+ }
220
+ export declare function setupPreviews(): void;
221
+ export declare function animate(): void;
222
+ declare const global: {
223
+ main_preview: import("./preview").Preview;
224
+ three_grid: import("three").Object3D;
225
+ gizmo_colors: {
226
+ r: import("three").Color;
227
+ g: import("three").Color;
228
+ b: import("three").Color;
229
+ grid: import("three").Color;
230
+ solid: import("three").Color;
231
+ outline: import("three").Color;
232
+ gizmo_hover: import("three").Color;
233
+ spline_handle_aligned: import("three").Color;
234
+ spline_handle_mirrored: import("three").Color;
235
+ spline_handle_free: import("three").Color;
236
+ u: import("three").Color;
237
+ v: import("three").Color;
238
+ w: import("three").Color;
239
+ };
240
+ DefaultCameraPresets: AnglePreset[];
241
+ Preview: typeof import("./preview").Preview;
242
+ ViewOptionsDialog: ConfigDialog;
243
+ editCameraPreset: typeof import("./preview").editCameraPreset;
244
+ OrbitGizmo: typeof import("./preview").OrbitGizmo;
245
+ };
246
+ declare global {
247
+ type Preview = import('./preview').Preview;
248
+ const Preview: typeof global.Preview;
249
+ type OrbitGizmo = import('./preview').OrbitGizmo;
250
+ const OrbitGizmo: typeof global.OrbitGizmo;
251
+ const three_grid: typeof global.three_grid;
252
+ const gizmo_colors: typeof global.gizmo_colors;
253
+ const DefaultCameraPresets: typeof global.DefaultCameraPresets;
254
+ const ViewOptionsDialog: typeof global.ViewOptionsDialog;
255
+ const editCameraPreset: typeof global.editCameraPreset;
256
+ const updateShading: () => void;
257
+ let MediaPreview: Preview;
258
+ function animate(): void;
259
+ interface BarItemRegistry {
260
+ view_mode: BarSelect;
261
+ preview_checkerboard: Toggle;
262
+ uv_checkerboard: Toggle;
263
+ toggle_shading: Toggle;
264
+ toggle_all_grids: Toggle;
265
+ toggle_ground_plane: Toggle;
266
+ toggle_motion_trails: Toggle;
267
+ pixel_grid: Toggle;
268
+ split_screen: BarSelect;
269
+ focus_on_selection: Action;
270
+ toggle_camera_projection: Action;
271
+ camera_initial: Action;
272
+ camera_top: Action;
273
+ camera_bottom: Action;
274
+ camera_south: Action;
275
+ camera_north: Action;
276
+ camera_east: Action;
277
+ camera_west: Action;
278
+ }
279
+ }
280
+ export {};
@@ -68,7 +68,7 @@ declare global {
68
68
  changeScope(new_scope: any): this;
69
69
  enableBlueprintMode(): void;
70
70
  propertiesDialog(): this;
71
- menu: Menu;
71
+ menu: import("../interface/menu").Menu;
72
72
  }
73
73
  namespace ReferenceImage {
74
74
  let selected: any;
@@ -1,6 +1,15 @@
1
1
  declare global {
2
- function quantize(data: any, opts: any): number[][];
3
- function applyPalette(data: any, palette: any, opts: any): Uint8Array<ArrayBuffer>;
2
+ interface QuantizeOptions {
3
+ has_transparency?: boolean;
4
+ /**
5
+ * If true, prioritize color accuracy
6
+ */
7
+ prio_color_accuracy?: boolean;
8
+ }
9
+ }
10
+ type GIFPalette = [number, number, number][];
11
+ declare global {
12
+ function quantize(data: Uint8ClampedArray<ArrayBuffer>, opts: QuantizeOptions): GIFPalette;
13
+ function applyPalette(data: Uint8ClampedArray<ArrayBuffer>, palette: GIFPalette, opts: QuantizeOptions): Uint8Array;
4
14
  }
5
-
6
15
  export {};
@@ -1,13 +1,5 @@
1
- declare const StateMemory: {
2
- /**
3
- * Initialize a memorized property
4
- */
5
- init(key: string, type: "string" | "number" | "boolean" | "object" | "array"): void;
6
- set(key: string, value: any): void;
7
- save(key: string): void;
8
- get(key: string): string | number | [] | boolean | any;
9
- };
10
- export default StateMemory;
1
+ declare const _default: (typeof global.StateMemory) & Record<string, any>;
2
+ export default _default;
11
3
  declare const global: {
12
4
  StateMemory: {
13
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blockbench-types",
3
- "version": "5.2.0-beta.0-next.1",
3
+ "version": "5.2.0-beta.0-next.2",
4
4
  "description": "Blockbench typescript types",
5
5
  "main": "",
6
6
  "types": "./index.d.ts",
package/type_config.json CHANGED
@@ -6,7 +6,6 @@
6
6
  "animations/keyframe",
7
7
  "animations/molang",
8
8
  "animations/timeline",
9
- "interface/menu",
10
9
  "interface/setup_settings",
11
10
  "desktop",
12
11
  "util/math_util",
@@ -21,7 +20,6 @@
21
20
  "outliner/outliner",
22
21
  "outliner/texture_mesh",
23
22
  "preview/preview_scenes",
24
- "preview/preview",
25
23
  "preview/canvas",
26
24
  "io/codec",
27
25
  "io/io",
package/custom/menu.d.ts DELETED
@@ -1,137 +0,0 @@
1
- /// <reference types="./blockbench"/>
2
- interface CustomMenuItem {
3
- name: string
4
- id?: string
5
- icon: IconString | boolean | ((context: any) => (IconString|boolean))
6
- color?: string
7
- description?: string
8
- condition?: ConditionResolvable
9
- /**
10
- * Keybind or string to display in the menu, won't work as an actual keybinding by default
11
- */
12
- keybind?: Keybind | string
13
- /**
14
- * Adds a search bar to the menu or submenu
15
- */
16
- searchable?: boolean
17
- children?: MenuItem[] | ((context: any) => MenuItem[])
18
- click?(context?: any, event?: Event): void
19
- }
20
- type MenuItem = CustomMenuItem | Action | BarSelect<string> | MenuSeparator | string
21
- interface MenuOptions {
22
- onOpen?(position: MouseEvent | HTMLElement, context?: any): void
23
- onClose?(): void
24
- keep_open?: boolean
25
- searchable?: boolean
26
- class?: string
27
- }
28
- /**
29
- * Use the Menu class to create a context menu. Menus can contain custom entries and hierarchy, or existing actions and tools.
30
- */
31
- declare class Menu extends Deletable {
32
- /**
33
- * Creates a new context menu
34
- */
35
- constructor(
36
- id: string,
37
- template: MenuItem[] | ((context?: any) => MenuItem[]),
38
- options?: MenuOptions
39
- )
40
- constructor(template: MenuItem[] | ((context?: any) => MenuItem[]), options?: MenuOptions)
41
-
42
- /**
43
- * Opens the menu somewhere
44
- * @param position Position where to open the menu. Can be a mouse event, or a node that the menu is spawned below.
45
- * @param context Context for the click events inside the menu
46
- */
47
- open(position: MouseEvent | HTMLElement | 'mouse', context?: any): this
48
- /**
49
- * Alias for .open()
50
- */
51
- show(position: MouseEvent | HTMLElement | 'mouse', context?: any): this
52
- /**
53
- * Closes the menu if it's open
54
- */
55
- hide(): this
56
- /**
57
- * Adds an action to the menu structure
58
- * @param action Action to add
59
- * @param path Path pointing to the location. Use the ID of each level of the menu, or index within a level, separated by a point. For example, `export.0` places the action at the top position of the Export submenu.
60
- */
61
- addAction(action: Action | CustomMenuItem | '_', path?: string | number): void
62
- /**
63
- *
64
- * @param path Path pointing to the location. Use the ID of each level of the menu, or index within a level, or item ID, separated by a point. For example, `export.export_special_format` removes the action "Export Special Format" from the Export submenu.
65
- */
66
- removeAction(path: string | Action): void
67
- /**
68
- * @deprecated
69
- */
70
- deleteItem(rm_item: Action): void
71
- hover(node: HTMLElement, event: Event, expand?: boolean): void
72
- structure: MenuItem[]
73
- node: HTMLUListElement
74
- static open: Menu | null
75
- static closed_in_this_click?: string
76
- }
77
-
78
- declare interface BarMenuOptions {
79
- name?: string
80
- icon?: IconString
81
- condition?: ConditionResolvable
82
- }
83
-
84
- /**
85
- * Creates a new menu in the menu bar
86
- */
87
- declare class BarMenu extends Menu {
88
- constructor(id: string, structure: MenuItem[], options?: BarMenuOptions)
89
- type: 'bar_menu'
90
- id: string
91
- condition?: ConditionResolvable
92
- name: string
93
- structure: MenuItem[]
94
- /**
95
- * Visually highlights an action within the menu, until the user opens the menu
96
- */
97
- highlight(action: Action): void
98
- }
99
-
100
- declare namespace MenuBar {
101
- const mode_switcher_button: null | HTMLDivElement
102
- const menus: {
103
- file: Menu
104
- edit: Menu
105
- transform: Menu
106
- uv: Menu
107
- texture: Menu
108
- animation: Menu
109
- keyframe: Menu
110
- display: Menu
111
- tools: Menu
112
- view: Menu
113
- help: Menu
114
- [id: string]: Menu
115
- }
116
- /**
117
- * Add a new menu to the menu bar
118
- * @param menu The BarMenu to add
119
- * @param position Specify the position in the menu list where to add insert the menu. Can either be an index in the list of all menus, or the ID of the menu to insert right from.
120
- */
121
- function addMenu(menu: BarMenu, position?: number | string): void
122
- /**
123
- * Adds an action to the menu structure
124
- * @param action Action to add
125
- * @param path Path pointing to the location. Use the ID of each level of the menu, or index or group within a level, separated by a point. For example, `file.export.0` places the action at the top position of the Export submenu in the File menu.
126
- */
127
- function addAction(action: Action, path?: string): void
128
- /**
129
- *
130
- * @param path Path pointing to the location. Use the ID of each level of the menu, or index or group within a level, or item ID, separated by a point. For example, `export.export_special_format` removes the action "Export Special Format" from the Export submenu.
131
- */
132
- function removeAction(path: string): void
133
- /**
134
- * Update the menu bar
135
- */
136
- function update(): void
137
- }
@@ -1,147 +0,0 @@
1
- /// <reference types="./blockbench"/>
2
- interface AnglePreset {
3
- position: ArrayVector3
4
- target?: ArrayVector3
5
- rotation?: ArrayVector3
6
- projection: 'unset' | 'orthographic' | 'perspective'
7
- zoom?: number
8
- focal_length?: number
9
- fov?: number
10
- aspect_ratio?: number
11
- lockedAngle?: number
12
- }
13
-
14
- interface PreviewOptions {
15
- id: string
16
- antialias?: boolean
17
- }
18
-
19
- type RaycastResult = {
20
- type: 'element' | 'keyframe' | 'vertex' | 'cube' | 'line' | 'none'
21
- event: PointerEvent | MouseEvent | TouchEvent
22
- cube?: Cube
23
- intersects?: any[]
24
- face?: string
25
- vertex?: any
26
- keyframe?: _Keyframe
27
- element?: OutlinerElement
28
- }
29
-
30
- type SplitScreenMode = 'single'|'double_horizontal'|'double_vertical'|'quad'|'triple_left'|'triple_right'|'triple_top'|'triple_bottom'
31
-
32
- /**
33
- * Previews are 3D viewports, that can either be used as a viewport for the user, or as an offscreen view to record media.
34
- */
35
- declare class Preview extends Deletable {
36
- constructor(options: PreviewOptions)
37
-
38
- id: string
39
- canvas: HTMLCanvasElement
40
- height: number
41
- width: number
42
- aspect_ratio?: number
43
- node: HTMLElement
44
- label: HTMLLabelElement
45
- /**
46
- * True if the preview is in orthographic camera mode
47
- */
48
- isOrtho: boolean
49
- /**
50
- * Angle, when in a specific side view
51
- */
52
- angle: null | number
53
- default_angle?: AnglePreset
54
- readonly camera: THREE.PerspectiveCamera | THREE.OrthographicCamera
55
- camPers: THREE.PerspectiveCamera
56
- camOrtho: THREE.OrthographicCamera
57
- controls: any
58
- annotations: any
59
- renderer: THREE.WebGLRenderer
60
- background: {
61
- name: string
62
- image: any
63
- size: number
64
- x: number
65
- y: number
66
- lock: boolean
67
- }
68
- raycaster: THREE.Raycaster
69
-
70
- mouse: THREE.Vector2
71
-
72
- split_screen: {
73
- before: undefined | null
74
- enabled: boolean
75
- lazyLoadPreview: () => void
76
- mode: string
77
- previews: Preview[]
78
- setMode(mode: string): void
79
- updateSize(): void
80
- }
81
-
82
- raycast(event: MouseEvent): false | RaycastResult
83
- render(): void
84
- /**
85
- * Set a size of the preview in pixels. With no arguments, and if the preview node is connected to the DOM, it will adjust to the size of the parent element
86
- */
87
- resize(width?: number, height?: number): void
88
- setProjectionMode(orthographic: boolean): this
89
- setFOV(fov: number): void
90
- setLockedAngle(angle: number): this
91
-
92
- loadAnglePreset(angle_preset: AnglePreset): this
93
- /**
94
- * Opens a dialog to create and save a new angle preset
95
- */
96
- newAnglePreset(): this
97
-
98
- getFacingDirection(): 'north' | 'south' | 'east' | 'west'
99
- getFacingHeight(): 'up' | 'middle' | 'down'
100
-
101
- occupyTransformer(): this
102
- showContextMenu(event: Event | HTMLElement): this
103
- loadBackground(): void
104
- /**
105
- * Take a screenshot of the current view of the preview
106
- */
107
- screenshot(options: ScreenshotOptions, callback: ScreenshotReturn): void
108
-
109
- /**
110
- * List of all previews
111
- */
112
- static all: Preview[]
113
- /**
114
- * The last used preview
115
- */
116
- static selected: Preview
117
-
118
- /**
119
- * Utility regarding split screen preview mode
120
- */
121
- static split_screen: {
122
- /**
123
- * Whether the split screen is enabled
124
- */
125
- enabled: boolean
126
- /**
127
- * The current split screen mode
128
- */
129
- mode: SplitScreenMode
130
- previews: Preview[]
131
- lazyLoadPreview(index: number, camera_preset): Preview
132
- /**
133
- * Set a split screen mode
134
- */
135
- setMode(mode: SplitScreenMode = 'single')
136
- /**
137
- * Update the size of the split screens
138
- */
139
- updateSize()
140
- }
141
- }
142
-
143
- declare const DefaultCameraPresets: AnglePreset[]
144
-
145
- declare const MediaPreview: Preview
146
-
147
- declare function animate(): void