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.
Files changed (102) hide show
  1. package/README.md +30 -30
  2. package/custom/animation.d.ts +257 -256
  3. package/custom/animation_controller.d.ts +124 -124
  4. package/custom/blockbench.d.ts +73 -73
  5. package/custom/canvas.d.ts +324 -307
  6. package/custom/codec.d.ts +182 -182
  7. package/custom/copy_paste.d.ts +43 -42
  8. package/custom/cube.d.ts +151 -151
  9. package/custom/desktop.d.ts +61 -73
  10. package/custom/display_mode.d.ts +141 -137
  11. package/custom/edit_session.d.ts +38 -37
  12. package/custom/global.d.ts +181 -168
  13. package/custom/group.d.ts +113 -113
  14. package/custom/interface.d.ts +88 -78
  15. package/custom/io.d.ts +12 -12
  16. package/custom/{toolbars.d.ts → keybind.d.ts} +150 -221
  17. package/custom/keyframe.d.ts +94 -94
  18. package/custom/libs.d.ts +13 -13
  19. package/custom/menu_bar.d.ts +66 -0
  20. package/custom/mesh.d.ts +196 -196
  21. package/custom/misc.d.ts +196 -199
  22. package/custom/molang.d.ts +159 -159
  23. package/custom/outliner.d.ts +158 -158
  24. package/custom/painter.d.ts +102 -69
  25. package/custom/preview_scene.d.ts +120 -120
  26. package/custom/screencam.d.ts +71 -71
  27. package/custom/spline_mesh.d.ts +190 -189
  28. package/custom/texture_group.d.ts +68 -68
  29. package/custom/textures.d.ts +526 -515
  30. package/custom/timeline.d.ts +66 -66
  31. package/custom/undo.d.ts +209 -208
  32. package/custom/util/version_util.d.ts +32 -32
  33. package/custom/util.d.ts +235 -235
  34. package/custom/uveditor.d.ts +3 -3
  35. package/custom/validator.d.ts +99 -99
  36. package/documentation.md +12 -12
  37. package/generated/animations/mirror_animating.d.ts +7 -0
  38. package/generated/animations/timeline_animators.d.ts +1 -1
  39. package/generated/api.d.ts +8 -1
  40. package/generated/file_system.d.ts +2 -1
  41. package/generated/find_replace.d.ts +6 -0
  42. package/generated/formats/standards/obj.d.ts +9 -11
  43. package/generated/interface/actions.d.ts +16 -12
  44. package/generated/interface/form.d.ts +2 -1
  45. package/generated/interface/main_tools.d.ts +23 -0
  46. package/generated/interface/menu.d.ts +141 -0
  47. package/generated/interface/menu_bar.d.ts +2 -3
  48. package/generated/interface/resize_lines.d.ts +2 -0
  49. package/generated/interface/settings.d.ts +6 -2
  50. package/generated/interface/shared_actions.d.ts +5 -0
  51. package/generated/interface/start_screen.d.ts +62 -42
  52. package/generated/interface/toolbars.d.ts +146 -46
  53. package/generated/io/format.d.ts +1 -0
  54. package/generated/io/project.d.ts +10 -2
  55. package/generated/lib/CanvasFrame.d.ts +1 -0
  56. package/generated/main.d.ts +4 -1
  57. package/generated/modeling/mesh/add_mesh.d.ts +6 -0
  58. package/generated/modeling/mesh/proportional_edit.d.ts +15 -13
  59. package/generated/modeling/mesh/util.d.ts +8 -2
  60. package/generated/modeling/mirror_modeling.d.ts +4 -0
  61. package/generated/modeling/weight_paint.d.ts +11 -0
  62. package/generated/modes.d.ts +2 -2
  63. package/generated/native_apis.d.ts +3 -0
  64. package/generated/outliner/abstract/outliner_element.d.ts +1 -0
  65. package/generated/outliner/abstract/outliner_node.d.ts +1 -0
  66. package/generated/outliner/types/armature.d.ts +1 -1
  67. package/generated/outliner/types/armature_bone.d.ts +1 -1
  68. package/generated/outliner/types/billboard.d.ts +1 -1
  69. package/generated/outliner/types/bounding_box.d.ts +1 -1
  70. package/generated/outliner/types/cube.d.ts +1 -1
  71. package/generated/outliner/types/group.d.ts +1 -1
  72. package/generated/outliner/types/locator.d.ts +1 -1
  73. package/generated/outliner/types/mesh.d.ts +1 -1
  74. package/generated/outliner/types/null_object.d.ts +1 -1
  75. package/generated/outliner/types/spline_mesh.d.ts +1 -2
  76. package/generated/outliner/types/texture_mesh.d.ts +1 -1
  77. package/generated/plugin_loader.d.ts +1 -1
  78. package/generated/preview/preview.d.ts +280 -0
  79. package/generated/preview/reference_images.d.ts +1 -1
  80. package/generated/texturing/layers.d.ts +140 -0
  81. package/generated/util/gif.d.ts +12 -3
  82. package/generated/util/state_memory.d.ts +3 -11
  83. package/index.d.ts +2 -2
  84. package/package.json +39 -39
  85. package/tsconfig.json +19 -19
  86. package/type_config.json +43 -46
  87. package/custom/menu.d.ts +0 -136
  88. package/custom/preview.d.ts +0 -137
  89. package/custom/start_screen.d.ts +0 -15
  90. package/custom/texture_layers.d.ts +0 -117
  91. package/generated/global_types.d.ts +0 -47
  92. package/generated/io/formats/bedrock.d.ts +0 -4
  93. package/generated/io/formats/bedrock_old.d.ts +0 -4
  94. package/generated/io/formats/collada.d.ts +0 -4
  95. package/generated/io/formats/fbx.d.ts +0 -17
  96. package/generated/io/formats/gltf.d.ts +0 -6
  97. package/generated/io/formats/java_block.d.ts +0 -4
  98. package/generated/io/formats/modded_entity.d.ts +0 -139
  99. package/generated/io/formats/obj.d.ts +0 -12
  100. package/generated/io/formats/optifine_jem.d.ts +0 -3
  101. package/generated/io/formats/optifine_jpm.d.ts +0 -3
  102. package/generated/io/formats/skin.d.ts +0 -22
package/documentation.md CHANGED
@@ -1,12 +1,12 @@
1
-
2
- Welcome to the reference documentation for Blockbench!
3
-
4
- This documentation is automatically generated from the comments and typescript types of the latest Blockbench release.
5
-
6
- The documentation is mainly intended for plugin creators. You can find guides on how to get started with plugin development on the Blockbench wiki: [Creating a Plugin - Blockbench Wiki](https://www.blockbench.net/wiki/docs/plugin)
7
-
8
- ### Navigation
9
-
10
- The documentation in the sidebar is divided into two categories: `custom` and `generated`. This separation is mostly irrelevant when reading types, it just stems from the fact that some code is written directly in Typescript, while other code is still written in Javascript with custom types. In some cases, there may be duplicated references between the two, in that case you can usually reference the one in `custom`.
11
-
12
- You should be able to find any class and variable via the search function.
1
+
2
+ Welcome to the reference documentation for Blockbench!
3
+
4
+ This documentation is automatically generated from the comments and typescript types of the latest Blockbench release.
5
+
6
+ The documentation is mainly intended for plugin creators. You can find guides on how to get started with plugin development on the Blockbench wiki: [Creating a Plugin - Blockbench Wiki](https://www.blockbench.net/wiki/docs/plugin)
7
+
8
+ ### Navigation
9
+
10
+ The documentation in the sidebar is divided into two categories: `custom` and `generated`. This separation is mostly irrelevant when reading types, it just stems from the fact that some code is written directly in Typescript, while other code is still written in Javascript with custom types. In some cases, there may be duplicated references between the two, in that case you can usually reference the one in `custom`.
11
+
12
+ You should be able to find any class and variable via the search function.
@@ -0,0 +1,7 @@
1
+ declare global {
2
+ interface BarItemRegistry {
3
+ mirror_animating: Toggle;
4
+ flip_animation: Action;
5
+ }
6
+ }
7
+ export {};
@@ -69,7 +69,7 @@ declare global {
69
69
  max_data_points: number;
70
70
  };
71
71
  };
72
- menu: Menu;
72
+ menu: import("../interface/menu").Menu;
73
73
  }
74
74
  class NullObjectAnimator extends BoneAnimator {
75
75
  solver: any;
@@ -34,12 +34,15 @@ export declare const Blockbench: {
34
34
  version: string;
35
35
  operating_system: string;
36
36
  platform: string;
37
+ browser: string;
37
38
  flags: any[];
38
39
  drag_handlers: {};
39
40
  events: {};
40
41
  openTime: Date;
41
42
  setup_successful: null | true;
42
43
  argv: string[];
44
+ queries: Record<string, string | boolean>;
45
+ startup_count: number;
43
46
  /**
44
47
  * @deprecated Use Undo.initEdit and Undo.finishEdit instead
45
48
  */
@@ -102,8 +105,9 @@ export declare const Blockbench: {
102
105
  removeDragHandler: typeof Filesystem.removeDragHandler;
103
106
  };
104
107
  declare global {
105
- interface window {
108
+ interface Window {
106
109
  Blockbench: typeof Blockbench;
110
+ osfs: '/' | '\\';
107
111
  }
108
112
  }
109
113
  declare const global: {
@@ -117,12 +121,15 @@ declare const global: {
117
121
  version: string;
118
122
  operating_system: string;
119
123
  platform: string;
124
+ browser: string;
120
125
  flags: any[];
121
126
  drag_handlers: {};
122
127
  events: {};
123
128
  openTime: Date;
124
129
  setup_successful: null | true;
125
130
  argv: string[];
131
+ queries: Record<string, string | boolean>;
132
+ startup_count: number;
126
133
  /**
127
134
  * @deprecated Use Undo.initEdit and Undo.finishEdit instead
128
135
  */
@@ -5,12 +5,13 @@ declare global {
5
5
  path: string;
6
6
  content?: string | ArrayBuffer;
7
7
  browser_file?: File;
8
+ no_file?: boolean;
8
9
  };
9
10
  /**
10
11
  * The resource identifier group, used to allow the file dialog (open and save) to remember where it was last used
11
12
  */
12
13
  export type ResourceID = string | 'texture' | 'minecraft_skin' | 'dev_plugin' | 'animation' | 'animation_particle' | 'animation_audio' | 'theme' | 'model' | 'gltf' | 'obj' | 'preview_background' | 'screenshot' | 'palette';
13
- type ReadType = 'buffer' | 'binary' | 'text' | 'image' | 'none';
14
+ export type ReadType = 'buffer' | 'binary' | 'text' | 'image' | 'none';
14
15
  export interface ReadOptions {
15
16
  readtype?: ReadType | ((file: string) => ReadType);
16
17
  errorbox?: boolean;
@@ -0,0 +1,6 @@
1
+ import { Action } from './interface/actions';
2
+ declare global {
3
+ interface BarItemRegistry {
4
+ find_replace: Action;
5
+ }
6
+ }
@@ -1,13 +1,11 @@
1
- declare global {
2
- function getMtlFace(obj: any, index: any): string | false;
3
- namespace cube_face_normals {
4
- let north: number[];
5
- let east: number[];
6
- let south: number[];
7
- let west: number[];
8
- let up: number[];
9
- let down: number[];
10
- }
1
+ declare var _obj_export: any;
2
+ declare namespace cube_face_normals {
3
+ let north: number[];
4
+ let east: number[];
5
+ let south: number[];
6
+ let west: number[];
7
+ let up: number[];
8
+ let down: number[];
11
9
  }
12
-
10
+ declare var codec: Codec;
13
11
  export {};
@@ -1,6 +1,8 @@
1
1
  import MolangParser from "molangjs";
2
2
  import tinycolor from "tinycolor2";
3
- export declare const BarItems: Record<string, BarItem>;
3
+ import { RaycastResult } from "../preview/preview";
4
+ import { MenuItem } from "./menu";
5
+ export declare const BarItems: any;
4
6
  type SubKeybind = {
5
7
  name: string;
6
8
  keybind?: Keybind;
@@ -8,6 +10,7 @@ type SubKeybind = {
8
10
  trigger: (event: Event) => void;
9
11
  };
10
12
  export interface KeybindItemOptions {
13
+ id?: string;
11
14
  name?: string;
12
15
  description?: string;
13
16
  category?: string;
@@ -52,7 +55,7 @@ export declare abstract class BarItem extends EventSystem {
52
55
  id: string;
53
56
  name: string;
54
57
  description: string;
55
- icon?: IconString | (() => IconString);
58
+ icon?: IconString | ((context?: any) => IconString);
56
59
  category?: string;
57
60
  color?: string;
58
61
  condition: ConditionResolvable;
@@ -112,9 +115,7 @@ export declare class KeybindItem {
112
115
  description?: string;
113
116
  };
114
117
  };
115
- constructor(id: string, data: KeybindItemOptions & {
116
- id: string;
117
- });
118
+ constructor(id: string, data: KeybindItemOptions);
118
119
  delete(): void;
119
120
  }
120
121
  export interface ActionOptions extends BarItemOptions {
@@ -312,7 +313,7 @@ export interface BrushOptions {
312
313
  interface ToolSpecificOptions {
313
314
  selectFace?: boolean;
314
315
  selectElements?: boolean;
315
- transformerMode?: 'translate' | 'hidden' | '';
316
+ transformerMode?: 'translate' | 'scale' | 'rotate' | 'stretch' | 'hidden' | '';
316
317
  cursor?: string;
317
318
  animation_channel?: string;
318
319
  toolbar?: string;
@@ -329,7 +330,7 @@ interface ToolSpecificOptions {
329
330
  onCanvasClick?(raycast_data: RaycastResult): void;
330
331
  onSelect?(): void;
331
332
  onUnselect?(): void;
332
- onCanvasMouseMove?(raycast_data: RaycastResult): any;
333
+ onCanvasMouseMove?(raycast_data: RaycastResult | false): any;
333
334
  onCanvasRightClick?(raycast_data: RaycastResult): any;
334
335
  onTextureEditorClick?(raycast_data: RaycastResult): any;
335
336
  }
@@ -393,13 +394,13 @@ interface WidgetOptions extends BarItemOptions {
393
394
  export declare abstract class Widget extends BarItem {
394
395
  constructor(id: string, data: WidgetOptions);
395
396
  }
396
- type NumSliderOptions = WidgetOptions & {
397
+ export type NumSliderOptions = WidgetOptions & {
397
398
  private?: boolean;
398
399
  settings?: {
399
400
  default?: number;
400
401
  min?: number;
401
402
  max?: number;
402
- interval?: number;
403
+ interval?: number | (() => number);
403
404
  step?: number;
404
405
  show_bar?: boolean;
405
406
  limit?: boolean;
@@ -502,7 +503,7 @@ export declare class BarSlider extends Widget {
502
503
  type BarSelectPropertyFormat = string | boolean | {
503
504
  name: string | true;
504
505
  condition?: ConditionResolvable;
505
- icon?: string;
506
+ icon?: IconString;
506
507
  };
507
508
  interface BarSelectOptions extends WidgetOptions {
508
509
  value?: string;
@@ -580,7 +581,7 @@ declare const global: {
580
581
  structure: {};
581
582
  save(): void;
582
583
  };
583
- BarItems: Record<string, import("./actions").BarItem>;
584
+ BarItems: any;
584
585
  };
585
586
  declare global {
586
587
  type BarItem = import('./actions').BarItem;
@@ -605,6 +606,9 @@ declare global {
605
606
  const BarText: typeof global.BarText;
606
607
  type ColorPicker = import('./actions').ColorPicker;
607
608
  const ColorPicker: typeof global.ColorPicker;
608
- const BarItems: typeof global.BarItems;
609
+ const BarItems: BarItemRegistry;
610
+ interface BarItemRegistry {
611
+ [key: string]: BarItem;
612
+ }
609
613
  }
610
614
  export {};
@@ -1,5 +1,6 @@
1
+ import { Filesystem } from "../file_system";
1
2
  import { EventSystem } from "../util/event_system";
2
- type ReadType = 'buffer' | 'binary' | 'text' | 'image';
3
+ type ReadType = Filesystem.ReadType;
3
4
  export declare enum FormInputType {
4
5
  Text = "text",
5
6
  Password = "password",
@@ -0,0 +1,23 @@
1
+ declare global {
2
+ interface BarItemRegistry {
3
+ move_tool: Tool;
4
+ resize_tool: Tool;
5
+ rotate_tool: Tool;
6
+ pivot_tool: Tool;
7
+ vertex_snap_tool: Tool;
8
+ stretch_tool: Tool;
9
+ swap_tools: Action;
10
+ set_element_marker_color: Action;
11
+ randomize_marker_colors: Action;
12
+ new_window: Action;
13
+ open_model_folder: Action;
14
+ reload: Action;
15
+ open_dev_tools: Action;
16
+ fullscreen: Action;
17
+ zoom_in: Action;
18
+ zoom_out: Action;
19
+ zoom_reset: Action;
20
+ toggle_sidebars: Action;
21
+ }
22
+ }
23
+ export {};
@@ -0,0 +1,141 @@
1
+ /**
2
+ * The menu class lets you create content menus. Context menus can contain custom menu items, and a number of existing UI elements, including Actions, Tools, etc.
3
+ *
4
+ * ## Example
5
+ * ```
6
+ * document.addEventListener('contextmenu', event => {
7
+ * let items = [
8
+ * 'open_model',
9
+ * {
10
+ * name: 'Example',
11
+ * icon: 'house',
12
+ * click() {
13
+ * console.log('Hello World')
14
+ * }
15
+ * }
16
+ * ];
17
+ * new Menu(items).open(event);
18
+ * })
19
+ * ```
20
+ * @module
21
+ */
22
+ export interface CustomMenuItem {
23
+ name: string;
24
+ id?: string;
25
+ icon: IconString | boolean | ((context: any) => (IconString | boolean));
26
+ color?: string;
27
+ description?: string;
28
+ condition?: ConditionResolvable;
29
+ /**
30
+ * Keybind or string to display in the menu, won't work as an actual keybinding by default
31
+ */
32
+ keybind?: Keybind | string;
33
+ /**
34
+ * If true, mark the menu item as the selected one (underlined text in default theme)
35
+ */
36
+ marked?: boolean | ((context: any) => boolean);
37
+ /**
38
+ * Adds a search bar to the menu or submenu
39
+ */
40
+ searchable?: boolean;
41
+ children?: MenuItem[] | ((context: any) => MenuItem[]);
42
+ click?(context?: any, event?: Event): void;
43
+ }
44
+ export type MenuItem = CustomMenuItem | Action | BarSelect | MenuSeparator | string | ((context: any) => MenuItem);
45
+ type MenuOpenPositionAnchor = MouseEvent | HTMLElement | 'mouse';
46
+ export interface MenuOptions {
47
+ onOpen?(position: MenuOpenPositionAnchor, context?: any): void;
48
+ onClose?(): void;
49
+ keep_open?: boolean;
50
+ searchable?: boolean;
51
+ class?: string | string[];
52
+ }
53
+ export declare class MenuSeparator {
54
+ id: string;
55
+ label?: string;
56
+ menu_node: HTMLLIElement;
57
+ constructor(id?: string, label?: string);
58
+ }
59
+ /**
60
+ * Use the Menu class to create a context menu. Menus can contain custom entries and hierarchy, or existing actions and tools.
61
+ */
62
+ export declare class Menu implements Deletable {
63
+ id: string;
64
+ children: [];
65
+ structure: MenuItem[] | ((context: any) => MenuItem[]);
66
+ options?: MenuOptions;
67
+ condition?: ConditionResolvable;
68
+ onOpen?(position: MenuOpenPositionAnchor, context?: any): void;
69
+ onClose?(): void;
70
+ node: HTMLUListElement;
71
+ highlight_action?: MenuItem;
72
+ type: string;
73
+ /**
74
+ * Creates a new context menu
75
+ */
76
+ constructor(template: MenuItem[] | ((context?: any) => MenuItem[]), options?: MenuOptions);
77
+ constructor(id: string, template: MenuItem[] | ((context?: any) => MenuItem[]), options?: MenuOptions);
78
+ hover(node: HTMLElement, event?: Event, expand?: boolean): void;
79
+ /**
80
+ * Trigger keyboard navigation
81
+ * @param e Event
82
+ * @returns True if the input was used for navigation
83
+ * @private
84
+ */
85
+ keyNavigate(e: KeyboardEvent): boolean;
86
+ /**
87
+ * Opens the menu somewhere
88
+ * @param position Position where to open the menu. Can be a mouse event, or a node that the menu is spawned below.
89
+ * @param context Context for the click events inside the menu
90
+ */
91
+ open(position?: MenuOpenPositionAnchor, context?: any): this;
92
+ /**
93
+ * Alias for .open()
94
+ */
95
+ show(position?: MenuOpenPositionAnchor, context?: any): this;
96
+ /**
97
+ * Closes the menu if it's open
98
+ */
99
+ hide(): this;
100
+ /**
101
+ * @deprecated
102
+ */
103
+ conditionMet(): boolean;
104
+ /**
105
+ * Adds an action to the menu structure
106
+ * @param action Action to add
107
+ * @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.
108
+ */
109
+ addAction(action: Action | CustomMenuItem | '_', path?: string | number): void;
110
+ /**
111
+ * Remove an action or menu item from the menu
112
+ * @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.
113
+ */
114
+ removeAction(path: string | Action): void;
115
+ /**
116
+ * @deprecated Use removeAction instead
117
+ */
118
+ deleteItem(rm_item: Action): void;
119
+ delete(): void;
120
+ static open: Menu | null;
121
+ static closed_in_this_click?: string;
122
+ }
123
+ export declare function preventContextMenu(): void;
124
+ declare const global: {
125
+ MenuSeparator: typeof import("./menu").MenuSeparator;
126
+ Menu: typeof import("./menu").Menu;
127
+ preventContextMenu: typeof import("./menu").preventContextMenu;
128
+ open_menu: any;
129
+ };
130
+ declare global {
131
+ type Menu = import('./menu').Menu;
132
+ const Menu: typeof global.Menu;
133
+ type MenuSeparator = import('./menu').MenuSeparator;
134
+ const MenuSeparator: typeof global.MenuSeparator;
135
+ function preventContextMenu(): void;
136
+ let open_menu: Menu | null;
137
+ interface Window {
138
+ open_menu: Menu | null;
139
+ }
140
+ }
141
+ export {};
@@ -1,7 +1,6 @@
1
1
  declare global {
2
2
  class BarMenu extends Menu {
3
3
  constructor(id: any, structure: any, options?: {});
4
- type: string;
5
4
  id: any;
6
5
  children: any[];
7
6
  condition: any;
@@ -9,7 +8,7 @@ declare global {
9
8
  name: string;
10
9
  label: HTMLElement;
11
10
  structure: any;
12
- highlight_action: any;
11
+ highlight_action: import("./menu").MenuItem;
13
12
  open(...args: any[]): void;
14
13
  hide(): this;
15
14
  highlight(action: any): void;
@@ -27,5 +26,5 @@ declare global {
27
26
  function removeAction(path: any): void;
28
27
  }
29
28
  }
30
-
29
+ import { Menu } from "./menu";
31
30
  export {};
@@ -9,6 +9,7 @@ interface ResizeLineOptions {
9
9
  horizontal?: boolean;
10
10
  condition: ConditionResolvable;
11
11
  width?: number;
12
+ parent_element?: HTMLElement;
12
13
  get: (this: ResizeLine) => number;
13
14
  set: (this: ResizeLine, original: number, difference: number) => void;
14
15
  reset?: (this: ResizeLine) => void;
@@ -19,6 +20,7 @@ export interface ResizeLine extends ResizeLineOptions {
19
20
  export declare class ResizeLine implements ResizeLineOptions {
20
21
  before?: number;
21
22
  node: HTMLDivElement;
23
+ parent_element: HTMLElement;
22
24
  constructor(id: string, data: ResizeLineOptions);
23
25
  update(): void;
24
26
  setPosition(data: ResizeLinePositionData): void;
@@ -118,7 +118,9 @@ export declare const Settings: {
118
118
  open: boolean;
119
119
  items: Record<string, Setting>;
120
120
  }>;
121
- stored: Record<string, SettingsValue>;
121
+ stored: Record<string, {
122
+ value: SettingsValue;
123
+ }>;
122
124
  dialog: Dialog | null;
123
125
  addCategory(id: string, data: {
124
126
  name?: string;
@@ -157,7 +159,9 @@ declare const globals: {
157
159
  open: boolean;
158
160
  items: Record<string, import("./settings").Setting>;
159
161
  }>;
160
- stored: Record<string, SettingsValue>;
162
+ stored: Record<string, {
163
+ value: SettingsValue;
164
+ }>;
161
165
  dialog: Dialog | null;
162
166
  addCategory(id: string, data: {
163
167
  name?: string;
@@ -6,6 +6,7 @@
6
6
  * Handlers can be added for existing actions like this:
7
7
 
8
8
  ### Example:
9
+ * @example
9
10
  ```javascript
10
11
  // Duplicate layers when using "Duplicate" in the layers panel
11
12
  SharedActions.add('duplicate', {
@@ -23,6 +24,10 @@
23
24
  }
24
25
  })
25
26
  ```
27
+ * @module
28
+ */
29
+ /**
30
+ * Global Shared Actions namespace to access any functionality related to Shared Actions
26
31
  */
27
32
  export declare const SharedActions: {
28
33
  /**
@@ -1,47 +1,67 @@
1
- declare global {
1
+ export declare const StartScreen: {
2
+ loaders: {};
3
+ vue: null | (Vue & any);
4
+ open(): void;
5
+ updateThumbnails(model_paths?: string[]): void;
6
+ addSection: typeof addStartScreenSection;
7
+ };
8
+ interface StartScreenTextSegment {
9
+ text: string;
10
+ type?: string;
11
+ list?: string[];
12
+ click?: () => void;
13
+ }
14
+ interface StartScreenFeature {
15
+ image: string;
16
+ title: string;
2
17
  /**
3
- *
4
- * @param {string} id Identifier
5
- * @param {object} data
6
- * @param {object} data.graphic
7
- * @param {'icon'|string} data.graphic.type
8
- * @param {string} [data.graphic.icon]
9
- * @param {string} [data.graphic.source]
10
- * @param {number} [data.graphic.width]
11
- * @param {number} [data.graphic.height]
12
- * @param {number} [data.graphic.aspect_ratio] Section aspect ratio
13
- * @param {string} [data.graphic.description] Markdown string
14
- * @param {string} [data.graphic.text_color]
15
- * @param {Array.<{text: String, {type}: [String], [list]: Array.String, {click}: [Function]}>} data.text
16
- * @param {'vertical'|'horizontal'} data.layout
17
- * @param {Array} data.features
18
- * @param {boolean} data.closable
19
- * @param {Function} data.click
20
- * @param {string} data.color
21
- * @param {string} data.text_color
22
- * @param {boolean} data.last
23
- * @param {string} data.insert_after
24
- * @param {string} data.insert_before
25
- * @returns
18
+ * Markdown supported text
26
19
  */
27
- function addStartScreenSection(id: string, data: {
28
- graphic: {
29
- type: "icon" | string;
30
- icon?: string;
31
- source?: string;
32
- width?: number;
33
- height?: number;
34
- aspect_ratio?: number;
35
- description?: string;
36
- text_color?: string;
37
- };
38
- }): {
39
- delete(): void;
20
+ text: string;
21
+ }
22
+ export interface StartScreenSection {
23
+ graphic?: {
24
+ type: 'icon' | string;
25
+ icon?: string;
26
+ source?: string;
27
+ width?: number;
28
+ height?: number;
29
+ aspect_ratio?: number;
30
+ /**
31
+ * Markdown string
32
+ */
33
+ description?: string;
34
+ text_color?: string;
40
35
  };
41
- namespace StartScreen {
42
- let loaders: {};
43
- function open(): void;
44
- }
36
+ text?: StartScreenTextSegment[];
37
+ layout?: 'vertical' | 'horizontal';
38
+ features?: StartScreenFeature[];
39
+ closable?: boolean;
40
+ click?: Function;
41
+ color?: string;
42
+ text_color?: string;
43
+ last?: boolean;
44
+ insert_after?: string;
45
+ insert_before?: string;
46
+ }
47
+ /**
48
+ * Adds a section to the start screen
49
+ */
50
+ export declare function addStartScreenSection(id: string, data: StartScreenSection): {
51
+ delete(): void;
52
+ };
53
+ declare const global: {
54
+ StartScreen: {
55
+ loaders: {};
56
+ vue: null | (Vue & any);
57
+ open(): void;
58
+ updateThumbnails(model_paths?: string[]): void;
59
+ addSection: typeof import("./start_screen").addStartScreenSection;
60
+ };
61
+ addStartScreenSection: typeof import("./start_screen").addStartScreenSection;
62
+ };
63
+ declare global {
64
+ const StartScreen: typeof global.StartScreen;
65
+ const addStartScreenSection: typeof global.addStartScreenSection;
45
66
  }
46
-
47
67
  export {};