@minecraft/server-editor 0.1.0-beta.1.21.30-preview.21 → 0.1.0-beta.1.21.30-preview.22

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 +251 -46
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -31,6 +31,11 @@ export declare enum ActionTypes {
31
31
  NoArgsAction = 'NoArgsAction',
32
32
  }
33
33
 
34
+ export enum BlockMaskListType {
35
+ Mask = 'Mask',
36
+ Replace = 'Replace',
37
+ }
38
+
34
39
  export enum BlockPaletteItemType {
35
40
  Simple = 0,
36
41
  Probability = 1,
@@ -44,11 +49,6 @@ export declare enum BoolPropertyItemVariant {
44
49
  ToggleSwitch = 1,
45
50
  }
46
51
 
47
- export enum BrushPipelineOperationType {
48
- Include = 0,
49
- Exclude = 1,
50
- }
51
-
52
52
  /**
53
53
  * The possible variants of a Button property item.
54
54
  */
@@ -1078,7 +1078,7 @@ export type IObservableProp<T> = IObservable<T> | T;
1078
1078
  */
1079
1079
  export type IPlayerUISession<PerPlayerStorage = Record<string, never>> = {
1080
1080
  createStatusBarItem(alignment: EditorStatusBarAlignment, size: number): IStatusBarItem;
1081
- createPropertyPane(options: IPropertyPaneOptions): IPropertyPane;
1081
+ createPropertyPane(options: IRootPropertyPaneOptions): IRootPropertyPane;
1082
1082
  readonly actionManager: ActionManager;
1083
1083
  readonly inputManager: IGlobalInputManager;
1084
1084
  readonly menuBar: IMenuContainer;
@@ -1399,12 +1399,14 @@ export class BrushShapeManager {
1399
1399
  private constructor();
1400
1400
  readonly activeBrushShape?: BrushShape;
1401
1401
  readonly activeBrushVolume?: minecraftserver.CompoundBlockVolume;
1402
- readonly brushShapeNames: string[];
1402
+ readonly brushShapeList: BrushShape[];
1403
1403
  /**
1404
1404
  * @remarks
1405
1405
  * This function can't be called in read-only mode.
1406
1406
  *
1407
1407
  * @throws This function can throw errors.
1408
+ *
1409
+ * {@link minecraftserver.Error}
1408
1410
  */
1409
1411
  activateBrushShape(name: string): minecraftserver.CompoundBlockVolume;
1410
1412
  /**
@@ -1412,15 +1414,32 @@ export class BrushShapeManager {
1412
1414
  * This function can't be called in read-only mode.
1413
1415
  *
1414
1416
  */
1415
- getBrushVolume(
1416
- origin: minecraftserver.Vector3,
1417
- pipeline: BrushPipelineOperation[],
1418
- ): minecraftserver.CompoundBlockVolume | undefined;
1417
+ activateBrushTool(): void;
1418
+ /**
1419
+ * @remarks
1420
+ * This function can't be called in read-only mode.
1421
+ *
1422
+ */
1423
+ beginPainting(): void;
1424
+ /**
1425
+ * @remarks
1426
+ * This function can't be called in read-only mode.
1427
+ *
1428
+ */
1429
+ deactivateBrushTool(): void;
1430
+ /**
1431
+ * @remarks
1432
+ * This function can't be called in read-only mode.
1433
+ *
1434
+ */
1435
+ endPainting(): void;
1419
1436
  /**
1420
1437
  * @remarks
1421
1438
  * This function can't be called in read-only mode.
1422
1439
  *
1423
1440
  * @throws This function can throw errors.
1441
+ *
1442
+ * {@link Error}
1424
1443
  */
1425
1444
  getSettingsUIElements(brushName: string): SettingsUIElement[];
1426
1445
  /**
@@ -1428,6 +1447,8 @@ export class BrushShapeManager {
1428
1447
  * This function can't be called in read-only mode.
1429
1448
  *
1430
1449
  * @throws This function can throw errors.
1450
+ *
1451
+ * {@link Error}
1431
1452
  */
1432
1453
  registerBrushShape(
1433
1454
  name: string,
@@ -1440,6 +1461,34 @@ export class BrushShapeManager {
1440
1461
  * This function can't be called in read-only mode.
1441
1462
  *
1442
1463
  * @throws This function can throw errors.
1464
+ *
1465
+ * {@link Error}
1466
+ */
1467
+ setBlockPaletteOverride(
1468
+ overrideBlock?: minecraftserver.BlockPermutation | minecraftserver.BlockType | string,
1469
+ ): void;
1470
+ /**
1471
+ * @remarks
1472
+ * This function can't be called in read-only mode.
1473
+ *
1474
+ * @throws This function can throw errors.
1475
+ *
1476
+ * {@link Error}
1477
+ */
1478
+ setBrushMask(mask: BlockMaskList): void;
1479
+ /**
1480
+ * @remarks
1481
+ * This function can't be called in read-only mode.
1482
+ *
1483
+ */
1484
+ setBrushShape(shape: minecraftserver.Vector3[] | minecraftserver.CompoundBlockVolume): void;
1485
+ /**
1486
+ * @remarks
1487
+ * This function can't be called in read-only mode.
1488
+ *
1489
+ * @throws This function can throw errors.
1490
+ *
1491
+ * {@link Error}
1443
1492
  */
1444
1493
  uiSettingValueChanged(elementName: string, newValue: boolean | number | string | minecraftserver.Vector3): boolean;
1445
1494
  }
@@ -1634,6 +1683,51 @@ export class ClipboardManager {
1634
1683
  create(): ClipboardItem;
1635
1684
  }
1636
1685
 
1686
+ export class CurrentThemeChangeAfterEvent {
1687
+ private constructor();
1688
+ readonly name: string;
1689
+ }
1690
+
1691
+ export class CurrentThemeChangeAfterEventSignal {
1692
+ private constructor();
1693
+ /**
1694
+ * @remarks
1695
+ * This function can't be called in read-only mode.
1696
+ *
1697
+ */
1698
+ subscribe(callback: (arg: CurrentThemeChangeAfterEvent) => void): (arg: CurrentThemeChangeAfterEvent) => void;
1699
+ /**
1700
+ * @remarks
1701
+ * This function can't be called in read-only mode.
1702
+ *
1703
+ */
1704
+ unsubscribe(callback: (arg: CurrentThemeChangeAfterEvent) => void): void;
1705
+ }
1706
+
1707
+ export class CurrentThemeColorChangeAfterEvent {
1708
+ private constructor();
1709
+ readonly color: minecraftserver.RGBA;
1710
+ readonly colorKey: ThemeSettingsColorKey;
1711
+ }
1712
+
1713
+ export class CurrentThemeColorChangeAfterEventSignal {
1714
+ private constructor();
1715
+ /**
1716
+ * @remarks
1717
+ * This function can't be called in read-only mode.
1718
+ *
1719
+ */
1720
+ subscribe(
1721
+ callback: (arg: CurrentThemeColorChangeAfterEvent) => void,
1722
+ ): (arg: CurrentThemeColorChangeAfterEvent) => void;
1723
+ /**
1724
+ * @remarks
1725
+ * This function can't be called in read-only mode.
1726
+ *
1727
+ */
1728
+ unsubscribe(callback: (arg: CurrentThemeColorChangeAfterEvent) => void): void;
1729
+ }
1730
+
1637
1731
  /**
1638
1732
  * The 3D block cursor is controlled through this read only
1639
1733
  * object and provides the Editor some control over the input
@@ -2021,6 +2115,8 @@ export class ExtensionContext {
2021
2115
  export class ExtensionContextAfterEvents {
2022
2116
  private constructor();
2023
2117
  readonly clipboardChange: ClipboardChangeAfterEventSignal;
2118
+ readonly currentThemeChange: CurrentThemeChangeAfterEventSignal;
2119
+ readonly currentThemeColorChange: CurrentThemeColorChangeAfterEventSignal;
2024
2120
  readonly cursorAttachmentPropertyChange: CursorAttachmentPropertyChangeAfterEventSignal;
2025
2121
  readonly cursorPropertyChange: CursorPropertyChangeAfterEventSignal;
2026
2122
  /**
@@ -2697,6 +2793,7 @@ export class ThemeSettings {
2697
2793
  * {@link Error}
2698
2794
  */
2699
2795
  addNewTheme(name: string): void;
2796
+ canThemeBeModified(name: string): boolean;
2700
2797
  /**
2701
2798
  * @remarks
2702
2799
  * This function can't be called in read-only mode.
@@ -2708,7 +2805,7 @@ export class ThemeSettings {
2708
2805
  deleteTheme(name: string): void;
2709
2806
  getCurrentTheme(): string;
2710
2807
  getThemeList(): string[];
2711
- resolveColorKey(key: ThemeSettingsColorKey): minecraftserver.RGBA | undefined;
2808
+ resolveColorKey(key: ThemeSettingsColorKey): minecraftserver.RGBA;
2712
2809
  /**
2713
2810
  * @remarks
2714
2811
  * This function can't be called in read-only mode.
@@ -3571,9 +3668,9 @@ export class WidgetStateChangeEventData {
3571
3668
  readonly widget: Widget;
3572
3669
  }
3573
3670
 
3574
- export interface BrushPipelineOperation {
3575
- blockTypes: minecraftserver.BlockType[];
3576
- operation: BrushPipelineOperationType;
3671
+ export interface BlockMaskList {
3672
+ blockList: (minecraftserver.BlockPermutation | minecraftserver.BlockType | string)[];
3673
+ maskType: BlockMaskListType;
3577
3674
  }
3578
3675
 
3579
3676
  export interface BrushShape {
@@ -3869,6 +3966,15 @@ export interface WidgetComponentTextOptions extends WidgetComponentBaseOptions {
3869
3966
  color?: minecraftserver.RGBA;
3870
3967
  }
3871
3968
 
3969
+ export interface WidgetCreateOptions {
3970
+ collisionOffset?: minecraftserver.Vector3;
3971
+ collisionRadius?: number;
3972
+ selectable?: boolean;
3973
+ snapToBlockLocation?: boolean;
3974
+ stateChangeEvent?: (arg: WidgetStateChangeEventData) => void;
3975
+ visible?: boolean;
3976
+ }
3977
+
3872
3978
  export interface WidgetGroupCreateOptions {
3873
3979
  groupSelectionMode?: WidgetGroupSelectionMode;
3874
3980
  showBounds?: boolean;
@@ -5157,30 +5263,12 @@ export interface IPropertyPane {
5157
5263
  *
5158
5264
  */
5159
5265
  onPropertyPaneVisibilityUpdated: EventSink<PropertyPaneVisibilityUpdate>;
5160
- /**
5161
- * @remarks
5162
- * In case of sub pane this is the id of the parent pane.
5163
- *
5164
- */
5165
- readonly parentPaneId?: string;
5166
- /**
5167
- * @remarks
5168
- * Localized title of the property pane
5169
- *
5170
- */
5171
- title: string;
5172
5266
  /**
5173
5267
  * @remarks
5174
5268
  * Check visibility of the pane
5175
5269
  *
5176
5270
  */
5177
5271
  visible: boolean;
5178
- /**
5179
- * @remarks
5180
- * Width of the panel in rem.
5181
- *
5182
- */
5183
- width?: number;
5184
5272
  /**
5185
5273
  * @remarks
5186
5274
  * Adds a block list to the pane.
@@ -5351,17 +5439,22 @@ export interface IPropertyPane {
5351
5439
  collapse(): void;
5352
5440
  /**
5353
5441
  * @remarks
5354
- * Creates an internal sub panel that is presented inside a
5355
- * extender control.
5442
+ * Creates an sub pane that can store property items.
5356
5443
  *
5357
5444
  */
5358
- createPropertyPane(options: IPropertyPaneOptions): IPropertyPane;
5445
+ createSubPane(options: ISubPanePropertyItemOptions): ISubPanePropertyItem;
5359
5446
  /**
5360
5447
  * @remarks
5361
5448
  * Expand the pane.
5362
5449
  *
5363
5450
  */
5364
5451
  expand(): void;
5452
+ /**
5453
+ * @remarks
5454
+ * Returns property pane title.
5455
+ *
5456
+ */
5457
+ getTitle(): LocalizedString | undefined;
5365
5458
  /**
5366
5459
  * @remarks
5367
5460
  * Hide the pane.
@@ -5370,10 +5463,18 @@ export interface IPropertyPane {
5370
5463
  hide(): void;
5371
5464
  /**
5372
5465
  * @remarks
5373
- * Removes a child property pane from the parent pane.
5466
+ * Removes an existing sub pane.
5374
5467
  *
5375
5468
  */
5376
- removePropertyPane(paneToRemove: IPropertyPane): boolean;
5469
+ removeSubPane(paneToRemove: IPropertyPane): boolean;
5470
+ /**
5471
+ * @remarks
5472
+ * Updates title of property pane.
5473
+ *
5474
+ * @param newTitle
5475
+ * New title
5476
+ */
5477
+ setTitle(newTitle: LocalizedString | undefined): void;
5377
5478
  /**
5378
5479
  * @remarks
5379
5480
  * Show the pane and all of its property items.
@@ -5383,21 +5484,16 @@ export interface IPropertyPane {
5383
5484
  }
5384
5485
 
5385
5486
  /**
5386
- * The options to create a pane.
5487
+ * Common optional properties used for constructing a property
5488
+ * pane.
5387
5489
  */
5388
5490
  export interface IPropertyPaneOptions {
5389
- /**
5390
- * @remarks
5391
- * Layout direction for sub panes
5392
- *
5393
- */
5394
- direction?: LayoutDirection;
5395
5491
  /**
5396
5492
  * @remarks
5397
5493
  * Localized title of the property pane
5398
5494
  *
5399
5495
  */
5400
- title: string;
5496
+ title?: LocalizedString;
5401
5497
  }
5402
5498
 
5403
5499
  export interface IPropertyTableCellItem {
@@ -5434,6 +5530,50 @@ export interface IRegisterExtensionOptionalParameters {
5434
5530
  toolGroupId?: string;
5435
5531
  }
5436
5532
 
5533
+ /**
5534
+ * A root pane that can store property items.
5535
+ */
5536
+ // @ts-ignore Class inheritance allowed for native defined classes
5537
+ export interface IRootPropertyPane extends IPropertyPane {
5538
+ /**
5539
+ * @remarks
5540
+ * @returns
5541
+ * Current visibility state of header action
5542
+ */
5543
+ isHeaderActionVisible(): boolean;
5544
+ /**
5545
+ * @remarks
5546
+ * If a header action exists, updates visibility of the button.
5547
+ *
5548
+ * @param visible
5549
+ * New visibility state of the action button.
5550
+ */
5551
+ setHeaderActionVisibility(visible: boolean): void;
5552
+ }
5553
+
5554
+ /**
5555
+ * Represents the data to display an action button on a root
5556
+ * property pane header.
5557
+ */
5558
+ export interface IRootPropertyPaneHeaderAction {
5559
+ action?: () => void;
5560
+ icon: string;
5561
+ tooltip?: LocalizedString;
5562
+ }
5563
+
5564
+ /**
5565
+ * The options to create a root pane.
5566
+ */
5567
+ // @ts-ignore Class inheritance allowed for native defined classes
5568
+ export interface IRootPropertyPaneOptions extends IPropertyPaneOptions {
5569
+ /**
5570
+ * @remarks
5571
+ * Optional action button to be displayed on the header.
5572
+ *
5573
+ */
5574
+ headerAction?: IRootPropertyPaneHeaderAction;
5575
+ }
5576
+
5437
5577
  /**
5438
5578
  * The simple tool wrapper will create, bind and manage the
5439
5579
  * lifecycle of all the desired components. The wrapper is
@@ -6004,6 +6144,71 @@ export interface IStringPropertyItemOptions extends IPropertyItemOptionsBase {
6004
6144
  tooltip?: LocalizedString;
6005
6145
  }
6006
6146
 
6147
+ /**
6148
+ * A property item which supports Sub Pane properties
6149
+ */
6150
+ // @ts-ignore Class inheritance allowed for native defined classes
6151
+ export interface ISubPanePropertyItem extends IPropertyItemBase, IPropertyPane {
6152
+ /**
6153
+ * @remarks
6154
+ * Updates layout alignment of the sub pane.
6155
+ *
6156
+ * @param alignment
6157
+ * New layout alignment.
6158
+ */
6159
+ setAlignment(alignment: LayoutAlignment): void;
6160
+ /**
6161
+ * @remarks
6162
+ * Updates layout direction of the sub pane.
6163
+ *
6164
+ * @param direction
6165
+ * New layout direction.
6166
+ */
6167
+ setDirection(direction: LayoutDirection): void;
6168
+ }
6169
+
6170
+ /**
6171
+ * Optional properties for Sub Pane property item
6172
+ */
6173
+ // @ts-ignore Class inheritance allowed for native defined classes
6174
+ export interface ISubPanePropertyItemOptions extends IPropertyPaneOptions {
6175
+ /**
6176
+ * @remarks
6177
+ * Alignment of property items within the pane of the property
6178
+ * pane. If undefined, it will default to Left.
6179
+ *
6180
+ */
6181
+ alignment?: LayoutAlignment;
6182
+ /**
6183
+ * @remarks
6184
+ * Initial expander state of sub pane. If undefined, it will
6185
+ * default to false.
6186
+ *
6187
+ */
6188
+ collapsed?: boolean;
6189
+ /**
6190
+ * @remarks
6191
+ * Determines layout direction of sub pane property items. If
6192
+ * undefined, it will default to Vertical.
6193
+ *
6194
+ */
6195
+ direction?: LayoutDirection;
6196
+ /**
6197
+ * @remarks
6198
+ * Determines if sub pane should have an expander. If
6199
+ * undefined, it will default to true.
6200
+ *
6201
+ */
6202
+ hasExpander?: boolean;
6203
+ /**
6204
+ * @remarks
6205
+ * Adds additional margins to sub pane. If undefined, it will
6206
+ * default to true.
6207
+ *
6208
+ */
6209
+ hasMargins?: boolean;
6210
+ }
6211
+
6007
6212
  /**
6008
6213
  * A property item which supports Vector3 properties
6009
6214
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-editor",
3
- "version": "0.1.0-beta.1.21.30-preview.21",
3
+ "version": "0.1.0-beta.1.21.30-preview.22",
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.15.0-beta.1.21.30-preview.21"
17
+ "@minecraft/server": "^1.15.0-beta.1.21.30-preview.22"
18
18
  },
19
19
  "license": "MIT"
20
20
  }