@minecraft/server-editor 0.1.0-beta.1.21.0-preview.22 → 0.1.0-beta.1.21.0-preview.24

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 +34 -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.0-preview.22"
17
+ * "version": "0.1.0-beta.1.21.0-preview.24"
18
18
  * }
19
19
  * ```
20
20
  *
@@ -128,6 +128,7 @@ export declare enum EDITOR_PANE_PROPERTY_ITEM_TYPE {
128
128
  Number = 'editorUI:Number',
129
129
  String = 'editorUI:String',
130
130
  SubPane = 'editorUI:SubPane',
131
+ Table = 'editorUI:Table',
131
132
  Text = 'editorUI:Text',
132
133
  Vec3 = 'editorUI:Vec3',
133
134
  }
@@ -495,6 +496,15 @@ export type IPlayerUISession<PerPlayerStorage = Record<string, never>> = {
495
496
  scratchStorage: PerPlayerStorage | undefined;
496
497
  };
497
498
 
499
+ /**
500
+ * A property item which supports Table properties
501
+ */
502
+ export type ITablePropertyItem<T extends PropertyBag, Prop extends keyof T & string> = IPropertyItem<T, Prop> & {
503
+ updateCell(dataCell: IPropertyTableCellItem, row: number, column: number): void;
504
+ updateRow(dataRow: IPropertyTableCellItem[], row: number): void;
505
+ updateTable(newData: IPropertyTableCellItem[][]): void;
506
+ };
507
+
498
508
  /**
499
509
  * A property item which supports Vector3 properties
500
510
  */
@@ -2933,6 +2943,12 @@ export interface IPropertyItemOptionsSubPane extends IPropertyItemOptions {
2933
2943
  pane: IPropertyPane;
2934
2944
  }
2935
2945
 
2946
+ // @ts-ignore Class inheritance allowed for native defined classes
2947
+ export interface IPropertyItemOptionsTable extends IPropertyItemOptions {
2948
+ defaultData: IPropertyTableCellItem[][];
2949
+ titleId?: string;
2950
+ }
2951
+
2936
2952
  /**
2937
2953
  * Localization string id and border enable boolean for
2938
2954
  * multiline text component.
@@ -3137,6 +3153,17 @@ export interface IPropertyPane {
3137
3153
  property: Prop,
3138
3154
  options?: IPropertyItemOptions,
3139
3155
  ): IPropertyItem<T, Prop>;
3156
+ /**
3157
+ * @remarks
3158
+ * Adds a table to the pane.
3159
+ *
3160
+ */
3161
+ addTable(options?: IPropertyItemOptionsTable): ITablePropertyItem<
3162
+ {
3163
+ EMPTY: undefined;
3164
+ },
3165
+ 'EMPTY'
3166
+ >;
3140
3167
  /**
3141
3168
  * @remarks
3142
3169
  * Adds a multiline Text item to the pane.
@@ -3227,6 +3254,12 @@ export interface IPropertyPaneOptions {
3227
3254
  width?: number;
3228
3255
  }
3229
3256
 
3257
+ export interface IPropertyTableCellItem {
3258
+ block?: string;
3259
+ icon?: string;
3260
+ text?: string;
3261
+ }
3262
+
3230
3263
  /**
3231
3264
  * Optional parameter definition for RegisterEditorExtension
3232
3265
  * function Allows the extension registrar to specify optional
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-editor",
3
- "version": "0.1.0-beta.1.21.0-preview.22",
3
+ "version": "0.1.0-beta.1.21.0-preview.24",
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.12.0-beta.1.21.0-preview.22"
17
+ "@minecraft/server": "^1.12.0-beta.1.21.0-preview.24"
18
18
  },
19
19
  "license": "MIT"
20
20
  }