@minecraft/server-editor 0.1.0-beta.1.21.120-preview.25 → 0.1.0-beta.1.21.130-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.
- package/index.d.ts +781 -0
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -178,6 +178,10 @@ export declare enum CoreMenuType {
|
|
|
178
178
|
WorldOptions = 'editor:menu:worldOptions',
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
export declare enum CoreModalDialogType {
|
|
182
|
+
DataPicker = 0,
|
|
183
|
+
}
|
|
184
|
+
|
|
181
185
|
/**
|
|
182
186
|
* An enumeration used by the 3D block cursor {@link Cursor}
|
|
183
187
|
*/
|
|
@@ -244,6 +248,10 @@ export enum CursorTargetMode {
|
|
|
244
248
|
Face = 1,
|
|
245
249
|
}
|
|
246
250
|
|
|
251
|
+
export declare enum DataPickerModalDialogVariant {
|
|
252
|
+
Block = 0,
|
|
253
|
+
}
|
|
254
|
+
|
|
247
255
|
export enum DaylightCycle {
|
|
248
256
|
Normal = 0,
|
|
249
257
|
AlwaysDay = 1,
|
|
@@ -955,6 +963,22 @@ export declare enum LayoutDirection {
|
|
|
955
963
|
Horizontal = 1,
|
|
956
964
|
}
|
|
957
965
|
|
|
966
|
+
export declare enum ListPaneEntryType {
|
|
967
|
+
Button = 0,
|
|
968
|
+
Bool = 1,
|
|
969
|
+
Image = 2,
|
|
970
|
+
Text = 3,
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
/**
|
|
974
|
+
* Determines how list pane slots will be sorted
|
|
975
|
+
*/
|
|
976
|
+
export declare enum ListPaneViewSortType {
|
|
977
|
+
Default = 0,
|
|
978
|
+
AtoZ = 1,
|
|
979
|
+
ZtoA = 2,
|
|
980
|
+
}
|
|
981
|
+
|
|
958
982
|
export enum LogChannel {
|
|
959
983
|
/**
|
|
960
984
|
* @remarks
|
|
@@ -976,6 +1000,20 @@ export enum LogChannel {
|
|
|
976
1000
|
All = 3,
|
|
977
1001
|
}
|
|
978
1002
|
|
|
1003
|
+
/**
|
|
1004
|
+
* Common response types for modal dialog
|
|
1005
|
+
*/
|
|
1006
|
+
export declare enum ModalDialogResponseType {
|
|
1007
|
+
Confirm = 'confirm',
|
|
1008
|
+
Dismiss = 'dismiss',
|
|
1009
|
+
Error = 'error',
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
export declare enum ModalDialogType {
|
|
1013
|
+
DataPicker = 0,
|
|
1014
|
+
Custom = 1,
|
|
1015
|
+
}
|
|
1016
|
+
|
|
979
1017
|
/**
|
|
980
1018
|
* Mouse device action categories
|
|
981
1019
|
*/
|
|
@@ -1106,6 +1144,7 @@ export declare enum PropertyItemType {
|
|
|
1106
1144
|
Dropdown = 'editorUI:Dropdown',
|
|
1107
1145
|
Image = 'editorUI:Image',
|
|
1108
1146
|
Link = 'editorUI:Link',
|
|
1147
|
+
ListPane = 'editorUI:ListPane',
|
|
1109
1148
|
Menu = 'editorUI:Menu',
|
|
1110
1149
|
Number = 'editorUI:Number',
|
|
1111
1150
|
NumberTimeline = 'editorUI:NumberTimeline',
|
|
@@ -1380,6 +1419,7 @@ export type IPlayerUISession<PerPlayerStorage = Record<string, never>> = {
|
|
|
1380
1419
|
readonly menuBar: IMenuContainer;
|
|
1381
1420
|
readonly actionBar: IActionBar;
|
|
1382
1421
|
readonly statusBar: IStatusBar;
|
|
1422
|
+
readonly dialogManager: IModalDialogManager;
|
|
1383
1423
|
readonly toolRail: IModalToolContainer;
|
|
1384
1424
|
readonly log: IPlayerLogger;
|
|
1385
1425
|
readonly extensionContext: ExtensionContext;
|
|
@@ -1405,6 +1445,108 @@ export type KeyBindingInfo = {
|
|
|
1405
1445
|
tooltip?: string;
|
|
1406
1446
|
};
|
|
1407
1447
|
|
|
1448
|
+
/**
|
|
1449
|
+
* Layout size definition
|
|
1450
|
+
*/
|
|
1451
|
+
export declare type LayoutSize = {
|
|
1452
|
+
value: number;
|
|
1453
|
+
type?: 'default' | 'percentage';
|
|
1454
|
+
};
|
|
1455
|
+
|
|
1456
|
+
/**
|
|
1457
|
+
* List Pane Bool entry creation parameter
|
|
1458
|
+
*/
|
|
1459
|
+
export type ListPaneBoolEntryParams = {
|
|
1460
|
+
type: ListPaneEntryType.Bool;
|
|
1461
|
+
value: IObservableProp<boolean>;
|
|
1462
|
+
tooltip?: BasicTooltipContent;
|
|
1463
|
+
icon?: string;
|
|
1464
|
+
enabled?: boolean;
|
|
1465
|
+
visible?: boolean;
|
|
1466
|
+
onChange?: (newValue: boolean, oldValue: boolean, entry: IListPaneBoolEntry) => void;
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1469
|
+
/**
|
|
1470
|
+
* List Pane Button entry creation parameter
|
|
1471
|
+
*/
|
|
1472
|
+
export type ListPaneButtonEntryParams = {
|
|
1473
|
+
type: ListPaneEntryType.Button;
|
|
1474
|
+
onClick: (entry: IListPaneButtonEntry) => void;
|
|
1475
|
+
title?: LocalizedString;
|
|
1476
|
+
tooltip?: BasicTooltipContent;
|
|
1477
|
+
variant?: ButtonPropertyItemVariant;
|
|
1478
|
+
icon?: string;
|
|
1479
|
+
enabled?: boolean;
|
|
1480
|
+
visible?: boolean;
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1483
|
+
/**
|
|
1484
|
+
* List Pane entry type map
|
|
1485
|
+
*/
|
|
1486
|
+
export type ListPaneEntryMap = {
|
|
1487
|
+
[ListPaneEntryType.Button]: IListPaneEntry;
|
|
1488
|
+
[ListPaneEntryType.Bool]: IListPaneBoolEntry;
|
|
1489
|
+
[ListPaneEntryType.Image]: IListPaneImageEntry;
|
|
1490
|
+
[ListPaneEntryType.Text]: IListPaneTextEntry;
|
|
1491
|
+
};
|
|
1492
|
+
|
|
1493
|
+
/**
|
|
1494
|
+
* List Pane entry creation parameters
|
|
1495
|
+
*/
|
|
1496
|
+
export type ListPaneEntryParams =
|
|
1497
|
+
| ListPaneButtonEntryParams
|
|
1498
|
+
| ListPaneBoolEntryParams
|
|
1499
|
+
| ListPaneTextEntryParams
|
|
1500
|
+
| ListPaneImageEntryParams;
|
|
1501
|
+
|
|
1502
|
+
/**
|
|
1503
|
+
* List Pane Image entry creation parameter
|
|
1504
|
+
*/
|
|
1505
|
+
export type ListPaneImageEntryParams = {
|
|
1506
|
+
type: ListPaneEntryType.Image;
|
|
1507
|
+
value: IObservableProp<ImageResourceData>;
|
|
1508
|
+
visible?: boolean;
|
|
1509
|
+
};
|
|
1510
|
+
|
|
1511
|
+
/**
|
|
1512
|
+
* Properties required to create a slot
|
|
1513
|
+
*/
|
|
1514
|
+
export type ListPaneSlotCreationProps = {
|
|
1515
|
+
entries: ListPaneEntryParams[];
|
|
1516
|
+
options?: IListPaneSlotOptions;
|
|
1517
|
+
};
|
|
1518
|
+
|
|
1519
|
+
export declare type ListPaneSlotLayout = {
|
|
1520
|
+
height: number;
|
|
1521
|
+
columns?: number;
|
|
1522
|
+
clickable?: boolean;
|
|
1523
|
+
outline?: boolean;
|
|
1524
|
+
entryLayout: ListPaneSlotLayoutEntry[];
|
|
1525
|
+
};
|
|
1526
|
+
|
|
1527
|
+
export declare type ListPaneSlotLayoutEntry = {
|
|
1528
|
+
type: ListPaneEntryType;
|
|
1529
|
+
size?: number | LayoutSize | 'shrink' | 'grow';
|
|
1530
|
+
alignment?: LayoutAlignment;
|
|
1531
|
+
};
|
|
1532
|
+
|
|
1533
|
+
/**
|
|
1534
|
+
* List Pane Text entry creation parameter
|
|
1535
|
+
*/
|
|
1536
|
+
export type ListPaneTextEntryParams = {
|
|
1537
|
+
type: ListPaneEntryType.Text;
|
|
1538
|
+
value?: IObservableProp<LocalizedString>;
|
|
1539
|
+
visible?: boolean;
|
|
1540
|
+
};
|
|
1541
|
+
|
|
1542
|
+
/**
|
|
1543
|
+
* Determines filtering properties for list pane
|
|
1544
|
+
*/
|
|
1545
|
+
export declare type ListPaneViewFilter = {
|
|
1546
|
+
slots?: string[];
|
|
1547
|
+
tags?: string[];
|
|
1548
|
+
};
|
|
1549
|
+
|
|
1408
1550
|
/**
|
|
1409
1551
|
* Represents a localized string or an object with a localized
|
|
1410
1552
|
* string and optional properties
|
|
@@ -1416,6 +1558,61 @@ export declare type LocalizedString =
|
|
|
1416
1558
|
props?: string[];
|
|
1417
1559
|
};
|
|
1418
1560
|
|
|
1561
|
+
/**
|
|
1562
|
+
* Parameters required to activate a modal dialog instance
|
|
1563
|
+
*/
|
|
1564
|
+
export type ModalDialogActivationParams<T extends CoreModalDialogType | string> = {
|
|
1565
|
+
dialogId: T;
|
|
1566
|
+
onResponse?: (
|
|
1567
|
+
payload:
|
|
1568
|
+
| (T extends CoreModalDialogType ? ModalDialogCoreResponseType[T] : ModalDialogCustomResponse)
|
|
1569
|
+
| ModalDialogDismissResponse,
|
|
1570
|
+
) => void;
|
|
1571
|
+
} & (T extends CoreModalDialogType
|
|
1572
|
+
? {
|
|
1573
|
+
data: ModalDialogRequestData[T];
|
|
1574
|
+
}
|
|
1575
|
+
: {
|
|
1576
|
+
data?: never;
|
|
1577
|
+
});
|
|
1578
|
+
|
|
1579
|
+
/**
|
|
1580
|
+
* Response data for core modal dialogs
|
|
1581
|
+
*/
|
|
1582
|
+
export type ModalDialogCoreResponseType = {
|
|
1583
|
+
[CoreModalDialogType.DataPicker]: ModalDialogDataPickerResponse;
|
|
1584
|
+
};
|
|
1585
|
+
|
|
1586
|
+
/**
|
|
1587
|
+
* Response data for custom modal dialog
|
|
1588
|
+
*/
|
|
1589
|
+
export type ModalDialogCustomResponse = {
|
|
1590
|
+
type: ModalDialogResponseType | string;
|
|
1591
|
+
payload?: unknown;
|
|
1592
|
+
};
|
|
1593
|
+
|
|
1594
|
+
/**
|
|
1595
|
+
* Payloads that confirm data picker selection
|
|
1596
|
+
*/
|
|
1597
|
+
export type ModalDialogDataPickerResponse = {
|
|
1598
|
+
type: ModalDialogResponseType.Confirm;
|
|
1599
|
+
selected: string;
|
|
1600
|
+
};
|
|
1601
|
+
|
|
1602
|
+
export type ModalDialogDismissResponse = {
|
|
1603
|
+
type: ModalDialogResponseType.Dismiss;
|
|
1604
|
+
};
|
|
1605
|
+
|
|
1606
|
+
/**
|
|
1607
|
+
* Data types supported by a modal dialog request
|
|
1608
|
+
*/
|
|
1609
|
+
export type ModalDialogRequestData = {
|
|
1610
|
+
[CoreModalDialogType.DataPicker]: {
|
|
1611
|
+
default: string;
|
|
1612
|
+
variant: DataPickerModalDialogVariant;
|
|
1613
|
+
};
|
|
1614
|
+
};
|
|
1615
|
+
|
|
1419
1616
|
/**
|
|
1420
1617
|
* Modal tool lifecycle event payload
|
|
1421
1618
|
*/
|
|
@@ -6134,6 +6331,444 @@ export interface ILinkPropertyItemOptions extends IPropertyItemOptionsBase {
|
|
|
6134
6331
|
tooltip?: LocalizedString;
|
|
6135
6332
|
}
|
|
6136
6333
|
|
|
6334
|
+
/**
|
|
6335
|
+
* List Pane button entry
|
|
6336
|
+
*/
|
|
6337
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6338
|
+
export interface IListPaneBoolEntry extends IListPaneEntry {
|
|
6339
|
+
/**
|
|
6340
|
+
* @remarks
|
|
6341
|
+
* Enabled state of the entry.
|
|
6342
|
+
*
|
|
6343
|
+
*/
|
|
6344
|
+
readonly enabled: boolean;
|
|
6345
|
+
/**
|
|
6346
|
+
* @remarks
|
|
6347
|
+
* Value of the entry.
|
|
6348
|
+
*
|
|
6349
|
+
*/
|
|
6350
|
+
readonly value: boolean;
|
|
6351
|
+
/**
|
|
6352
|
+
* @remarks
|
|
6353
|
+
* Updates enabled state of the entry.
|
|
6354
|
+
*
|
|
6355
|
+
* @param enabled
|
|
6356
|
+
* New enabled state.
|
|
6357
|
+
*/
|
|
6358
|
+
setEnabled(enabled: true): void;
|
|
6359
|
+
/**
|
|
6360
|
+
* @remarks
|
|
6361
|
+
* Updates tooltip of the entry.
|
|
6362
|
+
*
|
|
6363
|
+
* @param tooltip
|
|
6364
|
+
* New tooltip.
|
|
6365
|
+
*/
|
|
6366
|
+
setTooltip(tooltip: BasicTooltipContent): void;
|
|
6367
|
+
/**
|
|
6368
|
+
* @remarks
|
|
6369
|
+
* Updates value of the entry.
|
|
6370
|
+
*
|
|
6371
|
+
* @param value
|
|
6372
|
+
* New value.
|
|
6373
|
+
*/
|
|
6374
|
+
setValue(value: boolean): void;
|
|
6375
|
+
}
|
|
6376
|
+
|
|
6377
|
+
/**
|
|
6378
|
+
* List Pane button entry
|
|
6379
|
+
*/
|
|
6380
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6381
|
+
export interface IListPaneButtonEntry extends IListPaneEntry {
|
|
6382
|
+
/**
|
|
6383
|
+
* @remarks
|
|
6384
|
+
* Enabled state of the entry.
|
|
6385
|
+
*
|
|
6386
|
+
*/
|
|
6387
|
+
readonly enabled: boolean;
|
|
6388
|
+
/**
|
|
6389
|
+
* @remarks
|
|
6390
|
+
* Updates enabled state of the entry.
|
|
6391
|
+
*
|
|
6392
|
+
* @param enabled
|
|
6393
|
+
* New enabled state.
|
|
6394
|
+
*/
|
|
6395
|
+
setEnabled(enabled: true): void;
|
|
6396
|
+
/**
|
|
6397
|
+
* @remarks
|
|
6398
|
+
* Updates icon of the entry.
|
|
6399
|
+
*
|
|
6400
|
+
* @param icon
|
|
6401
|
+
* New icon.
|
|
6402
|
+
*/
|
|
6403
|
+
setIcon(icon: string): void;
|
|
6404
|
+
/**
|
|
6405
|
+
* @remarks
|
|
6406
|
+
* Updates title of the entry.
|
|
6407
|
+
*
|
|
6408
|
+
* @param title
|
|
6409
|
+
* New title.
|
|
6410
|
+
*/
|
|
6411
|
+
setTitle(title: string): void;
|
|
6412
|
+
/**
|
|
6413
|
+
* @remarks
|
|
6414
|
+
* Updates tooltip of the entry.
|
|
6415
|
+
*
|
|
6416
|
+
* @param tooltip
|
|
6417
|
+
* New tooltip.
|
|
6418
|
+
*/
|
|
6419
|
+
setTooltip(tooltip: BasicTooltipContent): void;
|
|
6420
|
+
}
|
|
6421
|
+
|
|
6422
|
+
/**
|
|
6423
|
+
* List Pane entry
|
|
6424
|
+
*/
|
|
6425
|
+
export interface IListPaneEntry {
|
|
6426
|
+
/**
|
|
6427
|
+
* @remarks
|
|
6428
|
+
* Sequence index of the entry.
|
|
6429
|
+
*
|
|
6430
|
+
*/
|
|
6431
|
+
readonly index: number;
|
|
6432
|
+
/**
|
|
6433
|
+
* @remarks
|
|
6434
|
+
* Slot that owns the entry.
|
|
6435
|
+
*
|
|
6436
|
+
*/
|
|
6437
|
+
readonly slot: IListPaneSlot;
|
|
6438
|
+
/**
|
|
6439
|
+
* @remarks
|
|
6440
|
+
* Type of the entry.
|
|
6441
|
+
*
|
|
6442
|
+
*/
|
|
6443
|
+
readonly type: ListPaneEntryType;
|
|
6444
|
+
/**
|
|
6445
|
+
* @remarks
|
|
6446
|
+
* Visibility state of the entry.
|
|
6447
|
+
*
|
|
6448
|
+
*/
|
|
6449
|
+
readonly visible: boolean;
|
|
6450
|
+
/**
|
|
6451
|
+
* @remarks
|
|
6452
|
+
* Updates visibility of the entry.
|
|
6453
|
+
*
|
|
6454
|
+
* @param visible
|
|
6455
|
+
* New value.
|
|
6456
|
+
*/
|
|
6457
|
+
setVisible(visible: boolean): void;
|
|
6458
|
+
}
|
|
6459
|
+
|
|
6460
|
+
/**
|
|
6461
|
+
* List Pane image entry
|
|
6462
|
+
*/
|
|
6463
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6464
|
+
export interface IListPaneImageEntry extends IListPaneEntry {
|
|
6465
|
+
/**
|
|
6466
|
+
* @remarks
|
|
6467
|
+
* Value of the entry.
|
|
6468
|
+
*
|
|
6469
|
+
*/
|
|
6470
|
+
readonly value: Readonly<ImageResourceData>;
|
|
6471
|
+
/**
|
|
6472
|
+
* @remarks
|
|
6473
|
+
* Updates value of the entry.
|
|
6474
|
+
*
|
|
6475
|
+
* @param value
|
|
6476
|
+
* New value.
|
|
6477
|
+
*/
|
|
6478
|
+
setValue(value: ImageResourceData): void;
|
|
6479
|
+
}
|
|
6480
|
+
|
|
6481
|
+
/**
|
|
6482
|
+
* A property item which supports Sub Pane properties
|
|
6483
|
+
*/
|
|
6484
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6485
|
+
export interface IListPanePropertyItem extends IPropertyItemBase, IPane {
|
|
6486
|
+
/**
|
|
6487
|
+
* @remarks
|
|
6488
|
+
* Count of the slots managed by the list.
|
|
6489
|
+
*
|
|
6490
|
+
*/
|
|
6491
|
+
readonly slotCount: number;
|
|
6492
|
+
/**
|
|
6493
|
+
* @remarks
|
|
6494
|
+
* Current sorting type for the pane slots
|
|
6495
|
+
*
|
|
6496
|
+
*/
|
|
6497
|
+
readonly viewSortType: ListPaneViewSortType;
|
|
6498
|
+
/**
|
|
6499
|
+
* @remarks
|
|
6500
|
+
* Adds a new slot to the list.
|
|
6501
|
+
*
|
|
6502
|
+
*/
|
|
6503
|
+
addSlot(params: ListPaneSlotCreationProps): IListPaneSlot;
|
|
6504
|
+
/**
|
|
6505
|
+
* @remarks
|
|
6506
|
+
* Finds the slot with the identifier.
|
|
6507
|
+
*
|
|
6508
|
+
* @param id
|
|
6509
|
+
* Unique identifier of the slot.
|
|
6510
|
+
*/
|
|
6511
|
+
getSlotById(id: string): IListPaneSlot | undefined;
|
|
6512
|
+
/**
|
|
6513
|
+
* @remarks
|
|
6514
|
+
* Finds the slot with the index.
|
|
6515
|
+
*
|
|
6516
|
+
* @param index
|
|
6517
|
+
* Index of the slot in the component list.
|
|
6518
|
+
*/
|
|
6519
|
+
getSlotByIndex(index: number): IListPaneSlot | undefined;
|
|
6520
|
+
/**
|
|
6521
|
+
* @remarks
|
|
6522
|
+
* @returns
|
|
6523
|
+
* Active view filter
|
|
6524
|
+
*/
|
|
6525
|
+
getViewFilter(): ListPaneViewFilter | undefined;
|
|
6526
|
+
/**
|
|
6527
|
+
* @remarks
|
|
6528
|
+
* Removes the slot from the list.
|
|
6529
|
+
*
|
|
6530
|
+
* @param id
|
|
6531
|
+
* Unique identifier of the slot.
|
|
6532
|
+
*/
|
|
6533
|
+
removeSlot(id: string): void;
|
|
6534
|
+
/**
|
|
6535
|
+
* @remarks
|
|
6536
|
+
* Selects slot by id.
|
|
6537
|
+
*
|
|
6538
|
+
* @param id
|
|
6539
|
+
* Unique identifier of the slot.
|
|
6540
|
+
* @param deselectOtherSlots
|
|
6541
|
+
* Deselects already selected slots if defined.
|
|
6542
|
+
*/
|
|
6543
|
+
selectSlot(id: string, deselectOtherSlots?: boolean): void;
|
|
6544
|
+
/**
|
|
6545
|
+
* @remarks
|
|
6546
|
+
* Filters displaying slots to match the define properties
|
|
6547
|
+
*
|
|
6548
|
+
* @param filter
|
|
6549
|
+
* Slots that don't match filter properties won't be included.
|
|
6550
|
+
*/
|
|
6551
|
+
setViewFilter(filter: ListPaneViewFilter | undefined): void;
|
|
6552
|
+
/**
|
|
6553
|
+
* @remarks
|
|
6554
|
+
* Updates how slots will be sorted in the view
|
|
6555
|
+
*
|
|
6556
|
+
* @param sortType
|
|
6557
|
+
* New sort type, it undefined Default will be used.
|
|
6558
|
+
*/
|
|
6559
|
+
setViewSortType(sortType: ListPaneViewSortType | undefined): void;
|
|
6560
|
+
/**
|
|
6561
|
+
* @remarks
|
|
6562
|
+
* Updates all slots with the new list.
|
|
6563
|
+
*
|
|
6564
|
+
* @param newSlots
|
|
6565
|
+
* Creation properties for the new slots.
|
|
6566
|
+
*/
|
|
6567
|
+
updateSlots(newSlots: ListPaneSlotCreationProps[]): void;
|
|
6568
|
+
}
|
|
6569
|
+
|
|
6570
|
+
/**
|
|
6571
|
+
* Optional properties for List Pane property item
|
|
6572
|
+
*/
|
|
6573
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6574
|
+
export interface IListPanePropertyItemOptions extends IPropertyItemOptionsBase {
|
|
6575
|
+
/**
|
|
6576
|
+
* @remarks
|
|
6577
|
+
* This will be the height of the list withing the pane
|
|
6578
|
+
*
|
|
6579
|
+
*/
|
|
6580
|
+
defaultSlots?: ListPaneSlotCreationProps[];
|
|
6581
|
+
/**
|
|
6582
|
+
* @remarks
|
|
6583
|
+
* This will be the height of the list withing the pane
|
|
6584
|
+
*
|
|
6585
|
+
*/
|
|
6586
|
+
height?: number;
|
|
6587
|
+
/**
|
|
6588
|
+
* @remarks
|
|
6589
|
+
* Layout for the list will need to be predefined, and using
|
|
6590
|
+
* wrong layout shape while creating slots will throw
|
|
6591
|
+
*
|
|
6592
|
+
*/
|
|
6593
|
+
layout: ListPaneSlotLayout;
|
|
6594
|
+
/**
|
|
6595
|
+
* @remarks
|
|
6596
|
+
* This callback is fired whenever a clickable slot is pressed
|
|
6597
|
+
*
|
|
6598
|
+
*/
|
|
6599
|
+
onSlotClicked?: (slot: IListPaneSlot) => void;
|
|
6600
|
+
/**
|
|
6601
|
+
* @remarks
|
|
6602
|
+
* This callback is fired whenever selected state of a slot is
|
|
6603
|
+
* changed
|
|
6604
|
+
*
|
|
6605
|
+
*/
|
|
6606
|
+
onSlotSelectionChange?: (slot: IListPaneSlot, state: boolean) => void;
|
|
6607
|
+
/**
|
|
6608
|
+
* @remarks
|
|
6609
|
+
* Localized title of the property item.
|
|
6610
|
+
*
|
|
6611
|
+
*/
|
|
6612
|
+
title?: LocalizedString;
|
|
6613
|
+
/**
|
|
6614
|
+
* @remarks
|
|
6615
|
+
* Filter properties for viewing subset of slots.
|
|
6616
|
+
*
|
|
6617
|
+
*/
|
|
6618
|
+
viewFilter?: ListPaneViewFilter;
|
|
6619
|
+
/**
|
|
6620
|
+
* @remarks
|
|
6621
|
+
* Sort type for the slots in the view. If undefined, default
|
|
6622
|
+
* list order will be used.
|
|
6623
|
+
*
|
|
6624
|
+
*/
|
|
6625
|
+
viewSortType?: ListPaneViewSortType;
|
|
6626
|
+
}
|
|
6627
|
+
|
|
6628
|
+
/**
|
|
6629
|
+
* List Pane slot
|
|
6630
|
+
*/
|
|
6631
|
+
export interface IListPaneSlot {
|
|
6632
|
+
/**
|
|
6633
|
+
* @remarks
|
|
6634
|
+
* Count of entries.
|
|
6635
|
+
*
|
|
6636
|
+
*/
|
|
6637
|
+
readonly entryCount: number;
|
|
6638
|
+
/**
|
|
6639
|
+
* @remarks
|
|
6640
|
+
* Unique identifier of the slot.
|
|
6641
|
+
*
|
|
6642
|
+
*/
|
|
6643
|
+
readonly id: string;
|
|
6644
|
+
/**
|
|
6645
|
+
* @remarks
|
|
6646
|
+
* Unique identifier of the parent pane.
|
|
6647
|
+
*
|
|
6648
|
+
*/
|
|
6649
|
+
readonly paneId: string;
|
|
6650
|
+
/**
|
|
6651
|
+
* @remarks
|
|
6652
|
+
* Selected state of the slot.
|
|
6653
|
+
*
|
|
6654
|
+
*/
|
|
6655
|
+
readonly selected: boolean;
|
|
6656
|
+
/**
|
|
6657
|
+
* @remarks
|
|
6658
|
+
* List of tags associated with the slot.
|
|
6659
|
+
*
|
|
6660
|
+
*/
|
|
6661
|
+
readonly tags: ReadonlyArray<string>;
|
|
6662
|
+
/**
|
|
6663
|
+
* @remarks
|
|
6664
|
+
* Count of entries.
|
|
6665
|
+
*
|
|
6666
|
+
*/
|
|
6667
|
+
readonly title: LocalizedString;
|
|
6668
|
+
/**
|
|
6669
|
+
* @remarks
|
|
6670
|
+
* Finds the entry with the index if it exists.
|
|
6671
|
+
*
|
|
6672
|
+
* @param index
|
|
6673
|
+
* Sequence index of the entry in the slot.
|
|
6674
|
+
* @param type
|
|
6675
|
+
* Optional type check for the entry.
|
|
6676
|
+
*/
|
|
6677
|
+
getEntry<K extends ListPaneEntryType | undefined = undefined>(
|
|
6678
|
+
index: number,
|
|
6679
|
+
type?: K,
|
|
6680
|
+
): (K extends ListPaneEntryType ? ListPaneEntryMap[K] : IListPaneEntry) | undefined;
|
|
6681
|
+
/**
|
|
6682
|
+
* @remarks
|
|
6683
|
+
* @returns
|
|
6684
|
+
* User data associated with the slot.
|
|
6685
|
+
*/
|
|
6686
|
+
getUserData(): unknown;
|
|
6687
|
+
/**
|
|
6688
|
+
* @remarks
|
|
6689
|
+
* Updates selected state of the slot.
|
|
6690
|
+
*
|
|
6691
|
+
* @param selected
|
|
6692
|
+
* New selected state.
|
|
6693
|
+
*/
|
|
6694
|
+
setSelected(selected: boolean): void;
|
|
6695
|
+
/**
|
|
6696
|
+
* @remarks
|
|
6697
|
+
* Updates tags of the slot.
|
|
6698
|
+
*
|
|
6699
|
+
* @param tags
|
|
6700
|
+
* New tag list.
|
|
6701
|
+
*/
|
|
6702
|
+
setTags(tags: string[] | undefined): void;
|
|
6703
|
+
/**
|
|
6704
|
+
* @remarks
|
|
6705
|
+
* Updates title of the slot.
|
|
6706
|
+
*
|
|
6707
|
+
* @param title
|
|
6708
|
+
* New title.
|
|
6709
|
+
*/
|
|
6710
|
+
setTitle(title: LocalizedString): void;
|
|
6711
|
+
/**
|
|
6712
|
+
* @remarks
|
|
6713
|
+
* Updates user data associated with the slot
|
|
6714
|
+
*
|
|
6715
|
+
* @param data
|
|
6716
|
+
* New user data.
|
|
6717
|
+
*/
|
|
6718
|
+
setUserData(data: unknown): void;
|
|
6719
|
+
}
|
|
6720
|
+
|
|
6721
|
+
/**
|
|
6722
|
+
* List Pane slot optional properties
|
|
6723
|
+
*/
|
|
6724
|
+
export interface IListPaneSlotOptions {
|
|
6725
|
+
/**
|
|
6726
|
+
* @remarks
|
|
6727
|
+
* List of tags associated with the slot.
|
|
6728
|
+
*
|
|
6729
|
+
*/
|
|
6730
|
+
tags?: string[];
|
|
6731
|
+
/**
|
|
6732
|
+
* @remarks
|
|
6733
|
+
* Localized title of the slot.
|
|
6734
|
+
*
|
|
6735
|
+
*/
|
|
6736
|
+
title?: LocalizedString;
|
|
6737
|
+
/**
|
|
6738
|
+
* @remarks
|
|
6739
|
+
* Unique identifier to use for the slot.
|
|
6740
|
+
*
|
|
6741
|
+
*/
|
|
6742
|
+
uniqueId?: string;
|
|
6743
|
+
/**
|
|
6744
|
+
* @remarks
|
|
6745
|
+
* Optional user data that can be associated with a slot.
|
|
6746
|
+
*
|
|
6747
|
+
*/
|
|
6748
|
+
userData?: unknown;
|
|
6749
|
+
}
|
|
6750
|
+
|
|
6751
|
+
/**
|
|
6752
|
+
* List Pane text entry
|
|
6753
|
+
*/
|
|
6754
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
6755
|
+
export interface IListPaneTextEntry extends IListPaneEntry {
|
|
6756
|
+
/**
|
|
6757
|
+
* @remarks
|
|
6758
|
+
* Value of the entry.
|
|
6759
|
+
*
|
|
6760
|
+
*/
|
|
6761
|
+
readonly value: Readonly<LocalizedString>;
|
|
6762
|
+
/**
|
|
6763
|
+
* @remarks
|
|
6764
|
+
* Updates value of the entry.
|
|
6765
|
+
*
|
|
6766
|
+
* @param value
|
|
6767
|
+
* New value.
|
|
6768
|
+
*/
|
|
6769
|
+
setValue(value: LocalizedString): void;
|
|
6770
|
+
}
|
|
6771
|
+
|
|
6137
6772
|
export interface IMenu {
|
|
6138
6773
|
/**
|
|
6139
6774
|
* @remarks
|
|
@@ -6380,6 +7015,102 @@ export interface IModalControlPane extends IPane {
|
|
|
6380
7015
|
addDivider(): IPropertyItemBase;
|
|
6381
7016
|
}
|
|
6382
7017
|
|
|
7018
|
+
export interface IModalDialog {
|
|
7019
|
+
/**
|
|
7020
|
+
* @remarks
|
|
7021
|
+
* Identifier for the active request for this dialog
|
|
7022
|
+
*
|
|
7023
|
+
*/
|
|
7024
|
+
readonly activeRequestId: string | undefined;
|
|
7025
|
+
/**
|
|
7026
|
+
* @remarks
|
|
7027
|
+
* Custom pane layout for the dialog
|
|
7028
|
+
*
|
|
7029
|
+
*/
|
|
7030
|
+
readonly contentPane: IPropertyPane;
|
|
7031
|
+
/**
|
|
7032
|
+
* @remarks
|
|
7033
|
+
* Custom pane layout for the dialog
|
|
7034
|
+
*
|
|
7035
|
+
*/
|
|
7036
|
+
readonly controlPane: IModalControlPane;
|
|
7037
|
+
/**
|
|
7038
|
+
* @remarks
|
|
7039
|
+
* Unique identifier for the dialog
|
|
7040
|
+
*
|
|
7041
|
+
*/
|
|
7042
|
+
readonly id: string;
|
|
7043
|
+
/**
|
|
7044
|
+
* @remarks
|
|
7045
|
+
* Dispatches a dismiss message to the active request if it is
|
|
7046
|
+
* available
|
|
7047
|
+
*
|
|
7048
|
+
*/
|
|
7049
|
+
sendDismiss(): void;
|
|
7050
|
+
/**
|
|
7051
|
+
* @remarks
|
|
7052
|
+
* Dispatches a response message to the active request if it is
|
|
7053
|
+
* available
|
|
7054
|
+
*
|
|
7055
|
+
* @param response
|
|
7056
|
+
* Response message to be handled by the active request
|
|
7057
|
+
*/
|
|
7058
|
+
sendResponse(response: ModalDialogCustomResponse): void;
|
|
7059
|
+
}
|
|
7060
|
+
|
|
7061
|
+
/**
|
|
7062
|
+
* Represents modal dialog state for the specific activation
|
|
7063
|
+
* request
|
|
7064
|
+
*/
|
|
7065
|
+
export interface IModalDialogActivationRequest {
|
|
7066
|
+
/**
|
|
7067
|
+
* @remarks
|
|
7068
|
+
* Unique identifier for the request
|
|
7069
|
+
*
|
|
7070
|
+
*/
|
|
7071
|
+
readonly id: string;
|
|
7072
|
+
/**
|
|
7073
|
+
* @remarks
|
|
7074
|
+
* Determines if the request is still active
|
|
7075
|
+
*
|
|
7076
|
+
*/
|
|
7077
|
+
readonly isValid: boolean;
|
|
7078
|
+
/**
|
|
7079
|
+
* @remarks
|
|
7080
|
+
* Cancels the request if it's still active
|
|
7081
|
+
*
|
|
7082
|
+
*/
|
|
7083
|
+
cancel(): void;
|
|
7084
|
+
}
|
|
7085
|
+
|
|
7086
|
+
export interface IModalDialogManager {
|
|
7087
|
+
/**
|
|
7088
|
+
* @remarks
|
|
7089
|
+
* Creates a modal activation request for an existing modal
|
|
7090
|
+
* template
|
|
7091
|
+
*
|
|
7092
|
+
* @param params
|
|
7093
|
+
* Activation parameters
|
|
7094
|
+
*/
|
|
7095
|
+
activateDialog<T extends CoreModalDialogType | string>(
|
|
7096
|
+
params: ModalDialogActivationParams<T>,
|
|
7097
|
+
): IModalDialogActivationRequest;
|
|
7098
|
+
/**
|
|
7099
|
+
* @remarks
|
|
7100
|
+
* Removes the active modal from view
|
|
7101
|
+
*
|
|
7102
|
+
*/
|
|
7103
|
+
dismissActiveDialog(): void;
|
|
7104
|
+
/**
|
|
7105
|
+
* @remarks
|
|
7106
|
+
* Creates a custom modal dialog with a property pane
|
|
7107
|
+
*
|
|
7108
|
+
* @param params
|
|
7109
|
+
* Creation parameters
|
|
7110
|
+
*/
|
|
7111
|
+
registerDialog(params: ModalDialogCreationParams): IModalDialog;
|
|
7112
|
+
}
|
|
7113
|
+
|
|
6383
7114
|
/**
|
|
6384
7115
|
* A modal overlay pane is displayed over a root pane.
|
|
6385
7116
|
*/
|
|
@@ -7162,6 +7893,13 @@ export interface IPropertyPane extends IPane {
|
|
|
7162
7893
|
*
|
|
7163
7894
|
*/
|
|
7164
7895
|
addLink(value: IObservableProp<string>, options?: ILinkPropertyItemOptions): ILinkPropertyItem;
|
|
7896
|
+
/**
|
|
7897
|
+
* @remarks
|
|
7898
|
+
* Adds a pane for displaying list of items in a predefined
|
|
7899
|
+
* layout.
|
|
7900
|
+
*
|
|
7901
|
+
*/
|
|
7902
|
+
addListPane(options: IListPanePropertyItemOptions): IListPanePropertyItem;
|
|
7165
7903
|
/**
|
|
7166
7904
|
* @remarks
|
|
7167
7905
|
* Adds a menu button property item to the pane.
|
|
@@ -8076,6 +8814,49 @@ export interface LogProperties {
|
|
|
8076
8814
|
tags?: string[];
|
|
8077
8815
|
}
|
|
8078
8816
|
|
|
8817
|
+
/**
|
|
8818
|
+
* Represents parameters to create a modal dialog
|
|
8819
|
+
*/
|
|
8820
|
+
export interface ModalDialogCreationParams {
|
|
8821
|
+
/**
|
|
8822
|
+
* @remarks
|
|
8823
|
+
* Determines if the panel can be dismissed by the user
|
|
8824
|
+
* actions. If undefined, it will be true.
|
|
8825
|
+
*
|
|
8826
|
+
*/
|
|
8827
|
+
canUserDismiss?: boolean;
|
|
8828
|
+
/**
|
|
8829
|
+
* @remarks
|
|
8830
|
+
* Panel height for the dialog
|
|
8831
|
+
*
|
|
8832
|
+
*/
|
|
8833
|
+
height?: number;
|
|
8834
|
+
/**
|
|
8835
|
+
* @remarks
|
|
8836
|
+
* Callback to notify changes in active request
|
|
8837
|
+
*
|
|
8838
|
+
*/
|
|
8839
|
+
onActiveRequestChange?: (requestId: string | undefined) => void;
|
|
8840
|
+
/**
|
|
8841
|
+
* @remarks
|
|
8842
|
+
* Dialog title
|
|
8843
|
+
*
|
|
8844
|
+
*/
|
|
8845
|
+
title?: LocalizedString;
|
|
8846
|
+
/**
|
|
8847
|
+
* @remarks
|
|
8848
|
+
* Optional user defined unique identifier
|
|
8849
|
+
*
|
|
8850
|
+
*/
|
|
8851
|
+
uniqueId?: string;
|
|
8852
|
+
/**
|
|
8853
|
+
* @remarks
|
|
8854
|
+
* Panel width for the dialog
|
|
8855
|
+
*
|
|
8856
|
+
*/
|
|
8857
|
+
width?: number;
|
|
8858
|
+
}
|
|
8859
|
+
|
|
8079
8860
|
/**
|
|
8080
8861
|
* Parameters for creating a modal tool in the tool container
|
|
8081
8862
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minecraft/server-editor",
|
|
3
|
-
"version": "0.1.0-beta.1.21.
|
|
3
|
+
"version": "0.1.0-beta.1.21.130-preview.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
],
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@minecraft/common": "^1.0.0",
|
|
17
|
-
"@minecraft/server": "^2.
|
|
18
|
-
"@minecraft/vanilla-data": ">=1.20.70 || 1.21.
|
|
17
|
+
"@minecraft/server": "^2.5.0-beta.1.21.130-preview.22",
|
|
18
|
+
"@minecraft/vanilla-data": ">=1.20.70 || 1.21.130-preview.22"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT"
|
|
21
21
|
}
|