@minecraft/server-ui 1.0.0-beta.1.19.80-preview.24 → 1.0.0-beta.1.19.80-stable

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 +65 -1
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -44,7 +44,7 @@
44
44
  * ```json
45
45
  * {
46
46
  * "module_name": "@minecraft/server-ui",
47
- * "version": "1.0.0-internal.1.19.80-preview.24"
47
+ * "version": "0.1.0"
48
48
  * }
49
49
  * ```
50
50
  *
@@ -54,11 +54,13 @@ export enum FormCancelationReason {
54
54
  userBusy = 'userBusy',
55
55
  userClosed = 'userClosed',
56
56
  }
57
+
57
58
  export enum FormRejectReason {
58
59
  MalformedResponse = 'MalformedResponse',
59
60
  PlayerQuit = 'PlayerQuit',
60
61
  ServerShutdown = 'ServerShutdown',
61
62
  }
63
+
62
64
  /**
63
65
  * Builds a simple player form with buttons that let the player
64
66
  * take action.
@@ -67,12 +69,18 @@ export class ActionFormData {
67
69
  /**
68
70
  * @remarks
69
71
  * Method that sets the body text for the modal form.
72
+ *
73
+ * This function can't be called in read-only mode.
74
+ *
70
75
  */
71
76
  body(bodyText: minecraftserver.RawMessage | string): ActionFormData;
72
77
  /**
73
78
  * @remarks
74
79
  * Adds a button to this form with an icon from a resource
75
80
  * pack.
81
+ *
82
+ * This function can't be called in read-only mode.
83
+ *
76
84
  */
77
85
  button(text: minecraftserver.RawMessage | string, iconPath?: string): ActionFormData;
78
86
  /**
@@ -80,6 +88,9 @@ export class ActionFormData {
80
88
  * Creates and shows this modal popup form. Returns
81
89
  * asynchronously when the player confirms or cancels the
82
90
  * dialog.
91
+ *
92
+ * This function can't be called in read-only mode.
93
+ *
83
94
  * @param player
84
95
  * Player to show this dialog to.
85
96
  * @throws This function can throw errors.
@@ -88,9 +99,13 @@ export class ActionFormData {
88
99
  /**
89
100
  * @remarks
90
101
  * This builder method sets the title for the modal dialog.
102
+ *
103
+ * This function can't be called in read-only mode.
104
+ *
91
105
  */
92
106
  title(titleText: minecraftserver.RawMessage | string): ActionFormData;
93
107
  }
108
+
94
109
  /**
95
110
  * Returns data about the player results from a modal action
96
111
  * form.
@@ -98,25 +113,33 @@ export class ActionFormData {
98
113
  export class ActionFormResponse extends FormResponse {
99
114
  protected constructor();
100
115
  /**
116
+ * @remarks
101
117
  * Returns the index of the button that was pushed.
118
+ *
102
119
  */
103
120
  readonly selection?: number;
104
121
  }
122
+
105
123
  /**
106
124
  * Base type for a form response.
107
125
  */
108
126
  export class FormResponse {
109
127
  protected constructor();
110
128
  /**
129
+ * @remarks
111
130
  * Contains additional details as to why a form was canceled.
131
+ *
112
132
  */
113
133
  readonly cancelationReason?: FormCancelationReason;
114
134
  /**
135
+ * @remarks
115
136
  * If true, the form was canceled by the player (e.g., they
116
137
  * selected the pop-up X close button).
138
+ *
117
139
  */
118
140
  readonly canceled: boolean;
119
141
  }
142
+
120
143
  /**
121
144
  * Builds a simple two-button modal dialog.
122
145
  */
@@ -124,18 +147,27 @@ export class MessageFormData {
124
147
  /**
125
148
  * @remarks
126
149
  * Method that sets the body text for the modal form.
150
+ *
151
+ * This function can't be called in read-only mode.
152
+ *
127
153
  */
128
154
  body(bodyText: minecraftserver.RawMessage | string): MessageFormData;
129
155
  /**
130
156
  * @remarks
131
157
  * Method that sets the text for the first button of the
132
158
  * dialog.
159
+ *
160
+ * This function can't be called in read-only mode.
161
+ *
133
162
  */
134
163
  button1(text: minecraftserver.RawMessage | string): MessageFormData;
135
164
  /**
136
165
  * @remarks
137
166
  * This method sets the text for the second button on the
138
167
  * dialog.
168
+ *
169
+ * This function can't be called in read-only mode.
170
+ *
139
171
  */
140
172
  button2(text: minecraftserver.RawMessage | string): MessageFormData;
141
173
  /**
@@ -143,6 +175,9 @@ export class MessageFormData {
143
175
  * Creates and shows this modal popup form. Returns
144
176
  * asynchronously when the player confirms or cancels the
145
177
  * dialog.
178
+ *
179
+ * This function can't be called in read-only mode.
180
+ *
146
181
  * @param player
147
182
  * Player to show this dialog to.
148
183
  * @throws This function can throw errors.
@@ -151,9 +186,13 @@ export class MessageFormData {
151
186
  /**
152
187
  * @remarks
153
188
  * This builder method sets the title for the modal dialog.
189
+ *
190
+ * This function can't be called in read-only mode.
191
+ *
154
192
  */
155
193
  title(titleText: minecraftserver.RawMessage | string): MessageFormData;
156
194
  }
195
+
157
196
  /**
158
197
  * Returns data about the player results from a modal message
159
198
  * form.
@@ -161,10 +200,13 @@ export class MessageFormData {
161
200
  export class MessageFormResponse extends FormResponse {
162
201
  protected constructor();
163
202
  /**
203
+ * @remarks
164
204
  * Returns the index of the button that was pushed.
205
+ *
165
206
  */
166
207
  readonly selection?: number;
167
208
  }
209
+
168
210
  /**
169
211
  * Used to create a fully customizable pop-up form for a
170
212
  * player.
@@ -173,6 +215,9 @@ export class ModalFormData {
173
215
  /**
174
216
  * @remarks
175
217
  * Adds a dropdown with choices to the form.
218
+ *
219
+ * This function can't be called in read-only mode.
220
+ *
176
221
  */
177
222
  dropdown(
178
223
  label: minecraftserver.RawMessage | string,
@@ -184,6 +229,9 @@ export class ModalFormData {
184
229
  * Creates and shows this modal popup form. Returns
185
230
  * asynchronously when the player confirms or cancels the
186
231
  * dialog.
232
+ *
233
+ * This function can't be called in read-only mode.
234
+ *
187
235
  * @param player
188
236
  * Player to show this dialog to.
189
237
  * @throws This function can throw errors.
@@ -192,6 +240,9 @@ export class ModalFormData {
192
240
  /**
193
241
  * @remarks
194
242
  * Adds a numeric slider to the form.
243
+ *
244
+ * This function can't be called in read-only mode.
245
+ *
195
246
  */
196
247
  slider(
197
248
  label: minecraftserver.RawMessage | string,
@@ -203,6 +254,9 @@ export class ModalFormData {
203
254
  /**
204
255
  * @remarks
205
256
  * Adds a textbox to the form.
257
+ *
258
+ * This function can't be called in read-only mode.
259
+ *
206
260
  */
207
261
  textField(
208
262
  label: minecraftserver.RawMessage | string,
@@ -212,25 +266,35 @@ export class ModalFormData {
212
266
  /**
213
267
  * @remarks
214
268
  * This builder method sets the title for the modal dialog.
269
+ *
270
+ * This function can't be called in read-only mode.
271
+ *
215
272
  */
216
273
  title(titleText: minecraftserver.RawMessage | string): ModalFormData;
217
274
  /**
218
275
  * @remarks
219
276
  * Adds a toggle checkbox button to the form.
277
+ *
278
+ * This function can't be called in read-only mode.
279
+ *
220
280
  */
221
281
  toggle(label: minecraftserver.RawMessage | string, defaultValue?: boolean): ModalFormData;
222
282
  }
283
+
223
284
  /**
224
285
  * Returns data about player responses to a modal form.
225
286
  */
226
287
  export class ModalFormResponse extends FormResponse {
227
288
  protected constructor();
228
289
  /**
290
+ * @remarks
229
291
  * An ordered set of values based on the order of controls
230
292
  * specified by ModalFormData.
293
+ *
231
294
  */
232
295
  readonly formValues?: any[];
233
296
  }
297
+
234
298
  export class FormRejectError extends Error {
235
299
  protected constructor();
236
300
  reason: FormRejectReason;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-ui",
3
- "version": "1.0.0-beta.1.19.80-preview.24",
3
+ "version": "1.0.0-beta.1.19.80-stable",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "dependencies": {
16
- "@minecraft/server": "1.2.0-beta.1.19.80-preview.24"
16
+ "@minecraft/server": "1.2.0-beta.1.19.80-stable"
17
17
  },
18
18
  "license": "MIT"
19
19
  }