@minecraft/server-ui 2.1.0-beta.1.26.10-preview.22 → 2.1.0-beta.1.26.10-preview.23
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 +59 -38
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -252,7 +252,11 @@ export declare class CustomForm {
|
|
|
252
252
|
* when the button is pressed.
|
|
253
253
|
*
|
|
254
254
|
*/
|
|
255
|
-
button(
|
|
255
|
+
button(
|
|
256
|
+
label: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
257
|
+
onClick: () => void,
|
|
258
|
+
options?: ButtonOptions,
|
|
259
|
+
): CustomForm;
|
|
256
260
|
/**
|
|
257
261
|
* @remarks
|
|
258
262
|
* Can this form be shown to the player right now?
|
|
@@ -284,18 +288,31 @@ export declare class CustomForm {
|
|
|
284
288
|
*
|
|
285
289
|
*/
|
|
286
290
|
dropdown(
|
|
287
|
-
label: Observable<string> | string | UIRawMessage,
|
|
291
|
+
label: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
288
292
|
value: Observable<number>,
|
|
289
293
|
items: DropdownItem[],
|
|
290
294
|
options?: DropdownOptions,
|
|
291
295
|
): CustomForm;
|
|
296
|
+
/**
|
|
297
|
+
* @remarks
|
|
298
|
+
* Inserts a header (i.e. large sized text) into the Custom
|
|
299
|
+
* form.
|
|
300
|
+
*
|
|
301
|
+
*/
|
|
302
|
+
header(
|
|
303
|
+
text: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
304
|
+
options?: TextOptions,
|
|
305
|
+
): CustomForm;
|
|
292
306
|
/**
|
|
293
307
|
* @remarks
|
|
294
308
|
* Inserts a label (i.e. medium sized text) into the Custom
|
|
295
309
|
* form.
|
|
296
310
|
*
|
|
297
311
|
*/
|
|
298
|
-
label(
|
|
312
|
+
label(
|
|
313
|
+
text: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
314
|
+
options?: TextOptions,
|
|
315
|
+
): CustomForm;
|
|
299
316
|
/**
|
|
300
317
|
* @remarks
|
|
301
318
|
* Shows the form to the player. Will throw errors if the form
|
|
@@ -311,7 +328,7 @@ export declare class CustomForm {
|
|
|
311
328
|
*
|
|
312
329
|
*/
|
|
313
330
|
slider(
|
|
314
|
-
label: Observable<string> | string | UIRawMessage,
|
|
331
|
+
label: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
315
332
|
value: Observable<number>,
|
|
316
333
|
minValue: Observable<number> | number,
|
|
317
334
|
maxValue: Observable<number> | number,
|
|
@@ -330,7 +347,7 @@ export declare class CustomForm {
|
|
|
330
347
|
*
|
|
331
348
|
*/
|
|
332
349
|
textField(
|
|
333
|
-
label: Observable<string> | string | UIRawMessage,
|
|
350
|
+
label: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
334
351
|
text: Observable<string>,
|
|
335
352
|
options?: TextFieldOptions,
|
|
336
353
|
): CustomForm;
|
|
@@ -341,7 +358,7 @@ export declare class CustomForm {
|
|
|
341
358
|
*
|
|
342
359
|
*/
|
|
343
360
|
toggle(
|
|
344
|
-
label: Observable<string> | string | UIRawMessage,
|
|
361
|
+
label: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
345
362
|
toggled: Observable<boolean>,
|
|
346
363
|
options?: ToggleOptions,
|
|
347
364
|
): CustomForm;
|
|
@@ -351,7 +368,10 @@ export declare class CustomForm {
|
|
|
351
368
|
* instead of a constructor.
|
|
352
369
|
*
|
|
353
370
|
*/
|
|
354
|
-
static create(
|
|
371
|
+
static create(
|
|
372
|
+
player: minecraftserver.Player,
|
|
373
|
+
title: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
374
|
+
): CustomForm;
|
|
355
375
|
}
|
|
356
376
|
|
|
357
377
|
/**
|
|
@@ -385,15 +405,15 @@ export declare class MessageBox {
|
|
|
385
405
|
* contained within a scroll view to allow for lots of text.
|
|
386
406
|
*
|
|
387
407
|
*/
|
|
388
|
-
body(text: Observable<string> | string | UIRawMessage): MessageBox;
|
|
408
|
+
body(text: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage): MessageBox;
|
|
389
409
|
/**
|
|
390
410
|
* @remarks
|
|
391
411
|
* Sets the data for the top button in the form.
|
|
392
412
|
*
|
|
393
413
|
*/
|
|
394
414
|
button1(
|
|
395
|
-
label: Observable<string> | string | UIRawMessage,
|
|
396
|
-
tooltip?: Observable<string> | string | UIRawMessage,
|
|
415
|
+
label: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
416
|
+
tooltip?: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
397
417
|
): MessageBox;
|
|
398
418
|
/**
|
|
399
419
|
* @remarks
|
|
@@ -401,8 +421,8 @@ export declare class MessageBox {
|
|
|
401
421
|
*
|
|
402
422
|
*/
|
|
403
423
|
button2(
|
|
404
|
-
label: Observable<string> | string | UIRawMessage,
|
|
405
|
-
tooltip?: Observable<string> | string | UIRawMessage,
|
|
424
|
+
label: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
425
|
+
tooltip?: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
406
426
|
): MessageBox;
|
|
407
427
|
/**
|
|
408
428
|
* @remarks
|
|
@@ -418,19 +438,16 @@ export declare class MessageBox {
|
|
|
418
438
|
*
|
|
419
439
|
*/
|
|
420
440
|
show(): Promise<MessageBoxResult>;
|
|
421
|
-
/**
|
|
422
|
-
* @remarks
|
|
423
|
-
* Sets the title of form.
|
|
424
|
-
*
|
|
425
|
-
*/
|
|
426
|
-
title(text: Observable<string> | string | UIRawMessage): MessageBox;
|
|
427
441
|
/**
|
|
428
442
|
* @remarks
|
|
429
443
|
* Creates a message form for a certain player. Use this
|
|
430
444
|
* instead of a constructor.
|
|
431
445
|
*
|
|
432
446
|
*/
|
|
433
|
-
static create(
|
|
447
|
+
static create(
|
|
448
|
+
player: minecraftserver.Player,
|
|
449
|
+
title: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage,
|
|
450
|
+
): MessageBox;
|
|
434
451
|
}
|
|
435
452
|
|
|
436
453
|
/**
|
|
@@ -833,7 +850,7 @@ export class ModalFormResponse extends FormResponse {
|
|
|
833
850
|
* A class that represents data that can be Observed.
|
|
834
851
|
* Extensively used for UI.
|
|
835
852
|
*/
|
|
836
|
-
export declare class Observable<T extends string | number | boolean> {
|
|
853
|
+
export declare class Observable<T extends string | number | boolean | UIRawMessage> {
|
|
837
854
|
/**
|
|
838
855
|
* @remarks
|
|
839
856
|
* Gets the data from the Observable.
|
|
@@ -868,7 +885,10 @@ export declare class Observable<T extends string | number | boolean> {
|
|
|
868
885
|
* Creates an Observable, use this instead of a constructor.
|
|
869
886
|
*
|
|
870
887
|
*/
|
|
871
|
-
static create<T extends string | number | boolean>(
|
|
888
|
+
static create<T extends string | number | boolean | UIRawMessage>(
|
|
889
|
+
data: T,
|
|
890
|
+
options?: ObservableOptions,
|
|
891
|
+
): Observable<T>;
|
|
872
892
|
}
|
|
873
893
|
|
|
874
894
|
export class UIManager {
|
|
@@ -898,7 +918,7 @@ export interface ButtonOptions {
|
|
|
898
918
|
* The tooltip for this button, shown when hovering the button.
|
|
899
919
|
*
|
|
900
920
|
*/
|
|
901
|
-
tooltip?: Observable<string> | string | UIRawMessage;
|
|
921
|
+
tooltip?: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage;
|
|
902
922
|
/**
|
|
903
923
|
* @remarks
|
|
904
924
|
* Whether or not this button is visible.
|
|
@@ -972,19 +992,6 @@ export interface DropdownOptions {
|
|
|
972
992
|
visible?: Observable<boolean> | boolean;
|
|
973
993
|
}
|
|
974
994
|
|
|
975
|
-
/**
|
|
976
|
-
* @beta
|
|
977
|
-
* The options for including a label in {@link CustomForm}.
|
|
978
|
-
*/
|
|
979
|
-
export interface LabelOptions {
|
|
980
|
-
/**
|
|
981
|
-
* @remarks
|
|
982
|
-
* Whether or not this label is visible
|
|
983
|
-
*
|
|
984
|
-
*/
|
|
985
|
-
visible?: Observable<boolean> | boolean;
|
|
986
|
-
}
|
|
987
|
-
|
|
988
995
|
/**
|
|
989
996
|
* @beta
|
|
990
997
|
* The result when a {@link MessageBox} is closed.
|
|
@@ -1117,7 +1124,7 @@ export interface SliderOptions {
|
|
|
1117
1124
|
* The description of the slider, shown in the UI.
|
|
1118
1125
|
*
|
|
1119
1126
|
*/
|
|
1120
|
-
description?: Observable<string> | string | UIRawMessage;
|
|
1127
|
+
description?: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage;
|
|
1121
1128
|
/**
|
|
1122
1129
|
* @remarks
|
|
1123
1130
|
* Whether or not this slider is disabled.
|
|
@@ -1163,7 +1170,7 @@ export interface TextFieldOptions {
|
|
|
1163
1170
|
* The description for this text field, shown in the UI.
|
|
1164
1171
|
*
|
|
1165
1172
|
*/
|
|
1166
|
-
description?: Observable<string> | string | UIRawMessage;
|
|
1173
|
+
description?: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage;
|
|
1167
1174
|
/**
|
|
1168
1175
|
* @remarks
|
|
1169
1176
|
* Whether or not this text field is disabled.
|
|
@@ -1178,6 +1185,20 @@ export interface TextFieldOptions {
|
|
|
1178
1185
|
visible?: Observable<boolean> | boolean;
|
|
1179
1186
|
}
|
|
1180
1187
|
|
|
1188
|
+
/**
|
|
1189
|
+
* @beta
|
|
1190
|
+
* The options for including a label or header in {@link
|
|
1191
|
+
* CustomForm}.
|
|
1192
|
+
*/
|
|
1193
|
+
export interface TextOptions {
|
|
1194
|
+
/**
|
|
1195
|
+
* @remarks
|
|
1196
|
+
* Whether or not this label is visible
|
|
1197
|
+
*
|
|
1198
|
+
*/
|
|
1199
|
+
visible?: Observable<boolean> | boolean;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1181
1202
|
/**
|
|
1182
1203
|
* @beta
|
|
1183
1204
|
* The options for including a toggle in {@link CustomForm}.
|
|
@@ -1188,7 +1209,7 @@ export interface ToggleOptions {
|
|
|
1188
1209
|
* The description for this toggle, shown in the UI.
|
|
1189
1210
|
*
|
|
1190
1211
|
*/
|
|
1191
|
-
description?: Observable<string> | string | UIRawMessage;
|
|
1212
|
+
description?: Observable<string> | Observable<UIRawMessage> | string | UIRawMessage;
|
|
1192
1213
|
/**
|
|
1193
1214
|
* @remarks
|
|
1194
1215
|
* Whether or not this toggle is disabled.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minecraft/server-ui",
|
|
3
|
-
"version": "2.1.0-beta.1.26.10-preview.
|
|
3
|
+
"version": "2.1.0-beta.1.26.10-preview.23",
|
|
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.7.0-beta.1.26.10-preview.
|
|
17
|
+
"@minecraft/server": "^2.0.0 || ^2.7.0-beta.1.26.10-preview.23"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT"
|
|
20
20
|
}
|