@minecraft/server-ui 2.2.0-beta.1.26.40-preview.24 → 2.2.0-beta.1.26.40-preview.29

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 +48 -26
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -34,7 +34,6 @@
34
34
  import * as minecraftcommon from '@minecraft/common';
35
35
  import * as minecraftserver from '@minecraft/server';
36
36
  /**
37
- * @rc
38
37
  * The reason why a data driven UI screen (MessageBox or
39
38
  * CustomForm) was closed.
40
39
  */
@@ -110,7 +109,6 @@ export enum FormRejectReason {
110
109
  }
111
110
 
112
111
  /**
113
- * @rc
114
112
  * The reason why a form visibility operation failed.
115
113
  */
116
114
  export enum FormVisibilityErrorReason {
@@ -131,7 +129,6 @@ export enum FormVisibilityErrorReason {
131
129
  }
132
130
 
133
131
  /**
134
- * @rc
135
132
  * An enum representing the errors that can occur during text
136
133
  * filtering. This is used to provide more context about the
137
134
  * filtering process.
@@ -358,7 +355,6 @@ export class ActionFormResponse extends FormResponse {
358
355
  }
359
356
 
360
357
  /**
361
- * @rc
362
358
  * A customizable data driven (DDUI) form that lets you add
363
359
  * buttons, labels, toggles, dropdowns, sliders, text fields,
364
360
  * and more. The form layout is built by calling methods to add
@@ -502,6 +498,31 @@ export class CustomForm {
502
498
  * {@link InvalidFormModificationError}
503
499
  */
504
500
  header(text: ObservableString | ObservableUIRawMessage | string | UIRawMessage, options?: TextOptions): CustomForm;
501
+ /**
502
+ * @beta
503
+ * @remarks
504
+ * Adds an image component to the form layout.
505
+ *
506
+ * This function can't be called in restricted-execution mode.
507
+ *
508
+ * @param src
509
+ * The image source path to display. Must be a relative path to
510
+ * an image file within the provided pack.
511
+ * @param pack
512
+ * The resource pack identifier that contains the provided
513
+ * image source.
514
+ * @param options
515
+ * Optional configuration for the image, such as visibility or
516
+ * width.
517
+ * @returns
518
+ * The form instance to allow method chaining.
519
+ * @throws This function can throw errors.
520
+ *
521
+ * {@link InvalidFormModificationError}
522
+ *
523
+ * {@link InvalidObservableError}
524
+ */
525
+ image(src: ObservableString | string, pack: ObservableString | string, options?: ImageOptions): CustomForm;
505
526
  /**
506
527
  * @remarks
507
528
  * Returns true if the form is currently being shown to the
@@ -672,7 +693,6 @@ export class FormResponse {
672
693
  }
673
694
 
674
695
  /**
675
- * @rc
676
696
  * A simple message form with two buttons and a text body. Use
677
697
  * this class to show a basic dialog to a player and handle the
678
698
  * player's button selection.
@@ -1179,7 +1199,6 @@ export class ModalFormResponse extends FormResponse {
1179
1199
  }
1180
1200
 
1181
1201
  /**
1182
- * @rc
1183
1202
  * An observable that holds a boolean value. Listeners are
1184
1203
  * notified whenever the value changes.
1185
1204
  */
@@ -1256,7 +1275,6 @@ export class ObservableBoolean {
1256
1275
  }
1257
1276
 
1258
1277
  /**
1259
- * @rc
1260
1278
  * An observable that holds a numeric value. Listeners are
1261
1279
  * notified whenever the value changes.
1262
1280
  */
@@ -1333,7 +1351,6 @@ export class ObservableNumber {
1333
1351
  }
1334
1352
 
1335
1353
  /**
1336
- * @rc
1337
1354
  * An observable that holds a string value. Listeners are
1338
1355
  * notified whenever the value changes.
1339
1356
  */
@@ -1429,7 +1446,6 @@ export class ObservableString {
1429
1446
  }
1430
1447
 
1431
1448
  /**
1432
- * @rc
1433
1449
  * An observable that holds a UIRawMessage value. Listeners are
1434
1450
  * notified whenever the value changes.
1435
1451
  */
@@ -1518,7 +1534,6 @@ export class UIManager {
1518
1534
  }
1519
1535
 
1520
1536
  /**
1521
- * @rc
1522
1537
  * Options for configuring a button component.
1523
1538
  */
1524
1539
  export interface ButtonOptions {
@@ -1546,7 +1561,6 @@ export interface ButtonOptions {
1546
1561
  }
1547
1562
 
1548
1563
  /**
1549
- * @rc
1550
1564
  * Options for configuring a divider component in a CustomForm.
1551
1565
  */
1552
1566
  export interface DividerOptions {
@@ -1560,7 +1574,6 @@ export interface DividerOptions {
1560
1574
  }
1561
1575
 
1562
1576
  /**
1563
- * @rc
1564
1577
  * Represents a single item in a dropdown component.
1565
1578
  */
1566
1579
  export interface DropdownItemData {
@@ -1588,7 +1601,6 @@ export interface DropdownItemData {
1588
1601
  }
1589
1602
 
1590
1603
  /**
1591
- * @rc
1592
1604
  * Options for configuring a dropdown component.
1593
1605
  */
1594
1606
  export interface DropdownOptions {
@@ -1616,7 +1628,29 @@ export interface DropdownOptions {
1616
1628
  }
1617
1629
 
1618
1630
  /**
1619
- * @rc
1631
+ * @beta
1632
+ * Options for configuring an image component.
1633
+ */
1634
+ export interface ImageOptions {
1635
+ /**
1636
+ * @remarks
1637
+ * When false or bound to a false ObservableBoolean, the image
1638
+ * is hidden.
1639
+ *
1640
+ */
1641
+ visible?: boolean | ObservableBoolean;
1642
+ /**
1643
+ * @remarks
1644
+ * Sets the width of the image as a percentage of the width of
1645
+ * the form. 1 is the entire form width, 0.5 is half of the
1646
+ * form width. Greater than 1 or less than/equal to 0 will
1647
+ * become 1.
1648
+ *
1649
+ */
1650
+ width?: number | ObservableNumber;
1651
+ }
1652
+
1653
+ /**
1620
1654
  * The result returned when an MessageBox is closed. Contains
1621
1655
  * the reason the message box was closed and the player's
1622
1656
  * button selection, if applicable.
@@ -1731,7 +1765,6 @@ export interface ModalFormDataToggleOptions {
1731
1765
  }
1732
1766
 
1733
1767
  /**
1734
- * @rc
1735
1768
  * Configuration options for creating an Observable. Controls
1736
1769
  * how the observable value can be accessed and modified.
1737
1770
  */
@@ -1747,7 +1780,6 @@ export interface ObservableOptions {
1747
1780
  }
1748
1781
 
1749
1782
  /**
1750
- * @rc
1751
1783
  * Options for configuring a slider component.
1752
1784
  */
1753
1785
  export interface SliderOptions {
@@ -1782,7 +1814,6 @@ export interface SliderOptions {
1782
1814
  }
1783
1815
 
1784
1816
  /**
1785
- * @rc
1786
1817
  * Options for configuring a spacer component.
1787
1818
  */
1788
1819
  export interface SpacingOptions {
@@ -1796,7 +1827,6 @@ export interface SpacingOptions {
1796
1827
  }
1797
1828
 
1798
1829
  /**
1799
- * @rc
1800
1830
  * Options for configuring a text field component.
1801
1831
  */
1802
1832
  export interface TextFieldOptions {
@@ -1824,7 +1854,6 @@ export interface TextFieldOptions {
1824
1854
  }
1825
1855
 
1826
1856
  /**
1827
- * @rc
1828
1857
  * Options for configuring a text component (label or header).
1829
1858
  */
1830
1859
  export interface TextOptions {
@@ -1838,7 +1867,6 @@ export interface TextOptions {
1838
1867
  }
1839
1868
 
1840
1869
  /**
1841
- * @rc
1842
1870
  * Options for configuring a toggle component.
1843
1871
  */
1844
1872
  export interface ToggleOptions {
@@ -1866,7 +1894,6 @@ export interface ToggleOptions {
1866
1894
  }
1867
1895
 
1868
1896
  /**
1869
- * @rc
1870
1897
  * A message that can be sent to the client. This is a subset
1871
1898
  * of the RawMessage type, and is used for UI messages.
1872
1899
  */
@@ -1919,7 +1946,6 @@ export class FormRejectError extends Error {
1919
1946
  }
1920
1947
 
1921
1948
  /**
1922
- * @rc
1923
1949
  * Thrown when a form visibility operation fails, such as
1924
1950
  * attempting to show a form that is already showing or
1925
1951
  * attempting to close a form that is not currently open.
@@ -1946,7 +1972,6 @@ export class FormVisibilityError extends Error {
1946
1972
  }
1947
1973
 
1948
1974
  /**
1949
- * @rc
1950
1975
  * Thrown when attempting to interact with a form using an
1951
1976
  * invalid or unknown form identifier.
1952
1977
  */
@@ -1964,7 +1989,6 @@ export class InvalidFormError extends Error {
1964
1989
  }
1965
1990
 
1966
1991
  /**
1967
- * @rc
1968
1992
  * Thrown when attempting to modify a form after it has already
1969
1993
  * been shown to a player. Form properties cannot be changed
1970
1994
  * while the form is active.
@@ -1984,7 +2008,6 @@ export class InvalidFormModificationError extends Error {
1984
2008
  }
1985
2009
 
1986
2010
  /**
1987
- * @rc
1988
2011
  * Thrown when an observable value is expected to be writable,
1989
2012
  * but it is not.
1990
2013
  */
@@ -1994,7 +2017,6 @@ export class InvalidObservableError extends Error {
1994
2017
  }
1995
2018
 
1996
2019
  /**
1997
- * @rc
1998
2020
  * Thrown when a form operation fails because the target player
1999
2021
  * has left the game.
2000
2022
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-ui",
3
- "version": "2.2.0-beta.1.26.40-preview.24",
3
+ "version": "2.2.0-beta.1.26.40-preview.29",
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.10.0-beta.1.26.40-preview.24"
17
+ "@minecraft/server": "^2.0.0 || ^2.10.0-beta.1.26.40-preview.29"
18
18
  },
19
19
  "license": "MIT"
20
20
  }