@minecraft/server-ui 2.1.0-beta.1.26.30-preview.28 → 2.2.0-beta.1.26.30-preview.30

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 +100 -27
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -26,7 +26,7 @@
26
26
  * ```json
27
27
  * {
28
28
  * "module_name": "@minecraft/server-ui",
29
- * "version": "2.1.0-beta"
29
+ * "version": "2.2.0-beta"
30
30
  * }
31
31
  * ```
32
32
  *
@@ -34,7 +34,7 @@
34
34
  import * as minecraftcommon from '@minecraft/common';
35
35
  import * as minecraftserver from '@minecraft/server';
36
36
  /**
37
- * @beta
37
+ * @rc
38
38
  * The reason why a data driven UI screen (MessageBox or
39
39
  * CustomForm) was closed.
40
40
  */
@@ -63,19 +63,54 @@ export enum DataDrivenScreenClosedReason {
63
63
  UserBusy = 'UserBusy',
64
64
  }
65
65
 
66
+ /**
67
+ * An enum representing the reasons why a form was canceled.
68
+ */
66
69
  export enum FormCancelationReason {
70
+ /**
71
+ * @remarks
72
+ * The form was canceled because the player was busy with
73
+ * another UI interaction.
74
+ *
75
+ */
67
76
  UserBusy = 'UserBusy',
77
+ /**
78
+ * @remarks
79
+ * The form was canceled because the player closed it.
80
+ *
81
+ */
68
82
  UserClosed = 'UserClosed',
69
83
  }
70
84
 
85
+ /**
86
+ * An enum representing the reasons why a form was rejected.
87
+ */
71
88
  export enum FormRejectReason {
89
+ /**
90
+ * @remarks
91
+ * The form was rejected because the response from the client
92
+ * was malformed or could not be parsed.
93
+ *
94
+ */
72
95
  MalformedResponse = 'MalformedResponse',
96
+ /**
97
+ * @remarks
98
+ * The form was rejected because the player quit the game
99
+ * before responding.
100
+ *
101
+ */
73
102
  PlayerQuit = 'PlayerQuit',
103
+ /**
104
+ * @remarks
105
+ * The form was rejected because the server shut down before
106
+ * the player responded.
107
+ *
108
+ */
74
109
  ServerShutdown = 'ServerShutdown',
75
110
  }
76
111
 
77
112
  /**
78
- * @beta
113
+ * @rc
79
114
  * The reason why a form visibility operation failed.
80
115
  */
81
116
  export enum FormVisibilityErrorReason {
@@ -96,7 +131,7 @@ export enum FormVisibilityErrorReason {
96
131
  }
97
132
 
98
133
  /**
99
- * @beta
134
+ * @rc
100
135
  * An enum representing the errors that can occur during text
101
136
  * filtering. This is used to provide more context about the
102
137
  * filtering process.
@@ -323,7 +358,7 @@ export class ActionFormResponse extends FormResponse {
323
358
  }
324
359
 
325
360
  /**
326
- * @beta
361
+ * @rc
327
362
  * A customizable data driven (DDUI) form that lets you add
328
363
  * buttons, labels, toggles, dropdowns, sliders, text fields,
329
364
  * and more. The form layout is built by calling methods to add
@@ -637,7 +672,7 @@ export class FormResponse {
637
672
  }
638
673
 
639
674
  /**
640
- * @beta
675
+ * @rc
641
676
  * A simple message form with two buttons and a text body. Use
642
677
  * this class to show a basic dialog to a player and handle the
643
678
  * player's button selection.
@@ -1144,7 +1179,7 @@ export class ModalFormResponse extends FormResponse {
1144
1179
  }
1145
1180
 
1146
1181
  /**
1147
- * @beta
1182
+ * @rc
1148
1183
  * An observable that holds a boolean value. Listeners are
1149
1184
  * notified whenever the value changes.
1150
1185
  */
@@ -1221,7 +1256,7 @@ export class ObservableBoolean {
1221
1256
  }
1222
1257
 
1223
1258
  /**
1224
- * @beta
1259
+ * @rc
1225
1260
  * An observable that holds a numeric value. Listeners are
1226
1261
  * notified whenever the value changes.
1227
1262
  */
@@ -1298,7 +1333,7 @@ export class ObservableNumber {
1298
1333
  }
1299
1334
 
1300
1335
  /**
1301
- * @beta
1336
+ * @rc
1302
1337
  * An observable that holds a string value. Listeners are
1303
1338
  * notified whenever the value changes.
1304
1339
  */
@@ -1394,19 +1429,32 @@ export class ObservableString {
1394
1429
  }
1395
1430
 
1396
1431
  /**
1397
- * @beta
1432
+ * @rc
1433
+ * An observable that holds a UIRawMessage value. Listeners are
1434
+ * notified whenever the value changes.
1398
1435
  */
1399
1436
  export class ObservableUIRawMessage {
1400
1437
  /**
1401
1438
  * @remarks
1439
+ * Creates a new ObservableUIRawMessage with the provided
1440
+ * initial UIRawMessage value.
1441
+ *
1402
1442
  * This function can't be called in restricted-execution mode.
1403
1443
  *
1404
1444
  * This function can be called in early-execution mode.
1405
1445
  *
1446
+ * @param data
1447
+ * The initial UIRawMessage value for this observable.
1448
+ * @param options
1449
+ * Optional configuration for the observable, such as whether
1450
+ * the value can be written by the client.
1406
1451
  */
1407
1452
  constructor(data: UIRawMessage, options?: ObservableOptions);
1408
1453
  /**
1409
1454
  * @remarks
1455
+ * Returns the current UIRawMessage value held by this
1456
+ * observable.
1457
+ *
1410
1458
  * This function can't be called in restricted-execution mode.
1411
1459
  *
1412
1460
  * This function can be called in early-execution mode.
@@ -1415,26 +1463,45 @@ export class ObservableUIRawMessage {
1415
1463
  getData(): UIRawMessage;
1416
1464
  /**
1417
1465
  * @remarks
1466
+ * Updates the UIRawMessage value held by this observable. If
1467
+ * the new value differs from the current value, all subscribed
1468
+ * listeners are notified with the new value.
1469
+ *
1418
1470
  * This function can't be called in restricted-execution mode.
1419
1471
  *
1420
1472
  * This function can be called in early-execution mode.
1421
1473
  *
1474
+ * @param data
1475
+ * The new UIRawMessage value to set.
1422
1476
  */
1423
1477
  setData(data: UIRawMessage): void;
1424
1478
  /**
1425
1479
  * @remarks
1480
+ * Registers a callback to be invoked whenever the observable's
1481
+ * value changes. Returns the callback, which can be passed to
1482
+ * unsubscribe to remove the listener.
1483
+ *
1426
1484
  * This function can't be called in restricted-execution mode.
1427
1485
  *
1428
1486
  * This function can be called in early-execution mode.
1429
1487
  *
1488
+ * @param callback
1489
+ * A function that receives the new UIRawMessage value each
1490
+ * time the observable changes.
1430
1491
  */
1431
1492
  subscribe(callback: (arg0: UIRawMessage) => void): (arg0: UIRawMessage) => void;
1432
1493
  /**
1433
1494
  * @remarks
1495
+ * Removes a previously registered listener from this
1496
+ * observable. Returns true if the listener was found and
1497
+ * removed, false if it was not found.
1498
+ *
1434
1499
  * This function can't be called in restricted-execution mode.
1435
1500
  *
1436
1501
  * This function can be called in early-execution mode.
1437
1502
  *
1503
+ * @param callback
1504
+ * The callback handle previously returned by subscribe.
1438
1505
  */
1439
1506
  unsubscribe(callback: (arg0: UIRawMessage) => void): boolean;
1440
1507
  }
@@ -1451,7 +1518,7 @@ export class UIManager {
1451
1518
  }
1452
1519
 
1453
1520
  /**
1454
- * @beta
1521
+ * @rc
1455
1522
  * Options for configuring a button component.
1456
1523
  */
1457
1524
  export interface ButtonOptions {
@@ -1479,7 +1546,7 @@ export interface ButtonOptions {
1479
1546
  }
1480
1547
 
1481
1548
  /**
1482
- * @beta
1549
+ * @rc
1483
1550
  * Options for configuring a divider component in a CustomForm.
1484
1551
  */
1485
1552
  export interface DividerOptions {
@@ -1493,7 +1560,7 @@ export interface DividerOptions {
1493
1560
  }
1494
1561
 
1495
1562
  /**
1496
- * @beta
1563
+ * @rc
1497
1564
  * Represents a single item in a dropdown component.
1498
1565
  */
1499
1566
  export interface DropdownItemData {
@@ -1521,7 +1588,7 @@ export interface DropdownItemData {
1521
1588
  }
1522
1589
 
1523
1590
  /**
1524
- * @beta
1591
+ * @rc
1525
1592
  * Options for configuring a dropdown component.
1526
1593
  */
1527
1594
  export interface DropdownOptions {
@@ -1549,7 +1616,7 @@ export interface DropdownOptions {
1549
1616
  }
1550
1617
 
1551
1618
  /**
1552
- * @beta
1619
+ * @rc
1553
1620
  * The result returned when an MessageBox is closed. Contains
1554
1621
  * the reason the message box was closed and the player's
1555
1622
  * button selection, if applicable.
@@ -1664,7 +1731,7 @@ export interface ModalFormDataToggleOptions {
1664
1731
  }
1665
1732
 
1666
1733
  /**
1667
- * @beta
1734
+ * @rc
1668
1735
  * Configuration options for creating an Observable. Controls
1669
1736
  * how the observable value can be accessed and modified.
1670
1737
  */
@@ -1680,7 +1747,7 @@ export interface ObservableOptions {
1680
1747
  }
1681
1748
 
1682
1749
  /**
1683
- * @beta
1750
+ * @rc
1684
1751
  * Options for configuring a slider component.
1685
1752
  */
1686
1753
  export interface SliderOptions {
@@ -1715,7 +1782,7 @@ export interface SliderOptions {
1715
1782
  }
1716
1783
 
1717
1784
  /**
1718
- * @beta
1785
+ * @rc
1719
1786
  * Options for configuring a spacer component.
1720
1787
  */
1721
1788
  export interface SpacingOptions {
@@ -1729,7 +1796,7 @@ export interface SpacingOptions {
1729
1796
  }
1730
1797
 
1731
1798
  /**
1732
- * @beta
1799
+ * @rc
1733
1800
  * Options for configuring a text field component.
1734
1801
  */
1735
1802
  export interface TextFieldOptions {
@@ -1757,7 +1824,7 @@ export interface TextFieldOptions {
1757
1824
  }
1758
1825
 
1759
1826
  /**
1760
- * @beta
1827
+ * @rc
1761
1828
  * Options for configuring a text component (label or header).
1762
1829
  */
1763
1830
  export interface TextOptions {
@@ -1771,7 +1838,7 @@ export interface TextOptions {
1771
1838
  }
1772
1839
 
1773
1840
  /**
1774
- * @beta
1841
+ * @rc
1775
1842
  * Options for configuring a toggle component.
1776
1843
  */
1777
1844
  export interface ToggleOptions {
@@ -1799,7 +1866,7 @@ export interface ToggleOptions {
1799
1866
  }
1800
1867
 
1801
1868
  /**
1802
- * @beta
1869
+ * @rc
1803
1870
  * A message that can be sent to the client. This is a subset
1804
1871
  * of the RawMessage type, and is used for UI messages.
1805
1872
  */
@@ -1834,11 +1901,17 @@ export interface UIRawMessage {
1834
1901
  with?: string[] | UIRawMessage;
1835
1902
  }
1836
1903
 
1904
+ /**
1905
+ * Thrown when a form is rejected. Contains the reason for the
1906
+ * rejection.
1907
+ */
1837
1908
  // @ts-ignore Class inheritance allowed for native defined classes
1838
1909
  export class FormRejectError extends Error {
1839
1910
  private constructor();
1840
1911
  /**
1841
1912
  * @remarks
1913
+ * The reason the form was rejected.
1914
+ *
1842
1915
  * This property can be read in early-execution mode.
1843
1916
  *
1844
1917
  */
@@ -1846,7 +1919,7 @@ export class FormRejectError extends Error {
1846
1919
  }
1847
1920
 
1848
1921
  /**
1849
- * @beta
1922
+ * @rc
1850
1923
  * Thrown when a form visibility operation fails, such as
1851
1924
  * attempting to show a form that is already showing or
1852
1925
  * attempting to close a form that is not currently open.
@@ -1873,7 +1946,7 @@ export class FormVisibilityError extends Error {
1873
1946
  }
1874
1947
 
1875
1948
  /**
1876
- * @beta
1949
+ * @rc
1877
1950
  * Thrown when attempting to interact with a form using an
1878
1951
  * invalid or unknown form identifier.
1879
1952
  */
@@ -1891,7 +1964,7 @@ export class InvalidFormError extends Error {
1891
1964
  }
1892
1965
 
1893
1966
  /**
1894
- * @beta
1967
+ * @rc
1895
1968
  * Thrown when attempting to modify a form after it has already
1896
1969
  * been shown to a player. Form properties cannot be changed
1897
1970
  * while the form is active.
@@ -1911,7 +1984,7 @@ export class InvalidFormModificationError extends Error {
1911
1984
  }
1912
1985
 
1913
1986
  /**
1914
- * @beta
1987
+ * @rc
1915
1988
  * Thrown when an observable value is expected to be writable,
1916
1989
  * but it is not.
1917
1990
  */
@@ -1921,7 +1994,7 @@ export class InvalidObservableError extends Error {
1921
1994
  }
1922
1995
 
1923
1996
  /**
1924
- * @beta
1997
+ * @rc
1925
1998
  * Thrown when a form operation fails because the target player
1926
1999
  * has left the game.
1927
2000
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-ui",
3
- "version": "2.1.0-beta.1.26.30-preview.28",
3
+ "version": "2.2.0-beta.1.26.30-preview.30",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "peerDependencies": {
16
16
  "@minecraft/common": "^1.0.0",
17
- "@minecraft/server": "^2.0.0 || ^2.9.0-beta.1.26.30-preview.28"
17
+ "@minecraft/server": "^2.0.0 || ^2.9.0-beta.1.26.30-preview.30"
18
18
  },
19
19
  "license": "MIT"
20
20
  }