@minecraft/server-editor 0.1.0-beta.1.21.10-preview.20 → 0.1.0-beta.1.21.10-preview.21

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 (2) hide show
  1. package/index.d.ts +123 -1
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * ```json
15
15
  * {
16
16
  * "module_name": "@minecraft/server-editor",
17
- * "version": "0.1.0-beta.1.21.10-preview.20"
17
+ * "version": "0.1.0-beta.1.21.10-preview.21"
18
18
  * }
19
19
  * ```
20
20
  *
@@ -36,6 +36,14 @@ export enum BlockPaletteItemType {
36
36
  Probability = 1,
37
37
  }
38
38
 
39
+ /**
40
+ * Predefined action bar items
41
+ */
42
+ export declare enum CoreActionBarItemType {
43
+ Redo = 'editor:actionBarItem:redo',
44
+ Undo = 'editor:actionBarItem:undo',
45
+ }
46
+
39
47
  /**
40
48
  * Predefined top level menus for core editor
41
49
  */
@@ -122,6 +130,7 @@ export declare enum EDITOR_PANE_PROPERTY_ITEM_TYPE {
122
130
  Action = 'editorUI:Action',
123
131
  BlockPicker = 'editorUI:BlockPicker',
124
132
  Boolean = 'editorUI:Boolean',
133
+ ColorPicker = 'editorUI:ColorPicker',
125
134
  Divider = 'editorUI:Divider',
126
135
  Dropdown = 'editorUI:Dropdown',
127
136
  Image = 'editorUI:Image',
@@ -488,6 +497,7 @@ export type IPlayerUISession<PerPlayerStorage = Record<string, never>> = {
488
497
  readonly actionManager: ActionManager;
489
498
  readonly inputManager: IGlobalInputManager;
490
499
  readonly menuBar: IMenuContainer;
500
+ readonly actionBar: IActionBar;
491
501
  readonly toolRail: IModalToolContainer;
492
502
  readonly log: IPlayerLogger;
493
503
  readonly extensionContext: ExtensionContext;
@@ -2666,6 +2676,103 @@ export declare interface EventSink<T> {
2666
2676
  subscribe(handler: EventHandler<T>): IEventToken;
2667
2677
  }
2668
2678
 
2679
+ /**
2680
+ * Manager for IActionBarItem objects.
2681
+ */
2682
+ export interface IActionBar {
2683
+ /**
2684
+ * @remarks
2685
+ * Add a new action bar item to the collection.
2686
+ *
2687
+ * @param id
2688
+ * Unique item identifier.
2689
+ * @param action
2690
+ * Action to be invoked.
2691
+ * @param props
2692
+ * Configuration for the item to create.
2693
+ */
2694
+ registerItem(
2695
+ id: string,
2696
+ action: RegisteredAction<NoArgsAction>,
2697
+ props: IActionBarItemCreationParams,
2698
+ ): IActionBarItem;
2699
+ /**
2700
+ * @remarks
2701
+ * Remove an action item from the collection.
2702
+ *
2703
+ * @param id
2704
+ * Unique item identifier.
2705
+ */
2706
+ unregisterItem(id: string): void;
2707
+ }
2708
+
2709
+ /**
2710
+ * Registered item handle in the Action Bar collection.
2711
+ */
2712
+ export interface IActionBarItem {
2713
+ /**
2714
+ * @remarks
2715
+ * Returns the current enabled state of the item.
2716
+ *
2717
+ */
2718
+ getEnabled: () => boolean;
2719
+ /**
2720
+ * @remarks
2721
+ * Unique identifier of the item.
2722
+ *
2723
+ */
2724
+ readonly id: string;
2725
+ /**
2726
+ * @remarks
2727
+ * Text label of the item.
2728
+ *
2729
+ */
2730
+ readonly label: string;
2731
+ /**
2732
+ * @remarks
2733
+ * Modify enabled state of the item.
2734
+ *
2735
+ */
2736
+ setEnabled: (enabled: boolean) => void;
2737
+ }
2738
+
2739
+ /**
2740
+ * Properties required to create an Action Bar item.
2741
+ */
2742
+ export interface IActionBarItemCreationParams {
2743
+ /**
2744
+ * @remarks
2745
+ * Initial enabled state of the item. If not defined, default
2746
+ * is true.
2747
+ *
2748
+ */
2749
+ enabled?: boolean;
2750
+ /**
2751
+ * @remarks
2752
+ * Icon resource for the item.
2753
+ *
2754
+ */
2755
+ icon: string;
2756
+ /**
2757
+ * @remarks
2758
+ * Text label for item.
2759
+ *
2760
+ */
2761
+ label: string;
2762
+ /**
2763
+ * @remarks
2764
+ * Tooltip description for the item.
2765
+ *
2766
+ */
2767
+ tooltipDescription?: string;
2768
+ /**
2769
+ * @remarks
2770
+ * Tooltip title for the item.
2771
+ *
2772
+ */
2773
+ tooltipTitle?: string;
2774
+ }
2775
+
2669
2776
  /**
2670
2777
  * Simple abstraction for disposable objects.
2671
2778
  */
@@ -3016,6 +3123,11 @@ export interface IPropertyItemOptionsButton extends IPropertyItemOptions {
3016
3123
  variant?: ButtonVariant;
3017
3124
  }
3018
3125
 
3126
+ // @ts-ignore Class inheritance allowed for native defined classes
3127
+ export interface IPropertyItemOptionsColorPicker extends IPropertyItemOptions {
3128
+ showAlpha?: boolean;
3129
+ }
3130
+
3019
3131
  // @ts-ignore Class inheritance allowed for native defined classes
3020
3132
  export interface IPropertyItemOptionsDataPicker extends IPropertyItemOptions {
3021
3133
  /**
@@ -3225,6 +3337,16 @@ export interface IPropertyPane {
3225
3337
  },
3226
3338
  'EMPTY'
3227
3339
  >;
3340
+ /**
3341
+ * @remarks
3342
+ * Adds a color picker item to the pane.
3343
+ *
3344
+ */
3345
+ addColorPicker<T extends PropertyBag, Prop extends keyof T & string>(
3346
+ obj: T,
3347
+ property: Prop,
3348
+ options?: IPropertyItemOptionsColorPicker,
3349
+ ): IPropertyItem<T, Prop>;
3228
3350
  /**
3229
3351
  * @remarks
3230
3352
  * Adds an divider item to the pane.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-editor",
3
- "version": "0.1.0-beta.1.21.10-preview.20",
3
+ "version": "0.1.0-beta.1.21.10-preview.21",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "dependencies": {
16
16
  "@minecraft/common": "^1.0.0",
17
- "@minecraft/server": "^1.13.0-beta.1.21.10-preview.20"
17
+ "@minecraft/server": "^1.13.0-beta.1.21.10-preview.21"
18
18
  },
19
19
  "license": "MIT"
20
20
  }