@casual-simulation/aux-common 3.1.36 → 3.2.1-alpha.5646793078
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/aux-format-2/AuxCausalTree2.js +5 -1
- package/aux-format-2/AuxCausalTree2.js.map +1 -1
- package/bots/Bot.d.ts +438 -43
- package/bots/Bot.js +15 -0
- package/bots/Bot.js.map +1 -1
- package/bots/BotEvents.d.ts +344 -31
- package/bots/BotEvents.js +15 -0
- package/bots/BotEvents.js.map +1 -1
- package/bots/StoredAux.d.ts +2 -0
- package/bots/StoredAux.js.map +1 -1
- package/math/Quaternion.d.ts +7 -0
- package/math/Quaternion.js +7 -0
- package/math/Quaternion.js.map +1 -1
- package/math/Rotation.d.ts +54 -2
- package/math/Rotation.js +9 -2
- package/math/Rotation.js.map +1 -1
- package/math/Vector2.d.ts +6 -0
- package/math/Vector2.js +6 -0
- package/math/Vector2.js.map +1 -1
- package/math/Vector3.d.ts +6 -0
- package/math/Vector3.js +6 -0
- package/math/Vector3.js.map +1 -1
- package/package.json +5 -5
- package/partitions/MemoryPartition.js +11 -2
- package/partitions/MemoryPartition.js.map +1 -1
- package/runtime/AuxDevice.d.ts +3 -0
- package/runtime/AuxLibrary.d.ts +1298 -54
- package/runtime/AuxLibrary.js +5406 -849
- package/runtime/AuxLibrary.js.map +1 -1
- package/runtime/AuxLibraryDefinitions.def +120 -4
- package/runtime/AuxRuntime.d.ts +4 -0
- package/runtime/AuxRuntime.js +31 -7
- package/runtime/AuxRuntime.js.map +1 -1
- package/runtime/AuxVersion.d.ts +2 -0
- package/runtime/CompiledBot.d.ts +8 -0
- package/runtime/CompiledBot.js +2 -0
- package/runtime/CompiledBot.js.map +1 -1
package/runtime/AuxLibrary.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AuxGlobalContext, DEBUG_STRING } from './AuxGlobalContext';
|
|
2
|
-
import { BotTags, Bot, ShowChatOptions, BotAction, BotsState, CameraType, BarcodeFormat, PortalType, ShowInputOptions, StartCheckoutOptions, LocalFormAnimationAction, ShareOptions, Easing, BotAnchorPoint, RuntimeBot, BotSpace, EaseType, RegisterPrefixOptions, OpenCircleWipeOptions, SuperShoutAction, ShowToastAction, ShowJoinCodeAction, RequestFullscreenAction, ExitFullscreenAction, ShowHtmlAction, HideHtmlAction, SetClipboardAction, FocusOnBotAction, ShowChatBarAction, EnableARAction, EnableVRAction, DownloadAction, ShowUploadAuxFileAction, OpenQRCodeScannerAction, ShowQRCodeAction, OpenBarcodeScannerAction, ShowBarcodeAction, LoadServerAction, UnloadServerAction, ReplaceDragBotAction, ShowInputForTagAction, GoToDimensionAction, GoToURLAction, OpenURLAction, OpenConsoleAction, StartCheckoutAction, FinishCheckoutAction, RejectAction, FocusOnOptions, SnapTarget, AddDropSnapTargetsAction, RecordingOptions, Recording, SyntheticVoice, EnablePOVAction, EnableCustomDraggingAction, SetAppOutputAction, Record, RecordReference, PartialBotsState, ParsedBotLink, ConvertGeolocationToWhat3WordsOptions, BeginAudioRecordingAction, MediaPermssionOptions, ImageClassifierOptions, AddDropGridTargetsAction, DataRecordOptions, RecordActionOptions, JoinRoomActionOptions, RoomOptions, RoomTrackOptions, SetRoomTrackOptions, RoomRemoteOptions, InstUpdate, StartFormAnimationOptions, StopFormAnimationOptions, FormAnimationData, WakeLockConfiguration, EnableXROptions, TagMapper, ShowConfirmOptions } from '../bots';
|
|
2
|
+
import { BotTags, Bot, ShowChatOptions, BotAction, BotsState, CameraType, BarcodeFormat, PortalType, ShowInputOptions, StartCheckoutOptions, LocalFormAnimationAction, ShareOptions, Easing, BotAnchorPoint, RuntimeBot, BotSpace, EaseType, RegisterPrefixOptions, OpenCircleWipeOptions, SuperShoutAction, ShowToastAction, ShowJoinCodeAction, RequestFullscreenAction, ExitFullscreenAction, ShowHtmlAction, HideHtmlAction, SetClipboardAction, FocusOnBotAction, ShowChatBarAction, EnableARAction, EnableVRAction, DownloadAction, ShowUploadAuxFileAction, OpenQRCodeScannerAction, ShowQRCodeAction, OpenBarcodeScannerAction, ShowBarcodeAction, LoadServerAction, UnloadServerAction, ReplaceDragBotAction, ShowInputForTagAction, GoToDimensionAction, GoToURLAction, OpenURLAction, OpenConsoleAction, StartCheckoutAction, FinishCheckoutAction, RejectAction, FocusOnOptions, SnapTarget, AddDropSnapTargetsAction, RecordingOptions, Recording, SyntheticVoice, EnablePOVAction, EnableCustomDraggingAction, SetAppOutputAction, Record, RecordReference, PartialBotsState, ParsedBotLink, ConvertGeolocationToWhat3WordsOptions, BeginAudioRecordingAction, MediaPermssionOptions, ImageClassifierOptions, AddDropGridTargetsAction, DataRecordOptions, RecordActionOptions, JoinRoomActionOptions, RoomOptions, RoomTrackOptions, SetRoomTrackOptions, RoomRemoteOptions, InstUpdate, StartFormAnimationOptions, StopFormAnimationOptions, FormAnimationData, WakeLockConfiguration, EnableXROptions, TagMapper, ShowConfirmOptions, Geolocation, OpenPhotoCameraOptions, Photo } from '../bots';
|
|
3
3
|
import { RemoteAction } from '@casual-simulation/causal-trees';
|
|
4
4
|
import '../polyfill/Array.first.polyfill';
|
|
5
5
|
import '../polyfill/Array.last.polyfill';
|
|
@@ -9,7 +9,8 @@ import './BlobPolyfill';
|
|
|
9
9
|
import { AuxDevice } from './AuxDevice';
|
|
10
10
|
import { AuxVersion } from './AuxVersion';
|
|
11
11
|
import { Vector3, Vector2, Quaternion, Rotation } from '../math';
|
|
12
|
-
import { CreatePublicRecordKeyResult, GetDataResult, RecordDataResult, RecordFileFailure, EraseDataResult, EraseFileResult, ListDataResult, AddCountResult, GetCountResult,
|
|
12
|
+
import { CreatePublicRecordKeyResult, GetDataResult, RecordDataResult, RecordFileFailure, EraseDataResult, EraseFileResult, ListDataResult, AddCountResult, GetCountResult, GrantMarkerPermissionResult, RevokeMarkerPermissionResult, GrantRoleResult, RevokeRoleResult } from '@casual-simulation/aux-records';
|
|
13
|
+
import type { AvailablePermissions } from '@casual-simulation/aux-records';
|
|
13
14
|
import { DateTime } from 'luxon';
|
|
14
15
|
import * as hooks from 'preact/hooks';
|
|
15
16
|
import { render } from 'preact';
|
|
@@ -61,12 +62,23 @@ export interface AuxLibrary {
|
|
|
61
62
|
};
|
|
62
63
|
typeDefinitions?: string;
|
|
63
64
|
}
|
|
64
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Defines the possible values that can be used as a tag filter.
|
|
67
|
+
*
|
|
68
|
+
* @dochash types/core
|
|
69
|
+
* @docgroup 01-core
|
|
70
|
+
* @docname TagFilter
|
|
71
|
+
*/
|
|
72
|
+
export type TagFilter = ((value: any) => boolean) | string | number | boolean | null | undefined;
|
|
65
73
|
/**
|
|
66
74
|
* Defines a type that represents a mod.
|
|
67
75
|
* That is, a set of tags that can be applied to another bot.
|
|
76
|
+
*
|
|
77
|
+
* @dochash types/core
|
|
78
|
+
* @docgroup 01-core
|
|
79
|
+
* @docname Mod
|
|
68
80
|
*/
|
|
69
|
-
type Mod = BotTags | Bot;
|
|
81
|
+
export type Mod = BotTags | Bot;
|
|
70
82
|
/**
|
|
71
83
|
* An interface that is used to say which user/device/session an event should be sent to.
|
|
72
84
|
*/
|
|
@@ -138,6 +150,12 @@ interface SaveFileOptions {
|
|
|
138
150
|
}
|
|
139
151
|
/**
|
|
140
152
|
* Defines a set of options for a webhook.
|
|
153
|
+
*
|
|
154
|
+
* @dochash types/web
|
|
155
|
+
* @doctitle Web Types
|
|
156
|
+
* @docsidebar Web
|
|
157
|
+
* @docdescription These types are used for web requests.
|
|
158
|
+
* @docname WebhookOptions
|
|
141
159
|
*/
|
|
142
160
|
export interface WebhookOptions {
|
|
143
161
|
/**
|
|
@@ -150,6 +168,8 @@ export interface WebhookOptions {
|
|
|
150
168
|
url?: string;
|
|
151
169
|
/**
|
|
152
170
|
* The headers to include in the request.
|
|
171
|
+
*
|
|
172
|
+
* @docsource Headers
|
|
153
173
|
*/
|
|
154
174
|
headers?: {
|
|
155
175
|
[key: string]: string;
|
|
@@ -176,7 +196,13 @@ export interface WebhookOptions {
|
|
|
176
196
|
retryAfterMs?: number;
|
|
177
197
|
}
|
|
178
198
|
/**
|
|
179
|
-
* Defines a set of options for animateTag
|
|
199
|
+
* Defines a set of options for {@link animateTag-byTag}.
|
|
200
|
+
*
|
|
201
|
+
* @dochash types/animation
|
|
202
|
+
* @doctitle Animation Types
|
|
203
|
+
* @docsidebar Animation
|
|
204
|
+
* @docdescription These types are used for animating tags.
|
|
205
|
+
* @docname AnimateTagOptions
|
|
180
206
|
*/
|
|
181
207
|
export interface AnimateTagFunctionOptions {
|
|
182
208
|
/**
|
|
@@ -212,6 +238,19 @@ export interface AnimateTagFunctionOptions {
|
|
|
212
238
|
*/
|
|
213
239
|
tagMaskSpace?: BotSpace | false;
|
|
214
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* Defines a bot filter function.
|
|
243
|
+
*
|
|
244
|
+
* Common bot filters are {@link byTag}
|
|
245
|
+
*
|
|
246
|
+
* @dochash types/core
|
|
247
|
+
* @docgroup 01-core
|
|
248
|
+
* @docname BotFilter
|
|
249
|
+
*/
|
|
250
|
+
export type BotFilter = ((bot: Bot) => boolean) | null;
|
|
251
|
+
/**
|
|
252
|
+
* Defines a bot filter function.
|
|
253
|
+
*/
|
|
215
254
|
export interface BotFilterFunction {
|
|
216
255
|
(bot: Bot): boolean;
|
|
217
256
|
sort?: (bot: Bot) => any;
|
|
@@ -236,8 +275,35 @@ export interface IDRecordFilter extends BotFilterFunction, RecordFilter {
|
|
|
236
275
|
toJSON: () => RecordFilter;
|
|
237
276
|
}
|
|
238
277
|
export type RecordFilters = AuthIdRecordFilter | SpaceFilter | AddressRecordFilter | IDRecordFilter | RecordReference;
|
|
278
|
+
/**
|
|
279
|
+
* Defines the options for {@link experiment.speakText}.
|
|
280
|
+
*
|
|
281
|
+
* @dochash types/experimental
|
|
282
|
+
* @docname SpeakTextOptions
|
|
283
|
+
*/
|
|
284
|
+
export interface SpeakTextApiOptions {
|
|
285
|
+
/**
|
|
286
|
+
* The rate that the text should be spoken at.
|
|
287
|
+
* This can be any positive number.
|
|
288
|
+
*/
|
|
289
|
+
rate?: number;
|
|
290
|
+
/**
|
|
291
|
+
* The pitch that the text should be spoken at.
|
|
292
|
+
* This can be any positive number.
|
|
293
|
+
*/
|
|
294
|
+
pitch?: number;
|
|
295
|
+
/**
|
|
296
|
+
* The voice that the text should be spoken with.
|
|
297
|
+
* This can be the voice object or the name of a voice.
|
|
298
|
+
* Note that not all browsers support the same voices.
|
|
299
|
+
*/
|
|
300
|
+
voice?: string | SyntheticVoice;
|
|
301
|
+
}
|
|
239
302
|
/**
|
|
240
303
|
* Defines a set of options for a tween.
|
|
304
|
+
*
|
|
305
|
+
* @dochash types/experimental
|
|
306
|
+
* @docname TweenOptions
|
|
241
307
|
*/
|
|
242
308
|
export interface TweenOptions {
|
|
243
309
|
/**
|
|
@@ -325,8 +391,701 @@ export interface DebuggerInterface {
|
|
|
325
391
|
*/
|
|
326
392
|
[GET_RUNTIME]: () => AuxRuntime;
|
|
327
393
|
}
|
|
394
|
+
export interface DebuggerBase {
|
|
395
|
+
/**
|
|
396
|
+
* Gets the list of portal bots in the debugger.
|
|
397
|
+
*/
|
|
398
|
+
getPortalBots(): Map<string, Bot>;
|
|
399
|
+
/**
|
|
400
|
+
* Gets the list of action objects that have been performed by bots in the current debugger.
|
|
401
|
+
* Action objects are used by CasualOS to represent changes to bots or external effects that should be performed.
|
|
402
|
+
* Examples of this are {@link create}, {@link os.toast} and {@link os.enableVR}.
|
|
403
|
+
*
|
|
404
|
+
* @example Get the list of bot changes and actions that have been performed in a debugger
|
|
405
|
+
* const debug = await os.createDebugger();
|
|
406
|
+
* debug.create({
|
|
407
|
+
* test: '@os.toast("Hello")'
|
|
408
|
+
* });
|
|
409
|
+
* debug.shout("test");
|
|
410
|
+
*
|
|
411
|
+
* const actions = debug.getAllActions();
|
|
412
|
+
*
|
|
413
|
+
* assertEqual(actions, [
|
|
414
|
+
* {
|
|
415
|
+
* type: 'add_bot',
|
|
416
|
+
* id: 'uuid-1',
|
|
417
|
+
* bot: {
|
|
418
|
+
* id: 'uuid-1',
|
|
419
|
+
* tags: {
|
|
420
|
+
* test: '@os.toast("Hello")'
|
|
421
|
+
* }
|
|
422
|
+
* }
|
|
423
|
+
* },
|
|
424
|
+
* {
|
|
425
|
+
* type: 'show_toast',
|
|
426
|
+
* message: 'Hello',
|
|
427
|
+
* duration: 2000
|
|
428
|
+
* }
|
|
429
|
+
* ]);
|
|
430
|
+
*/
|
|
431
|
+
getAllActions(): BotAction[];
|
|
432
|
+
/**
|
|
433
|
+
* Gets the list of common action objects that have been performed by bots in the current debugger. Action objects are used by CasualOS to represent changes to bots or external effects that should be performed.
|
|
434
|
+
* Common actions are actions that do not immediately change bots or bot tags or masks.
|
|
435
|
+
*
|
|
436
|
+
* Examples of common actions are {@link os.toast} and {@link os.enableVR}.
|
|
437
|
+
*
|
|
438
|
+
* @example Get the list of actions that have been performed in a debugger
|
|
439
|
+
* const debug = await os.createDebugger();
|
|
440
|
+
* debug.create({
|
|
441
|
+
* test: '@os.toast("Hello")'
|
|
442
|
+
* });
|
|
443
|
+
* debug.shout("test");
|
|
444
|
+
*
|
|
445
|
+
* const actions = debug.getCommonActions();
|
|
446
|
+
*
|
|
447
|
+
* assertEqual(actions, [
|
|
448
|
+
* {
|
|
449
|
+
* type: 'show_toast',
|
|
450
|
+
* message: 'Hello',
|
|
451
|
+
* duration: 2000
|
|
452
|
+
* }
|
|
453
|
+
* ]);
|
|
454
|
+
*/
|
|
455
|
+
getCommonActions(): BotAction[];
|
|
456
|
+
/**
|
|
457
|
+
* Gets the list of bot actions that have been performed by bots in the current debugger.
|
|
458
|
+
* Action objects are used by CasualOS to represent changes to bots or external effects that should be performed.
|
|
459
|
+
* Bot actions are actions that immediately change bots or bot tags or masks.
|
|
460
|
+
*
|
|
461
|
+
* Examples of bot actions are {@link create}, {@link destroy} or {@link setTagMask}.
|
|
462
|
+
*
|
|
463
|
+
* @example Get the list of bot changes that have been performed in a debugger
|
|
464
|
+
* const debug = await os.createDebugger();
|
|
465
|
+
* debug.create({
|
|
466
|
+
* test: '@os.toast("Hello")'
|
|
467
|
+
* });
|
|
468
|
+
* debug.shout("test");
|
|
469
|
+
*
|
|
470
|
+
* const actions = debug.getBotActions();
|
|
471
|
+
*
|
|
472
|
+
* assertEqual(actions, [
|
|
473
|
+
* {
|
|
474
|
+
* type: 'add_bot',
|
|
475
|
+
* id: 'uuid-1',
|
|
476
|
+
* bot: {
|
|
477
|
+
* id: 'uuid-1',
|
|
478
|
+
* tags: {
|
|
479
|
+
* test: '@os.toast("Hello")'
|
|
480
|
+
* }
|
|
481
|
+
* }
|
|
482
|
+
* },
|
|
483
|
+
* ]);
|
|
484
|
+
*/
|
|
485
|
+
getBotActions(): BotAction[];
|
|
486
|
+
/**
|
|
487
|
+
* Gets the list of errors that have occurred in the current debugger. Errors occur when an exceptional event happens in a script and prevents the rest of the script from executing.
|
|
488
|
+
*
|
|
489
|
+
* Debuggers capture these errors and let you inspect them afterwards.
|
|
490
|
+
*
|
|
491
|
+
* @example Get the list of errors that have happened in a debugger
|
|
492
|
+
* const debug = await os.createDebugger();
|
|
493
|
+
* debug.create({
|
|
494
|
+
* test: '@throw new Error("My Error")'
|
|
495
|
+
* });
|
|
496
|
+
* debug.shout("test");
|
|
497
|
+
*
|
|
498
|
+
* const errors = debug.getErrors();
|
|
499
|
+
*
|
|
500
|
+
* assertEqual(errors.length, 1);
|
|
501
|
+
* assertEqual(errors[0].error, new Error("My Error"));
|
|
502
|
+
* assertEqual(errors[0].tag, "test");
|
|
503
|
+
*/
|
|
504
|
+
getErrors(): any[];
|
|
505
|
+
/**
|
|
506
|
+
* Registers the given handler to be called before a bot action is executed in this debugger.
|
|
507
|
+
* @param handler The handler that should be called.
|
|
508
|
+
*/
|
|
509
|
+
onBeforeAction(handler: (action: BotAction) => void): void;
|
|
510
|
+
/**
|
|
511
|
+
* Registers the given handler to be called after a bot action is executed in this debugger.
|
|
512
|
+
* @param handler The handler that should be called.
|
|
513
|
+
*/
|
|
514
|
+
onAfterAction(handler: (action: BotAction) => void): void;
|
|
515
|
+
/**
|
|
516
|
+
* Registers the given handler function to be called before a user action is performed in the debugger.
|
|
517
|
+
*
|
|
518
|
+
* User actions are like normal actions, except they are generated by the CasualOS frontend.
|
|
519
|
+
* Generally, this only happens for built-in shouts and whispers.
|
|
520
|
+
* Additionally, these actions can only be automatically created for debuggers that are attached using {@link os.attachDebugger}.
|
|
521
|
+
*
|
|
522
|
+
* @param listener the function that should be called before a user action is performed.
|
|
523
|
+
*
|
|
524
|
+
* @example Listen for tag updates in a debugger
|
|
525
|
+
* const debug = await os.createDebugger({
|
|
526
|
+
* pausable: true
|
|
527
|
+
* });
|
|
528
|
+
*
|
|
529
|
+
* // Register a listener that gets called whenever a user action is about to be performed.
|
|
530
|
+
* debug.onBeforeUserAction(update => {
|
|
531
|
+
* console.log('user action', update);
|
|
532
|
+
* });
|
|
533
|
+
*
|
|
534
|
+
* // Because the debugger is pausable, the create() function returns a promise
|
|
535
|
+
* // because it calls @onCreate which could cause a pause trigger to be hit.
|
|
536
|
+
* const debuggerBot = await debug.create({
|
|
537
|
+
* home: true,
|
|
538
|
+
* });
|
|
539
|
+
*
|
|
540
|
+
* // Attach the debugger to the front end
|
|
541
|
+
* await os.attachDebugger(debug);
|
|
542
|
+
*
|
|
543
|
+
* @docname onBeforeUserAction
|
|
544
|
+
* @docid debug.onBeforeUserAction
|
|
545
|
+
*/
|
|
546
|
+
onBeforeUserAction(listener: (action: BotAction) => void): void;
|
|
547
|
+
/**
|
|
548
|
+
* Registers the given handler function to be called by the debugger whenever a script enqueues an action.
|
|
549
|
+
* This occurrs for common actions like {@link os.toast} and {@link os.showInput}.
|
|
550
|
+
*
|
|
551
|
+
* Every action that is enqueued ends up being performed.
|
|
552
|
+
*
|
|
553
|
+
* @param listener the function that should be called whenever an action is scheduled to be performed.
|
|
554
|
+
*
|
|
555
|
+
* @example Listen for actions to be enqueued in a debugger
|
|
556
|
+
* const debug = await os.createDebugger({
|
|
557
|
+
* pausable: true
|
|
558
|
+
* });
|
|
559
|
+
*
|
|
560
|
+
* // Register a listener that gets called whenever an action is scheduled to be performed.
|
|
561
|
+
* debug.onScriptActionEnqueued(action => {
|
|
562
|
+
* console.log('action enqueued', action);
|
|
563
|
+
* });
|
|
564
|
+
*
|
|
565
|
+
* // Because the debugger is pausable, the create() function returns a promise
|
|
566
|
+
* // because it calls @onCreate which could cause a pause trigger to be hit.
|
|
567
|
+
* const debuggerBot = await debug.create({
|
|
568
|
+
* test: '@let abc = 123; os.toast(abc);'
|
|
569
|
+
* });
|
|
570
|
+
*
|
|
571
|
+
* // Send a shout. Just like the create() function above, we recieve a promise that we can await.
|
|
572
|
+
* await debug.shout('test');
|
|
573
|
+
*/
|
|
574
|
+
onScriptActionEnqueued(listener: (action: BotAction) => void): void;
|
|
575
|
+
/**
|
|
576
|
+
* Registers the given handler function to be called after any tag is updated in the debugger.
|
|
577
|
+
*
|
|
578
|
+
* @param listener the function that should be called when a tag is updated.
|
|
579
|
+
*
|
|
580
|
+
* @example Listen for tag updates in a debugger
|
|
581
|
+
* const debug = await os.createDebugger({
|
|
582
|
+
* pausable: true
|
|
583
|
+
* });
|
|
584
|
+
*
|
|
585
|
+
* // Register a listener that gets called whenever a tag is updated.
|
|
586
|
+
* debug.onAfterScriptUpdatedTag(update => {
|
|
587
|
+
* console.log('tag updated', update);
|
|
588
|
+
* });
|
|
589
|
+
*
|
|
590
|
+
* // Because the debugger is pausable, the create() function returns a promise
|
|
591
|
+
* // because it calls @onCreate which could cause a pause trigger to be hit.
|
|
592
|
+
* const debuggerBot = await debug.create({
|
|
593
|
+
* test: '@tags.message = "hello, world";'
|
|
594
|
+
* });
|
|
595
|
+
*
|
|
596
|
+
* // Send a shout. Just like the create() function above, we recieve a promise that we can await.
|
|
597
|
+
* await debug.shout('test');
|
|
598
|
+
*/
|
|
599
|
+
onAfterScriptUpdatedTag(listener: (update: DebuggerTagUpdate) => void): void;
|
|
600
|
+
/**
|
|
601
|
+
* Registers the given handler function to be called after any tag mask is updated in the debugger.
|
|
602
|
+
*
|
|
603
|
+
* @param listener the function that should be called when a tag mask is updated.
|
|
604
|
+
*
|
|
605
|
+
* @example Listen for tag mask updates in a debugger
|
|
606
|
+
* const debug = await os.createDebugger({
|
|
607
|
+
* pausable: true
|
|
608
|
+
* });
|
|
609
|
+
*
|
|
610
|
+
* // Register a listener that gets called whenever a tag mask is updated.
|
|
611
|
+
* debug.onAfterScriptUpdatedTagMask(update => {
|
|
612
|
+
* console.log('tag mask updated', update);
|
|
613
|
+
* });
|
|
614
|
+
*
|
|
615
|
+
* // Because the debugger is pausable, the create() function returns a promise
|
|
616
|
+
* // because it calls @onCreate which could cause a pause trigger to be hit.
|
|
617
|
+
* const debuggerBot = await debug.create({
|
|
618
|
+
* test: '@masks.message = "hello, world";'
|
|
619
|
+
* });
|
|
620
|
+
*
|
|
621
|
+
* // Send a shout. Just like the create() function above, we recieve a promise that we can await.
|
|
622
|
+
* await debug.shout('test');
|
|
623
|
+
*/
|
|
624
|
+
onAfterScriptUpdatedTagMask(listener: (update: DebuggerTagMaskUpdate) => void): void;
|
|
625
|
+
/**
|
|
626
|
+
* Performs the given actions in order as if they were user actions.
|
|
627
|
+
*
|
|
628
|
+
* This function works similarly to {@link action.perform} except that actions performed with it will also call handlers registered with {@link debug.onBeforeUserAction}.
|
|
629
|
+
* @param actions the actions that should be performed.
|
|
630
|
+
*/
|
|
631
|
+
performUserAction(...actions: BotAction[]): Promise<(any[] | null)[]>;
|
|
632
|
+
/**
|
|
633
|
+
* The web actions that are available in this debugger.
|
|
634
|
+
*
|
|
635
|
+
* @docreferenceactions ^web\.
|
|
636
|
+
* @docsource WebActions
|
|
637
|
+
*/
|
|
638
|
+
web: {};
|
|
639
|
+
/**
|
|
640
|
+
* The OS actions that are available in this debugger.
|
|
641
|
+
*
|
|
642
|
+
* @docreferenceactions ^os\.
|
|
643
|
+
* @docsource OSActions
|
|
644
|
+
*/
|
|
645
|
+
os: {};
|
|
646
|
+
/**
|
|
647
|
+
* The action-related actions that are available in this debugger.
|
|
648
|
+
*
|
|
649
|
+
* @docreferenceactions ^action\.
|
|
650
|
+
* @docsource ActionActions
|
|
651
|
+
*/
|
|
652
|
+
action: {};
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Defines the possible types that represent a debugger.
|
|
656
|
+
*
|
|
657
|
+
* @dochash types/debuggers
|
|
658
|
+
* @docname Debugger
|
|
659
|
+
*/
|
|
660
|
+
export type Debugger = NormalDebugger | PausableDebugger;
|
|
661
|
+
/**
|
|
662
|
+
* Defines an interface that represents a debugger.
|
|
663
|
+
*
|
|
664
|
+
* @dochash types/debuggers/debugger
|
|
665
|
+
* @doctitle Debugger
|
|
666
|
+
* @docsidebar Debugger
|
|
667
|
+
* @docdescription Defines an interface that represents a debugger.
|
|
668
|
+
* @docname Debugger
|
|
669
|
+
* @docreferenceactions ^\w+$
|
|
670
|
+
*/
|
|
671
|
+
export interface NormalDebugger extends DebuggerBase {
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Defines an interface that represents a pausable debugger.
|
|
675
|
+
*
|
|
676
|
+
* @dochash types/debuggers/pausable-debugger
|
|
677
|
+
* @doctitle Pausable Debugger
|
|
678
|
+
* @docsidebar Pausable Debugger
|
|
679
|
+
* @docdescription Defines an interface that represents a pausable debugger.
|
|
680
|
+
* @docname PausableDebugger
|
|
681
|
+
* @docreferenceactions ^\w+$
|
|
682
|
+
*/
|
|
683
|
+
export interface PausableDebugger extends DebuggerBase {
|
|
684
|
+
/**
|
|
685
|
+
* Registers the given function to be called whenever the debugger is paused by hitting a pause trigger.
|
|
686
|
+
*
|
|
687
|
+
* @param handler the function that should be called when the debugger is paused.
|
|
688
|
+
*
|
|
689
|
+
* @example Listen for pauses on a debugger
|
|
690
|
+
* const debug = await os.createDebugger({
|
|
691
|
+
* pausable: true
|
|
692
|
+
* });
|
|
693
|
+
*
|
|
694
|
+
* debug.onPause(pause => {
|
|
695
|
+
* console.log('pause happened!', pause);
|
|
696
|
+
* });
|
|
697
|
+
*
|
|
698
|
+
* @docname onPause
|
|
699
|
+
* @docid debug.onPause
|
|
700
|
+
*/
|
|
701
|
+
onPause(handler: (pause: DebuggerPause) => void): void;
|
|
702
|
+
/**
|
|
703
|
+
* Registers or updates a pause trigger with a debugger. Returns the newly created trigger.
|
|
704
|
+
*
|
|
705
|
+
* Pause triggers can be used to tell the debugger where you want it to temporarily stop execution. You specify the bot, tag, line and column numbers, and the debugger will stop before it executes the code at that location.
|
|
706
|
+
* Additionally, the debugger will call all handlers that have been registered with {@link debug.onPause}.
|
|
707
|
+
*
|
|
708
|
+
* @param trigger The trigger that should be registered or updated.
|
|
709
|
+
*
|
|
710
|
+
* @docname setPauseTrigger
|
|
711
|
+
* @docid debug.setPauseTrigger-trigger
|
|
712
|
+
*/
|
|
713
|
+
_setPauseTrigger_trigger(trigger: PauseTrigger): PauseTrigger;
|
|
714
|
+
/**
|
|
715
|
+
* Registers or updates a pause trigger with this debugger.
|
|
716
|
+
* Pause triggers can be used to tell the debugger when you want it to stop execution.
|
|
717
|
+
* You specify the bot, tag, line and column numbers and the debugger will stop before/after it executes the code at that location.
|
|
718
|
+
* @param botOrIdOrTrigger the bot, or bot ID that should be registered.
|
|
719
|
+
* @param tag the name of the tag that the trigger should be set on.
|
|
720
|
+
* @param options The options that go with this pause trigger.
|
|
721
|
+
*
|
|
722
|
+
* @example Set a pause trigger on a script
|
|
723
|
+
* const debug = await os.createDebugger({
|
|
724
|
+
* pausable: true
|
|
725
|
+
* });
|
|
726
|
+
*
|
|
727
|
+
* const b = await debug.create({
|
|
728
|
+
* test: '@os.toast("Hello, World!")'
|
|
729
|
+
* });
|
|
730
|
+
*
|
|
731
|
+
* const trigger = debug.setPauseTrigger(b, 'test', {
|
|
732
|
+
* lineNumber: 1,
|
|
733
|
+
* columnNumber: 1
|
|
734
|
+
* });
|
|
735
|
+
*
|
|
736
|
+
* @example Update a pause trigger on a script
|
|
737
|
+
* const debug = await os.createDebugger({
|
|
738
|
+
* pausable: true
|
|
739
|
+
* });
|
|
740
|
+
*
|
|
741
|
+
* const b = await debug.create({
|
|
742
|
+
* test: '@os.toast("Hello, World!")'
|
|
743
|
+
* });
|
|
744
|
+
*
|
|
745
|
+
* let trigger = debug.setPauseTrigger(b, 'test', {
|
|
746
|
+
* lineNumber: 1,
|
|
747
|
+
* columnNumber: 1
|
|
748
|
+
* });
|
|
749
|
+
*
|
|
750
|
+
* trigger = debug.setPauseTrigger({
|
|
751
|
+
* ...trigger,
|
|
752
|
+
* states: ['before', 'after']
|
|
753
|
+
* });
|
|
754
|
+
|
|
755
|
+
* @docname setPauseTrigger
|
|
756
|
+
* @docid debug.setPauseTrigger-botOrId
|
|
757
|
+
*/
|
|
758
|
+
_setPauseTrigger_botOrId(botOrIdOrTrigger: Bot | string, tag?: string, options?: PauseTriggerOptions): PauseTrigger;
|
|
759
|
+
/**
|
|
760
|
+
* Removes the given pause trigger from the debugger.
|
|
761
|
+
* @param triggerOrId the trigger or trigger ID that should be removed from the debugger.
|
|
762
|
+
*
|
|
763
|
+
* @example Remove a pause trigger
|
|
764
|
+
* const debug = await os.createDebugger({
|
|
765
|
+
* pausable: true
|
|
766
|
+
* });
|
|
767
|
+
*
|
|
768
|
+
* const b = await debug.create({
|
|
769
|
+
* test: '@os.toast("Hello, World!")'
|
|
770
|
+
* });
|
|
771
|
+
*
|
|
772
|
+
* const trigger = debug.setPauseTrigger(b, 'test', {
|
|
773
|
+
* lineNumber: 1,
|
|
774
|
+
* columnNumber: 1
|
|
775
|
+
* });
|
|
776
|
+
*
|
|
777
|
+
* debug.removePauseTrigger(trigger);
|
|
778
|
+
*/
|
|
779
|
+
removePauseTrigger(triggerOrId: string | PauseTrigger): void;
|
|
780
|
+
/**
|
|
781
|
+
* Disables the given pause trigger.
|
|
782
|
+
* Disabled pause triggers will continue to be listed with {@link debug.listPauseTriggers}, but will not cause a pause to happen while they are disabled.
|
|
783
|
+
*
|
|
784
|
+
* @param triggerOrId The trigger or trigger ID that should be disabled.
|
|
785
|
+
*
|
|
786
|
+
* @example Disable a pause trigger
|
|
787
|
+
* const debug = await os.createDebugger({
|
|
788
|
+
* pausable: true
|
|
789
|
+
* });
|
|
790
|
+
*
|
|
791
|
+
* const b = await debug.create({
|
|
792
|
+
* test: '@os.toast("Hello, World!")'
|
|
793
|
+
* });
|
|
794
|
+
*
|
|
795
|
+
* const trigger = debug.setPauseTrigger(b, 'test', {
|
|
796
|
+
* lineNumber: 1,
|
|
797
|
+
* columnNumber: 1
|
|
798
|
+
* });
|
|
799
|
+
*
|
|
800
|
+
* debug.disablePauseTrigger(trigger);
|
|
801
|
+
*/
|
|
802
|
+
disablePauseTrigger(triggerOrId: string | PauseTrigger): void;
|
|
803
|
+
/**
|
|
804
|
+
* Enables the given pause trigger
|
|
805
|
+
* @param triggerOrId The trigger or trigger ID that should be enabled.
|
|
806
|
+
*
|
|
807
|
+
* @example Enable a pause trigger
|
|
808
|
+
* const debug = await os.createDebugger({
|
|
809
|
+
* pausable: true
|
|
810
|
+
* });
|
|
811
|
+
*
|
|
812
|
+
* const b = await debug.create({
|
|
813
|
+
* test: '@os.toast("Hello, World!")'
|
|
814
|
+
* });
|
|
815
|
+
*
|
|
816
|
+
* const trigger = debug.setPauseTrigger(b, 'test', {
|
|
817
|
+
* lineNumber: 1,
|
|
818
|
+
* columnNumber: 1,
|
|
819
|
+
* enabled: false
|
|
820
|
+
* });
|
|
821
|
+
*
|
|
822
|
+
* debug.enablePauseTrigger(trigger);
|
|
823
|
+
*/
|
|
824
|
+
enablePauseTrigger(triggerOrId: string | PauseTrigger): void;
|
|
825
|
+
/**
|
|
826
|
+
* Gets the list of pause triggers that have been registered with this debugger.
|
|
827
|
+
*
|
|
828
|
+
* @example List the triggers that are set on this debugger
|
|
829
|
+
* const debug = await os.createDebugger({
|
|
830
|
+
* pausable: true
|
|
831
|
+
* });
|
|
832
|
+
*
|
|
833
|
+
* const b = await debug.create({
|
|
834
|
+
* test: '@os.toast("Hello, World!")'
|
|
835
|
+
* });
|
|
836
|
+
*
|
|
837
|
+
* const trigger = debug.setPauseTrigger(b, 'test', {
|
|
838
|
+
* lineNumber: 1,
|
|
839
|
+
* columnNumber: 1,
|
|
840
|
+
* enabled: false
|
|
841
|
+
* });
|
|
842
|
+
*
|
|
843
|
+
* const triggers = debug.listPauseTriggers();
|
|
844
|
+
*
|
|
845
|
+
* @docname listPauseTriggers
|
|
846
|
+
* @docid debug.listPauseTriggers
|
|
847
|
+
*/
|
|
848
|
+
listPauseTriggers(): PauseTrigger[];
|
|
849
|
+
/**
|
|
850
|
+
* Gets a list of common trigger locations for the specified tag on the specified bot. Returns an array containing the list of possible pause trigger locations.
|
|
851
|
+
*
|
|
852
|
+
* @param botOrId the bot or bot ID that the locations should be listed for.
|
|
853
|
+
* @param tag the name of the tag that the locations should be listed for.
|
|
854
|
+
*
|
|
855
|
+
* @example List common trigger locations for a script
|
|
856
|
+
* const debug = await os.createDebugger({
|
|
857
|
+
* pausable: true
|
|
858
|
+
* });
|
|
859
|
+
*
|
|
860
|
+
* const b = await debug.create({
|
|
861
|
+
* test: '@os.toast("Hello, World!")'
|
|
862
|
+
* });
|
|
863
|
+
*
|
|
864
|
+
* const triggerLocations = debug.listCommonPauseTriggers(b, 'test');
|
|
865
|
+
*
|
|
866
|
+
* @example Register a trigger from a common location
|
|
867
|
+
* const debug = await os.createDebugger({
|
|
868
|
+
* pausable: true
|
|
869
|
+
* });
|
|
870
|
+
*
|
|
871
|
+
* const b = await debug.create({
|
|
872
|
+
* test: '@os.toast("Hello, World!")'
|
|
873
|
+
* });
|
|
874
|
+
*
|
|
875
|
+
* const triggerLocations = debug.listCommonPauseTriggers(b, 'test');
|
|
876
|
+
*
|
|
877
|
+
* const trigger = debug.setPauseTrigger(b, 'test', {
|
|
878
|
+
* lineNumber: triggerLocations[0].lineNumber,
|
|
879
|
+
* columnNumber: triggerLocations[0].columnNumber,
|
|
880
|
+
* states: triggerLocations[0].possibleStates
|
|
881
|
+
* });
|
|
882
|
+
*/
|
|
883
|
+
listCommonPauseTriggers(botOrId: Bot | string, tag: string): PossiblePauseTriggerLocation[];
|
|
884
|
+
/**
|
|
885
|
+
* Resumes the debugger execution from the given pause.
|
|
886
|
+
* @param pause the debugger pause that was passed to the handler of {@link debug.onPause}.
|
|
887
|
+
*
|
|
888
|
+
* @example Resume execution on a debugger
|
|
889
|
+
* const debug = await os.createDebugger({
|
|
890
|
+
* pausable: true
|
|
891
|
+
* });
|
|
892
|
+
*
|
|
893
|
+
* // Register a listener that gets called whenever a pause happens in this debugger.
|
|
894
|
+
* debug.onPause(pause => {
|
|
895
|
+
* // Get the current stack frame from the pause
|
|
896
|
+
* const currentFrame = pause.callStack[pause.callStack.length - 1];
|
|
897
|
+
*
|
|
898
|
+
* // Set the abc variable to 999
|
|
899
|
+
* currentFrame.setVariableValue('abc', 999);
|
|
900
|
+
*
|
|
901
|
+
* // Resume execution after the pause.
|
|
902
|
+
* debug.resume(pause);
|
|
903
|
+
* });
|
|
904
|
+
*
|
|
905
|
+
* // Because the debugger is pausable, the create() function returns a promise
|
|
906
|
+
* // because it calls @onCreate which could cause a pause trigger to be hit.
|
|
907
|
+
* const debuggerBot = await debug.create({
|
|
908
|
+
* test: '@let abc = 123; os.toast(abc);'
|
|
909
|
+
* });
|
|
910
|
+
*
|
|
911
|
+
* // Set a pause trigger in the "test" script of the bot we just created
|
|
912
|
+
* // at line 1 column 16
|
|
913
|
+
* const trigger = debug.setPauseTrigger(debuggerBot, 'test', {
|
|
914
|
+
* lineNumber: 1,
|
|
915
|
+
* columnNumber: 16
|
|
916
|
+
* });
|
|
917
|
+
*
|
|
918
|
+
* // Send a shout. Just like the create() function above, we recieve a promise that we can await.
|
|
919
|
+
* await debug.shout('test');
|
|
920
|
+
*
|
|
921
|
+
* // Get the resulting actions from the debugger
|
|
922
|
+
* // and perform the first one. This should be the os.toast(), but instead of printing 123,
|
|
923
|
+
* // it should print 999 because we changed the value of abc during the debugger pause.
|
|
924
|
+
* const actions = debug.getCommonActions();
|
|
925
|
+
* action.perform(actions[0]);
|
|
926
|
+
*/
|
|
927
|
+
resume(pause: DebuggerPause): void;
|
|
928
|
+
/**
|
|
929
|
+
* Gets the current call stack for the debugger. Call stacks are useful for determining program flow and how scripts interact with each other.
|
|
930
|
+
*
|
|
931
|
+
* @example Get the call stack from a debugger
|
|
932
|
+
* const debug = os.createDebugger({
|
|
933
|
+
* pausable: true
|
|
934
|
+
* });
|
|
935
|
+
*
|
|
936
|
+
* const callStack = debug.getCallStack();
|
|
937
|
+
*/
|
|
938
|
+
getCallStack(): DebuggerCallFrame[];
|
|
939
|
+
/**
|
|
940
|
+
* Creates a new bot and returns it.
|
|
941
|
+
* @param parent The bot that should be the parent of the new bot.
|
|
942
|
+
* @param mods The mods which specify the new bot's tag values. If given a mod with no tags, then an error will be thrown.
|
|
943
|
+
* @returns The bot(s) that were created.
|
|
944
|
+
*
|
|
945
|
+
* @example Create a red bot without a parent.
|
|
946
|
+
* let debugger = await os.createDebugger({
|
|
947
|
+
* pausable: true
|
|
948
|
+
* });
|
|
949
|
+
* let redBot = await debugger.create(null, { "color": "red" });
|
|
950
|
+
*
|
|
951
|
+
* @example Create a red bot and a blue bot with `this` as the parent.
|
|
952
|
+
* let debugger = await os.createDebugger({
|
|
953
|
+
* pausable: true
|
|
954
|
+
* });
|
|
955
|
+
* let [redBot, blueBot] = await debugger.create(this, [
|
|
956
|
+
* { "color": "red" },
|
|
957
|
+
* { "color": "blue" }
|
|
958
|
+
* ]);
|
|
959
|
+
*/
|
|
960
|
+
create(...mods: Mod[]): Promise<Bot | Bot[]>;
|
|
961
|
+
/**
|
|
962
|
+
* Destroys the given bot, bot ID, or list of bots.
|
|
963
|
+
* @param bot The bot, bot ID, or list of bots to destroy.
|
|
964
|
+
*/
|
|
965
|
+
destroy(bot: Bot | string | Bot[]): Promise<void>;
|
|
966
|
+
/**
|
|
967
|
+
* Shouts the given events in order until a bot returns a result.
|
|
968
|
+
* Returns the result that was produced or undefined if no result was produced.
|
|
969
|
+
* @param eventNames The names of the events to shout.
|
|
970
|
+
* @param arg The argument to shout.
|
|
971
|
+
*/
|
|
972
|
+
priorityShout(eventNames: string[], arg?: any): Promise<any>;
|
|
973
|
+
/**
|
|
974
|
+
* Asks every bot in the inst to run the given action.
|
|
975
|
+
* In effect, this is like shouting to a bunch of people in a room.
|
|
976
|
+
*
|
|
977
|
+
* @param name The event name.
|
|
978
|
+
* @param arg The optional argument to include in the shout.
|
|
979
|
+
* @returns Returns a list which contains the values returned from each script that was run for the shout.
|
|
980
|
+
*
|
|
981
|
+
* @example Tell every bot to reset themselves.
|
|
982
|
+
* let debugger = await os.createDebugger({
|
|
983
|
+
* pausable: true
|
|
984
|
+
* });
|
|
985
|
+
* await debugger.shout("reset()");
|
|
986
|
+
*
|
|
987
|
+
* @example Ask every bot for its name.
|
|
988
|
+
* let debugger = await os.createDebugger({
|
|
989
|
+
* pausable: true
|
|
990
|
+
* });
|
|
991
|
+
* const names = await debugger.shout("getName()");
|
|
992
|
+
*
|
|
993
|
+
* @example Tell every bot say "Hi" to you.
|
|
994
|
+
* let debugger = await os.createDebugger({
|
|
995
|
+
* pausable: true
|
|
996
|
+
* });
|
|
997
|
+
* await debugger.shout("sayHi()", "My Name");
|
|
998
|
+
*/
|
|
999
|
+
shout(name: string, arg?: any): Promise<any[]>;
|
|
1000
|
+
/**
|
|
1001
|
+
* Asks the given bots to run the given action.
|
|
1002
|
+
* In effect, this is like whispering to a specific set of people in a room.
|
|
1003
|
+
*
|
|
1004
|
+
* @param bot The bot(s) to send the event to.
|
|
1005
|
+
* @param eventName The name of the event to send.
|
|
1006
|
+
* @param arg The optional argument to include.
|
|
1007
|
+
* @returns Returns a list which contains the values returned from each script that was run for the shout.
|
|
1008
|
+
*/
|
|
1009
|
+
whisper(bot: (Bot | string)[] | Bot | string, eventName: string, arg?: any): Promise<any>;
|
|
1010
|
+
/**
|
|
1011
|
+
* Changes the state that the given bot is in.
|
|
1012
|
+
* @param bot The bot to change.
|
|
1013
|
+
* @param stateName The state that the bot should move to.
|
|
1014
|
+
* @param groupName The group of states that the bot's state should change in. (Defaults to "state")
|
|
1015
|
+
*/
|
|
1016
|
+
changeState(bot: Bot, stateName: string, groupName?: string): Promise<void>;
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Defines an interface for a possible pause trigger location.
|
|
1020
|
+
*
|
|
1021
|
+
* @dochash types/debuggers/common
|
|
1022
|
+
* @docname PossiblePauseTriggerLocation
|
|
1023
|
+
*/
|
|
1024
|
+
export interface PossiblePauseTriggerLocation {
|
|
1025
|
+
/**
|
|
1026
|
+
* The line number that the trigger would pause the debugger at.
|
|
1027
|
+
*/
|
|
1028
|
+
lineNumber: number;
|
|
1029
|
+
/**
|
|
1030
|
+
* The column number that the trigger would pause the debugger at.
|
|
1031
|
+
*/
|
|
1032
|
+
columnNumber: number;
|
|
1033
|
+
/**
|
|
1034
|
+
* The states that are reasonable for this pause trigger to stop at.
|
|
1035
|
+
*/
|
|
1036
|
+
possibleStates: PossiblePauseTriggerStates;
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* The possible states that a pause trigger can be set to.
|
|
1040
|
+
*
|
|
1041
|
+
* @dochash types/debuggers/common
|
|
1042
|
+
* @docname PossiblePauseTriggerStates
|
|
1043
|
+
*/
|
|
1044
|
+
export type PossiblePauseTriggerStates = ['before' | 'after'] | ['before', 'after'];
|
|
1045
|
+
/**
|
|
1046
|
+
* Defines an interface for a debugger trace that represents when a tag was updated.
|
|
1047
|
+
*
|
|
1048
|
+
* @dochash types/debuggers/common
|
|
1049
|
+
* @docname DebuggerTagUpdate
|
|
1050
|
+
*/
|
|
1051
|
+
export interface DebuggerTagUpdate {
|
|
1052
|
+
/**
|
|
1053
|
+
* The ID of the bot that was updated.
|
|
1054
|
+
*/
|
|
1055
|
+
botId: string;
|
|
1056
|
+
/**
|
|
1057
|
+
* The tag that was updated.
|
|
1058
|
+
*/
|
|
1059
|
+
tag: string;
|
|
1060
|
+
/**
|
|
1061
|
+
* The old value of the tag.
|
|
1062
|
+
*/
|
|
1063
|
+
oldValue: any;
|
|
1064
|
+
/**
|
|
1065
|
+
* The new value for the tag.
|
|
1066
|
+
*/
|
|
1067
|
+
newValue: any;
|
|
1068
|
+
}
|
|
1069
|
+
/**
|
|
1070
|
+
* Defines an interface for a debugger trace that represents when a tag mask was updated.
|
|
1071
|
+
*
|
|
1072
|
+
* @dochash types/debuggers/common
|
|
1073
|
+
* @docname DebuggerTagMaskUpdate
|
|
1074
|
+
*/
|
|
1075
|
+
export interface DebuggerTagMaskUpdate extends DebuggerTagUpdate {
|
|
1076
|
+
/**
|
|
1077
|
+
* The space of the tag mask.
|
|
1078
|
+
*/
|
|
1079
|
+
space: string;
|
|
1080
|
+
}
|
|
328
1081
|
/**
|
|
329
1082
|
* Defines an interface that contains options for attaching a debugger.
|
|
1083
|
+
*
|
|
1084
|
+
* @dochash types/debuggers/common
|
|
1085
|
+
* @doctitle Common
|
|
1086
|
+
* @docsidebar Common
|
|
1087
|
+
* @docdescription Defines common interfaces related to debuggers.
|
|
1088
|
+
* @docname AttachDebuggerOptions
|
|
330
1089
|
*/
|
|
331
1090
|
export interface AttachDebuggerOptions {
|
|
332
1091
|
/**
|
|
@@ -335,8 +1094,51 @@ export interface AttachDebuggerOptions {
|
|
|
335
1094
|
*/
|
|
336
1095
|
tagNameMapper?: TagMapper;
|
|
337
1096
|
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Defines an interface that contains options for a debugger.
|
|
1099
|
+
*/
|
|
1100
|
+
export interface CommonDebuggerOptions {
|
|
1101
|
+
/**
|
|
1102
|
+
* Whether to use "real" UUIDs instead of predictable ones.
|
|
1103
|
+
*/
|
|
1104
|
+
useRealUUIDs?: boolean;
|
|
1105
|
+
/**
|
|
1106
|
+
* Whether to allow scripts to be asynchronous.
|
|
1107
|
+
* If false, then all scripts will be forced to be synchronous.
|
|
1108
|
+
* Defaults to true.
|
|
1109
|
+
*/
|
|
1110
|
+
allowAsynchronousScripts?: boolean;
|
|
1111
|
+
/**
|
|
1112
|
+
* The data that the configBot should be created from.
|
|
1113
|
+
* Can be a mod or another bot.
|
|
1114
|
+
*/
|
|
1115
|
+
configBot?: Bot | BotTags;
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Defines an interface that contains options for a normal debugger.
|
|
1119
|
+
* That is, a debugger that is not pausable.
|
|
1120
|
+
*
|
|
1121
|
+
* @dochash types/debuggers/common
|
|
1122
|
+
* @docname NormalDebuggerOptions
|
|
1123
|
+
*/
|
|
1124
|
+
export interface NormalDebuggerOptions extends CommonDebuggerOptions {
|
|
1125
|
+
pausable?: false;
|
|
1126
|
+
}
|
|
1127
|
+
/**
|
|
1128
|
+
* Defines an interface that contains options for a pausable debugger.
|
|
1129
|
+
* That is, a debugger that is pausable.
|
|
1130
|
+
*
|
|
1131
|
+
* @dochash types/debuggers/common
|
|
1132
|
+
* @docname PausableDebuggerOptions
|
|
1133
|
+
*/
|
|
1134
|
+
export interface PausableDebuggerOptions extends CommonDebuggerOptions {
|
|
1135
|
+
pausable: true;
|
|
1136
|
+
}
|
|
338
1137
|
/**
|
|
339
1138
|
* Defines an interface that contains options for an aux debugger.
|
|
1139
|
+
*
|
|
1140
|
+
* @dochash types/debuggers/common
|
|
1141
|
+
* @docname DebuggerOptions
|
|
340
1142
|
*/
|
|
341
1143
|
export interface AuxDebuggerOptions {
|
|
342
1144
|
/**
|
|
@@ -361,6 +1163,9 @@ export interface AuxDebuggerOptions {
|
|
|
361
1163
|
}
|
|
362
1164
|
/**
|
|
363
1165
|
* Defines an interface that contains options for a pause trigger.
|
|
1166
|
+
*
|
|
1167
|
+
* @dochash types/debuggers/common
|
|
1168
|
+
* @docname PauseTriggerOptions
|
|
364
1169
|
*/
|
|
365
1170
|
export interface PauseTriggerOptions {
|
|
366
1171
|
/**
|
|
@@ -384,6 +1189,9 @@ export interface PauseTriggerOptions {
|
|
|
384
1189
|
}
|
|
385
1190
|
/**
|
|
386
1191
|
* Defines an interface that represents a pause trigger.
|
|
1192
|
+
*
|
|
1193
|
+
* @dochash types/debuggers/common
|
|
1194
|
+
* @docname PauseTrigger
|
|
387
1195
|
*/
|
|
388
1196
|
export interface PauseTrigger extends PauseTriggerOptions {
|
|
389
1197
|
/**
|
|
@@ -401,6 +1209,8 @@ export interface PauseTrigger extends PauseTriggerOptions {
|
|
|
401
1209
|
}
|
|
402
1210
|
/**
|
|
403
1211
|
* Defines an interface that contains information about the current debugger pause state.
|
|
1212
|
+
* @dochash types/debuggers/common
|
|
1213
|
+
* @docname DebuggerPause
|
|
404
1214
|
*/
|
|
405
1215
|
export interface DebuggerPause {
|
|
406
1216
|
/**
|
|
@@ -427,6 +1237,9 @@ export interface DebuggerPause {
|
|
|
427
1237
|
}
|
|
428
1238
|
/**
|
|
429
1239
|
* Defines an interface that contains information about a single call stack frame.
|
|
1240
|
+
*
|
|
1241
|
+
* @dochash types/debuggers/common
|
|
1242
|
+
* @docname DebuggerCallFrame
|
|
430
1243
|
*/
|
|
431
1244
|
export interface DebuggerCallFrame {
|
|
432
1245
|
/**
|
|
@@ -446,6 +1259,9 @@ export interface DebuggerCallFrame {
|
|
|
446
1259
|
}
|
|
447
1260
|
/**
|
|
448
1261
|
* Defines an interface that represents a location in a debugger.
|
|
1262
|
+
*
|
|
1263
|
+
* @dochash types/debuggers/common
|
|
1264
|
+
* @docname DebuggerFunctionLocation
|
|
449
1265
|
*/
|
|
450
1266
|
export interface DebuggerFunctionLocation {
|
|
451
1267
|
/**
|
|
@@ -471,6 +1287,9 @@ export interface DebuggerFunctionLocation {
|
|
|
471
1287
|
}
|
|
472
1288
|
/**
|
|
473
1289
|
* Defines an interface that represents a debugger variable.
|
|
1290
|
+
*
|
|
1291
|
+
* @dochash types/debuggers/common
|
|
1292
|
+
* @docname DebuggerVariable
|
|
474
1293
|
*/
|
|
475
1294
|
export interface DebuggerVariable {
|
|
476
1295
|
/**
|
|
@@ -500,6 +1319,9 @@ export interface DebuggerVariable {
|
|
|
500
1319
|
}
|
|
501
1320
|
/**
|
|
502
1321
|
* Defines an interface for a random number generator.
|
|
1322
|
+
*
|
|
1323
|
+
* @dochash types/core
|
|
1324
|
+
* @docname PseudoRandomNumberGenerator
|
|
503
1325
|
*/
|
|
504
1326
|
export interface PseudoRandomNumberGenerator {
|
|
505
1327
|
/**
|
|
@@ -536,6 +1358,9 @@ export interface WebhookInterface extends MaskableFunction {
|
|
|
536
1358
|
}
|
|
537
1359
|
/**
|
|
538
1360
|
* Defines an interface that represents the result of a webhook.
|
|
1361
|
+
*
|
|
1362
|
+
* @dochash types/web
|
|
1363
|
+
* @docname WebhookResult
|
|
539
1364
|
*/
|
|
540
1365
|
export interface WebhookResult {
|
|
541
1366
|
/**
|
|
@@ -550,12 +1375,30 @@ export interface WebhookResult {
|
|
|
550
1375
|
/**
|
|
551
1376
|
* The HTTP Headers that were included in the response.
|
|
552
1377
|
* See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers for more information.
|
|
1378
|
+
*
|
|
1379
|
+
* @docsource Headers
|
|
553
1380
|
*/
|
|
554
1381
|
headers: {
|
|
555
1382
|
[name: string]: string;
|
|
556
1383
|
};
|
|
557
1384
|
}
|
|
1385
|
+
/**
|
|
1386
|
+
* Defines the possible results of a "record file" request.
|
|
1387
|
+
*
|
|
1388
|
+
* @dochash types/records/files
|
|
1389
|
+
* @docgroup 01-create
|
|
1390
|
+
* @docorder 1
|
|
1391
|
+
* @docname RecordFileResult
|
|
1392
|
+
*/
|
|
558
1393
|
export type RecordFileApiResult = RecordFileApiSuccess | RecordFileApiFailure;
|
|
1394
|
+
/**
|
|
1395
|
+
* Defines an interface that represents a successful "record file" request.
|
|
1396
|
+
*
|
|
1397
|
+
* @dochash types/records/files
|
|
1398
|
+
* @docgroup 01-create
|
|
1399
|
+
* @docorder 2
|
|
1400
|
+
* @docname RecordFileSuccess
|
|
1401
|
+
*/
|
|
559
1402
|
export interface RecordFileApiSuccess {
|
|
560
1403
|
success: true;
|
|
561
1404
|
/**
|
|
@@ -568,11 +1411,38 @@ export interface RecordFileApiSuccess {
|
|
|
568
1411
|
*/
|
|
569
1412
|
sha256Hash: string;
|
|
570
1413
|
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Defines an interface that represents a failed "record file" request.
|
|
1416
|
+
*
|
|
1417
|
+
* @dochash types/records/files
|
|
1418
|
+
* @doctitle File Types
|
|
1419
|
+
* @docsidebar Files
|
|
1420
|
+
* @docdescription File types are used for uploading and downloading files.
|
|
1421
|
+
* @docgroup 01-create
|
|
1422
|
+
* @docorder 3
|
|
1423
|
+
* @docname RecordFileFailure
|
|
1424
|
+
*/
|
|
571
1425
|
export interface RecordFileApiFailure {
|
|
572
1426
|
success: false;
|
|
1427
|
+
/**
|
|
1428
|
+
* The error code that describes why the request failed.
|
|
1429
|
+
*/
|
|
573
1430
|
errorCode: RecordFileFailure['errorCode'] | 'file_already_exists' | 'invalid_file_data';
|
|
1431
|
+
/**
|
|
1432
|
+
* The error message that describes why the request failed.
|
|
1433
|
+
*/
|
|
574
1434
|
errorMessage: string;
|
|
1435
|
+
/**
|
|
1436
|
+
* The URL that the file is available at if it has already been uploaded.
|
|
1437
|
+
*/
|
|
1438
|
+
existingFileUrl?: string;
|
|
575
1439
|
}
|
|
1440
|
+
/**
|
|
1441
|
+
* Defines an interface that contains options for a snap grid for {@link os.addDropGrid}.
|
|
1442
|
+
*
|
|
1443
|
+
* @dochash types/os
|
|
1444
|
+
* @docname SnapGridTarget
|
|
1445
|
+
*/
|
|
576
1446
|
export interface SnapGridTarget {
|
|
577
1447
|
/**
|
|
578
1448
|
* The 3D position that the grid should appear at.
|
|
@@ -627,90 +1497,324 @@ export interface SnapGridTarget {
|
|
|
627
1497
|
*/
|
|
628
1498
|
type?: 'grid' | 'sphere';
|
|
629
1499
|
}
|
|
1500
|
+
/**
|
|
1501
|
+
* The possible results for a "join room" request.
|
|
1502
|
+
*
|
|
1503
|
+
* @dochash types/os
|
|
1504
|
+
* @docname JoinRoomResult
|
|
1505
|
+
*/
|
|
630
1506
|
export type JoinRoomResult = JoinRoomSuccess | JoinRoomFailure;
|
|
1507
|
+
/**
|
|
1508
|
+
* Defines an interface that represents a successful "join room" request.
|
|
1509
|
+
*
|
|
1510
|
+
* @dochash types/os
|
|
1511
|
+
* @docname JoinRoomSuccess
|
|
1512
|
+
*/
|
|
631
1513
|
export interface JoinRoomSuccess {
|
|
632
1514
|
success: true;
|
|
1515
|
+
/**
|
|
1516
|
+
* The name of the room that was joined.
|
|
1517
|
+
*/
|
|
633
1518
|
roomName: string;
|
|
634
1519
|
}
|
|
1520
|
+
/**
|
|
1521
|
+
* Defines an interface that represents a failed "join room" request.
|
|
1522
|
+
*
|
|
1523
|
+
* @dochash types/os
|
|
1524
|
+
* @docname JoinRoomFailure
|
|
1525
|
+
*/
|
|
635
1526
|
export interface JoinRoomFailure {
|
|
636
1527
|
success: false;
|
|
1528
|
+
/**
|
|
1529
|
+
* The name of the room that was attempted to be joined.
|
|
1530
|
+
*/
|
|
637
1531
|
roomName: string;
|
|
1532
|
+
/**
|
|
1533
|
+
* The error code that describes why the request failed.
|
|
1534
|
+
*/
|
|
638
1535
|
errorCode: string;
|
|
1536
|
+
/**
|
|
1537
|
+
* The error message that describes why the request failed.
|
|
1538
|
+
*/
|
|
639
1539
|
errorMessage: string;
|
|
640
1540
|
}
|
|
1541
|
+
/**
|
|
1542
|
+
* The possible results for a "leave room" request.
|
|
1543
|
+
*
|
|
1544
|
+
* @dochash types/os
|
|
1545
|
+
* @docname LeaveRoomResult
|
|
1546
|
+
*/
|
|
641
1547
|
export type LeaveRoomResult = LeaveRoomSuccess | LeaveRoomFailure;
|
|
1548
|
+
/**
|
|
1549
|
+
* Defines an interface that represents a successful "leave room" request.
|
|
1550
|
+
*
|
|
1551
|
+
* @dochash types/os
|
|
1552
|
+
* @docname LeaveRoomSuccess
|
|
1553
|
+
*/
|
|
642
1554
|
export interface LeaveRoomSuccess {
|
|
643
1555
|
success: true;
|
|
1556
|
+
/**
|
|
1557
|
+
* The name of the room that was left.
|
|
1558
|
+
*/
|
|
644
1559
|
roomName: string;
|
|
645
1560
|
}
|
|
1561
|
+
/**
|
|
1562
|
+
* Defines an interface that represents a failed "leave room" request.
|
|
1563
|
+
*
|
|
1564
|
+
* @dochash types/os
|
|
1565
|
+
* @docname LeaveRoomFailure
|
|
1566
|
+
*/
|
|
646
1567
|
export interface LeaveRoomFailure {
|
|
647
1568
|
success: false;
|
|
1569
|
+
/**
|
|
1570
|
+
* The name of the room that was attempted to be left.
|
|
1571
|
+
*/
|
|
648
1572
|
roomName: string;
|
|
1573
|
+
/**
|
|
1574
|
+
* The error code that describes why the request failed.
|
|
1575
|
+
*/
|
|
649
1576
|
errorCode: string;
|
|
1577
|
+
/**
|
|
1578
|
+
* The error message that describes why the request failed.
|
|
1579
|
+
*/
|
|
650
1580
|
errorMessage: string;
|
|
651
1581
|
}
|
|
1582
|
+
/**
|
|
1583
|
+
* The possible results for a "set room options" request.
|
|
1584
|
+
*
|
|
1585
|
+
* @dochash types/os
|
|
1586
|
+
* @docname SetRoomOptionsResult
|
|
1587
|
+
*/
|
|
652
1588
|
export type SetRoomOptionsResult = SetRoomOptionsSuccess | SetRoomOptionsFailure;
|
|
1589
|
+
/**
|
|
1590
|
+
* Defines an interface that represents a successful "set room options" request.
|
|
1591
|
+
*
|
|
1592
|
+
* @dochash types/os
|
|
1593
|
+
* @docname SetRoomOptionsSuccess
|
|
1594
|
+
*/
|
|
653
1595
|
export interface SetRoomOptionsSuccess {
|
|
654
1596
|
success: true;
|
|
1597
|
+
/**
|
|
1598
|
+
* The name of the room that the options were set on.
|
|
1599
|
+
*/
|
|
655
1600
|
roomName: true;
|
|
656
1601
|
}
|
|
1602
|
+
/**
|
|
1603
|
+
* Defines an interface that represents a failed "set room options" request.
|
|
1604
|
+
*/
|
|
657
1605
|
export interface SetRoomOptionsFailure {
|
|
658
1606
|
success: false;
|
|
1607
|
+
/**
|
|
1608
|
+
* The name of the room that the options were attempted to be set on.
|
|
1609
|
+
*/
|
|
659
1610
|
roomName: string;
|
|
1611
|
+
/**
|
|
1612
|
+
* The error code that describes why the request failed.
|
|
1613
|
+
*/
|
|
660
1614
|
errorCode: string;
|
|
1615
|
+
/**
|
|
1616
|
+
* The error message that describes why the request failed.
|
|
1617
|
+
*/
|
|
661
1618
|
errorMessage: string;
|
|
662
1619
|
}
|
|
1620
|
+
/**
|
|
1621
|
+
* The possible results for a "get room options" request.
|
|
1622
|
+
*
|
|
1623
|
+
* @dochash types/os
|
|
1624
|
+
* @docname GetRoomOptionsResult
|
|
1625
|
+
*/
|
|
663
1626
|
export type GetRoomOptionsResult = GetRoomOptionsSuccess | GetRoomOptionsFailure;
|
|
1627
|
+
/**
|
|
1628
|
+
* Defines an interface that represents a successful "get room options" request.
|
|
1629
|
+
*
|
|
1630
|
+
* @dochash types/os
|
|
1631
|
+
* @docname GetRoomOptionsSuccess
|
|
1632
|
+
*/
|
|
664
1633
|
export interface GetRoomOptionsSuccess {
|
|
665
1634
|
success: true;
|
|
1635
|
+
/**
|
|
1636
|
+
* The name of the room that the options were retrieved from.
|
|
1637
|
+
*/
|
|
666
1638
|
roomName: string;
|
|
1639
|
+
/**
|
|
1640
|
+
* The options that were retrieved.
|
|
1641
|
+
*/
|
|
667
1642
|
options: RoomOptions;
|
|
668
1643
|
}
|
|
1644
|
+
/**
|
|
1645
|
+
* Defines an interface that represents a failed "get room options" request.
|
|
1646
|
+
*
|
|
1647
|
+
* @dochash types/os
|
|
1648
|
+
* @docname GetRoomOptionsFailure
|
|
1649
|
+
*/
|
|
669
1650
|
export interface GetRoomOptionsFailure {
|
|
670
1651
|
success: false;
|
|
1652
|
+
/**
|
|
1653
|
+
* The error code that describes why the request failed.
|
|
1654
|
+
*/
|
|
671
1655
|
errorCode: string;
|
|
1656
|
+
/**
|
|
1657
|
+
* The error message that describes why the request failed.
|
|
1658
|
+
*/
|
|
672
1659
|
errorMessage: string;
|
|
673
1660
|
}
|
|
1661
|
+
/**
|
|
1662
|
+
* The possible results for a "get room track options" request.
|
|
1663
|
+
*
|
|
1664
|
+
* @dochash types/os
|
|
1665
|
+
* @docname GetRoomTrackOptionsResult
|
|
1666
|
+
*/
|
|
674
1667
|
export type GetRoomTrackOptionsResult = GetRoomTrackOptionsSuccess | GetRoomTrackOptionsFailure;
|
|
1668
|
+
/**
|
|
1669
|
+
* Defines an interface that represents a successful "get room track options" request.
|
|
1670
|
+
*
|
|
1671
|
+
* @dochash types/os
|
|
1672
|
+
* @docname GetRoomTrackOptionsSuccess
|
|
1673
|
+
*/
|
|
675
1674
|
export interface GetRoomTrackOptionsSuccess {
|
|
676
1675
|
success: true;
|
|
1676
|
+
/**
|
|
1677
|
+
* The name of the room that the options were retrieved from.
|
|
1678
|
+
*/
|
|
677
1679
|
roomName: string;
|
|
1680
|
+
/**
|
|
1681
|
+
* The address of the track that the options were retrieved from.
|
|
1682
|
+
*/
|
|
678
1683
|
address: string;
|
|
1684
|
+
/**
|
|
1685
|
+
* The options that were retrieved.
|
|
1686
|
+
*/
|
|
679
1687
|
options: RoomTrackOptions;
|
|
680
1688
|
}
|
|
1689
|
+
/**
|
|
1690
|
+
* Defines an interface that represents a failed "get room track options" request.
|
|
1691
|
+
*
|
|
1692
|
+
* @dochash types/os
|
|
1693
|
+
* @docname GetRoomTrackOptionsFailure
|
|
1694
|
+
*/
|
|
681
1695
|
export interface GetRoomTrackOptionsFailure {
|
|
682
1696
|
success: false;
|
|
1697
|
+
/**
|
|
1698
|
+
* The error code that describes why the request failed.
|
|
1699
|
+
*/
|
|
683
1700
|
errorCode: string;
|
|
1701
|
+
/**
|
|
1702
|
+
* The error message that describes why the request failed.
|
|
1703
|
+
*/
|
|
684
1704
|
errorMessage: string;
|
|
1705
|
+
/**
|
|
1706
|
+
* The name of the room that the options were attempted to be retrieved from.
|
|
1707
|
+
*/
|
|
685
1708
|
roomName: string;
|
|
1709
|
+
/**
|
|
1710
|
+
* The address of the track that the options were attempted to be retrieved from.
|
|
1711
|
+
*/
|
|
686
1712
|
address: string;
|
|
687
1713
|
}
|
|
1714
|
+
/**
|
|
1715
|
+
* The possible results for a "set room track options" request.
|
|
1716
|
+
*
|
|
1717
|
+
* @dochash types/os
|
|
1718
|
+
* @docname SetRoomTrackOptionsResult
|
|
1719
|
+
*/
|
|
688
1720
|
export type SetRoomTrackOptionsResult = SetRoomTrackOptionsSuccess | SetRoomTrackOptionsFailure;
|
|
1721
|
+
/**
|
|
1722
|
+
* Defines an interface that represents a successful "set room track options" request.
|
|
1723
|
+
*
|
|
1724
|
+
* @dochash types/os
|
|
1725
|
+
* @docname SetRoomTrackOptionsSuccess
|
|
1726
|
+
*/
|
|
689
1727
|
export interface SetRoomTrackOptionsSuccess {
|
|
690
1728
|
success: true;
|
|
1729
|
+
/**
|
|
1730
|
+
* The name of the room that the options were set on.
|
|
1731
|
+
*/
|
|
691
1732
|
roomName: string;
|
|
1733
|
+
/**
|
|
1734
|
+
* The address of the track that the options were set on.
|
|
1735
|
+
*/
|
|
692
1736
|
address: string;
|
|
1737
|
+
/**
|
|
1738
|
+
* The options that were set.
|
|
1739
|
+
*/
|
|
693
1740
|
options: RoomTrackOptions;
|
|
694
1741
|
}
|
|
1742
|
+
/**
|
|
1743
|
+
* Defines an interface that represents a failed "set room track options" request.
|
|
1744
|
+
*
|
|
1745
|
+
* @dochash types/os
|
|
1746
|
+
* @docname SetRoomTrackOptionsFailure
|
|
1747
|
+
*/
|
|
695
1748
|
export interface SetRoomTrackOptionsFailure {
|
|
696
1749
|
success: false;
|
|
1750
|
+
/**
|
|
1751
|
+
* The error code that describes why the request failed.
|
|
1752
|
+
*/
|
|
697
1753
|
errorCode: string;
|
|
1754
|
+
/**
|
|
1755
|
+
* The error message that describes why the request failed.
|
|
1756
|
+
*/
|
|
698
1757
|
errorMessage: string;
|
|
1758
|
+
/**
|
|
1759
|
+
* The name of the room that the options were attempted to be set on.
|
|
1760
|
+
*/
|
|
699
1761
|
roomName: string;
|
|
1762
|
+
/**
|
|
1763
|
+
* The address of the track that the options were attempted to be set on.
|
|
1764
|
+
*/
|
|
700
1765
|
address: string;
|
|
701
1766
|
}
|
|
1767
|
+
/**
|
|
1768
|
+
* The possible results for a "get room remote options" request.
|
|
1769
|
+
*
|
|
1770
|
+
* @dochash types/os
|
|
1771
|
+
* @docname GetRoomRemoteOptionsResult
|
|
1772
|
+
*/
|
|
702
1773
|
export type GetRoomRemoteOptionsResult = GetRoomRemoteOptionsSuccess | GetRoomRemoteOptionsFailure;
|
|
1774
|
+
/**
|
|
1775
|
+
* Defines an interface that represents a successful "get room remote options" request.
|
|
1776
|
+
*
|
|
1777
|
+
* @dochash types/os
|
|
1778
|
+
* @docname GetRoomRemoteOptionsSuccess
|
|
1779
|
+
*/
|
|
703
1780
|
export interface GetRoomRemoteOptionsSuccess {
|
|
704
1781
|
success: true;
|
|
1782
|
+
/**
|
|
1783
|
+
* The name of the room that the options were retrieved from.
|
|
1784
|
+
*/
|
|
705
1785
|
roomName: string;
|
|
1786
|
+
/**
|
|
1787
|
+
* The ID of the remote that the options were retrieved from.
|
|
1788
|
+
*/
|
|
706
1789
|
remoteId: string;
|
|
1790
|
+
/**
|
|
1791
|
+
* The options that were retrieved.
|
|
1792
|
+
*/
|
|
707
1793
|
options: RoomRemoteOptions;
|
|
708
1794
|
}
|
|
1795
|
+
/**
|
|
1796
|
+
* Defines an interface that represents a failed "get room remote options" request.
|
|
1797
|
+
*
|
|
1798
|
+
* @dochash types/os
|
|
1799
|
+
* @docname GetRoomRemoteOptionsFailure
|
|
1800
|
+
*/
|
|
709
1801
|
export interface GetRoomRemoteOptionsFailure {
|
|
710
1802
|
success: false;
|
|
1803
|
+
/**
|
|
1804
|
+
* The error code that describes why the request failed.
|
|
1805
|
+
*/
|
|
711
1806
|
errorCode: string;
|
|
1807
|
+
/**
|
|
1808
|
+
* The error message that describes why the request failed.
|
|
1809
|
+
*/
|
|
712
1810
|
errorMessage: string;
|
|
1811
|
+
/**
|
|
1812
|
+
* The name of the room that the options were attempted to be retrieved from.
|
|
1813
|
+
*/
|
|
713
1814
|
roomName: string;
|
|
1815
|
+
/**
|
|
1816
|
+
* The ID of the remote that the options were attempted to be retrieved from.
|
|
1817
|
+
*/
|
|
714
1818
|
remoteId: string;
|
|
715
1819
|
}
|
|
716
1820
|
/**
|
|
@@ -737,6 +1841,9 @@ export interface RecordFileOptions {
|
|
|
737
1841
|
}
|
|
738
1842
|
/**
|
|
739
1843
|
* Defines an interface that represents the result of a raycast operation.
|
|
1844
|
+
*
|
|
1845
|
+
* @dochash types/os
|
|
1846
|
+
* @docname RaycastResult
|
|
740
1847
|
*/
|
|
741
1848
|
export interface RaycastResult {
|
|
742
1849
|
/**
|
|
@@ -786,7 +1893,10 @@ export interface BotIntersection {
|
|
|
786
1893
|
dimension: string;
|
|
787
1894
|
}
|
|
788
1895
|
/**
|
|
789
|
-
* Defines an interface that represents a ray.
|
|
1896
|
+
* Defines an interface that represents a ray. That is, a line that has a start position and a direction, but no end.
|
|
1897
|
+
*
|
|
1898
|
+
* @dochash types/os
|
|
1899
|
+
* @docname RaycastRay
|
|
790
1900
|
*/
|
|
791
1901
|
export interface RaycastRay {
|
|
792
1902
|
/**
|
|
@@ -798,13 +1908,37 @@ export interface RaycastRay {
|
|
|
798
1908
|
*/
|
|
799
1909
|
direction: Vector3;
|
|
800
1910
|
}
|
|
1911
|
+
/**
|
|
1912
|
+
* Defines an interface that represents a file that was uploaded.
|
|
1913
|
+
*
|
|
1914
|
+
* @dochash types/os
|
|
1915
|
+
* @docname UploadedFile
|
|
1916
|
+
*/
|
|
1917
|
+
export interface UploadedFile {
|
|
1918
|
+
/**
|
|
1919
|
+
* The name of the file that was uploaded.
|
|
1920
|
+
*/
|
|
1921
|
+
name: string;
|
|
1922
|
+
/**
|
|
1923
|
+
* The size of the file in bytes.
|
|
1924
|
+
*/
|
|
1925
|
+
size: number;
|
|
1926
|
+
/**
|
|
1927
|
+
* The data that the file contains.
|
|
1928
|
+
*/
|
|
1929
|
+
data: string | ArrayBuffer;
|
|
1930
|
+
}
|
|
801
1931
|
/**
|
|
802
1932
|
* Creates a library that includes the default functions and APIs.
|
|
803
1933
|
* @param context The global context that should be used.
|
|
804
1934
|
*/
|
|
805
1935
|
export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
806
1936
|
api: {
|
|
807
|
-
|
|
1937
|
+
_getBots: (...filters: BotFilter[]) => RuntimeBot[];
|
|
1938
|
+
__getBots: (tag: string, value?: any) => RuntimeBot[];
|
|
1939
|
+
getBots: (...filters: any[]) => RuntimeBot[];
|
|
1940
|
+
_getBot: (...filters: BotFilter[]) => RuntimeBot;
|
|
1941
|
+
__getBot: (tag: string, value?: any) => RuntimeBot;
|
|
808
1942
|
getBot: (...args: any[]) => RuntimeBot;
|
|
809
1943
|
getBotTagValues: (tag: string, filter?: TagFilter) => any[];
|
|
810
1944
|
getMod: (bot: any, ...tags: (string | RegExp)[]) => Mod;
|
|
@@ -826,32 +1960,50 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
826
1960
|
deleteTagMaskText: (bot: RuntimeBot, tag: string, index: number, count: number, space?: string) => string;
|
|
827
1961
|
removeTags: (bot: Bot | Bot[], tagSection: string | RegExp) => void;
|
|
828
1962
|
renameTag: (bot: Bot | Bot[], originalTag: string, newTag: string) => void;
|
|
829
|
-
applyMod: (bot: any, ...
|
|
830
|
-
subtractMods: (bot: any, ...
|
|
1963
|
+
applyMod: (bot: any, ...mods: Mod[]) => void;
|
|
1964
|
+
subtractMods: (bot: any, ...mods: Mod[]) => void;
|
|
1965
|
+
_create: (...mods: Mod[]) => RuntimeBot | RuntimeBot[];
|
|
1966
|
+
_destroy: (bot: string | Bot | string[] | Bot[]) => void;
|
|
831
1967
|
destroy: {
|
|
832
1968
|
(bot: string | Bot | RuntimeBot | (string | Bot | RuntimeBot)[]): void;
|
|
833
1969
|
[INTERPRETABLE_FUNCTION]: (bot: string | Bot | RuntimeBot | (string | Bot | RuntimeBot)[]) => Generator<any, void, any>;
|
|
834
1970
|
};
|
|
1971
|
+
_changeState: (bot: Bot, stateName: string, groupName?: string) => void;
|
|
835
1972
|
changeState: {
|
|
836
1973
|
(bot: Bot, stateName: string, groupName?: string): void;
|
|
837
1974
|
[INTERPRETABLE_FUNCTION]: (bot: Bot, stateName: string, groupName?: string) => Generator<any, void, any>;
|
|
838
1975
|
};
|
|
839
1976
|
getLink: (...bots: (Bot | string | (Bot | string)[])[]) => string;
|
|
840
1977
|
getBotLinks: (bot: Bot) => ParsedBotLink[];
|
|
1978
|
+
_updateBotLinks: (bot: Bot, idMap: object) => void;
|
|
841
1979
|
updateBotLinks: (bot: Bot, idMap: Map<string, string | Bot> | {
|
|
842
1980
|
[id: string]: string | Bot;
|
|
843
1981
|
}) => void;
|
|
844
1982
|
getDateTime: (value: unknown) => DateTime;
|
|
845
1983
|
DateTime: typeof DateTime;
|
|
1984
|
+
/**
|
|
1985
|
+
* @hidden
|
|
1986
|
+
*/
|
|
846
1987
|
Vector2: typeof Vector2;
|
|
1988
|
+
/**
|
|
1989
|
+
* @hidden
|
|
1990
|
+
*/
|
|
847
1991
|
Vector3: typeof Vector3;
|
|
1992
|
+
/**
|
|
1993
|
+
* @hidden
|
|
1994
|
+
*/
|
|
848
1995
|
Quaternion: typeof Quaternion;
|
|
1996
|
+
/**
|
|
1997
|
+
* @hidden
|
|
1998
|
+
*/
|
|
849
1999
|
Rotation: typeof Rotation;
|
|
850
2000
|
superShout: (eventName: string, arg?: any) => SuperShoutAction;
|
|
2001
|
+
_priorityShout: (eventNames: string[], arg?: any) => any;
|
|
851
2002
|
priorityShout: {
|
|
852
2003
|
(eventNames: string[], arg?: any): any;
|
|
853
2004
|
[INTERPRETABLE_FUNCTION]: (eventNames: string[], arg?: any) => Generator<any, any, any>;
|
|
854
2005
|
};
|
|
2006
|
+
_shout: (name: string, arg?: any) => any;
|
|
855
2007
|
shout: {
|
|
856
2008
|
(name: string, arg?: any): any[];
|
|
857
2009
|
[name: string]: (arg?: any) => any[];
|
|
@@ -861,33 +2013,42 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
861
2013
|
[name: string]: (arg?: any) => Generator<any, any[], any>;
|
|
862
2014
|
};
|
|
863
2015
|
};
|
|
2016
|
+
_whisper: (bot: (Bot | string)[] | Bot | string, eventName: string, arg?: any) => any;
|
|
864
2017
|
whisper: {
|
|
865
2018
|
(bot: string | Bot | (string | Bot)[], eventName: string, arg?: any): any[];
|
|
866
2019
|
[INTERPRETABLE_FUNCTION]: (bot: string | Bot | (string | Bot)[], eventName: string, arg?: any) => Generator<any, any[], any>;
|
|
867
2020
|
};
|
|
868
|
-
byTag: (tag: string, filter?: TagFilter) =>
|
|
869
|
-
byID: (id: string) =>
|
|
870
|
-
byMod: (mod: Mod) =>
|
|
871
|
-
inDimension: (dimension: string) =>
|
|
872
|
-
atPosition: (dimension: string, x: number, y: number) =>
|
|
873
|
-
inStack: (bot: Bot, dimension: string) =>
|
|
874
|
-
neighboring: (bot: Bot, dimension: string, direction?: 'front' | 'left' | 'right' | 'back') =>
|
|
875
|
-
bySpace: (space: string) =>
|
|
876
|
-
byCreator: (bot: Bot | string) =>
|
|
877
|
-
either: (...filters:
|
|
878
|
-
not: (filter:
|
|
879
|
-
remote: (
|
|
2021
|
+
byTag: (tag: string, filter?: TagFilter) => BotFilter;
|
|
2022
|
+
byID: (id: string) => BotFilter;
|
|
2023
|
+
byMod: (mod: Mod) => BotFilter;
|
|
2024
|
+
inDimension: (dimension: string) => BotFilter;
|
|
2025
|
+
atPosition: (dimension: string, x: number, y: number) => BotFilter;
|
|
2026
|
+
inStack: (bot: Bot, dimension: string) => BotFilter;
|
|
2027
|
+
neighboring: (bot: Bot, dimension: string, direction?: 'front' | 'left' | 'right' | 'back') => BotFilter;
|
|
2028
|
+
bySpace: (space: string) => BotFilter;
|
|
2029
|
+
byCreator: (bot: Bot | string) => BotFilter;
|
|
2030
|
+
either: (...filters: BotFilter[]) => BotFilter;
|
|
2031
|
+
not: (filter: BotFilter) => BotFilter;
|
|
2032
|
+
remote: (action: BotAction, selector?: SessionSelector | string | (SessionSelector | string)[], allowBatching?: boolean) => RemoteAction | RemoteAction[];
|
|
880
2033
|
sendRemoteData: (remoteId: string | string[], name: string, arg?: any) => RemoteAction | RemoteAction[];
|
|
881
2034
|
remoteWhisper: (remoteId: string | string[], name: string, arg?: any) => RemoteAction | RemoteAction[];
|
|
882
2035
|
remoteShout: (name: string, arg?: any) => RemoteAction | RemoteAction[];
|
|
883
2036
|
uuid: () => string;
|
|
2037
|
+
_animateTag: (bot: RuntimeBot | string | (RuntimeBot | string)[], tag: string, options: AnimateTagFunctionOptions) => Promise<void>;
|
|
2038
|
+
__animateTag: (bot: RuntimeBot | string | (RuntimeBot | string)[], options: AnimateTagFunctionOptions) => Promise<void>;
|
|
884
2039
|
animateTag: {
|
|
885
2040
|
(bot: RuntimeBot | (RuntimeBot | string)[] | string, tag: string, options: AnimateTagFunctionOptions): Promise<void>;
|
|
886
2041
|
(bot: RuntimeBot | (RuntimeBot | string)[] | string, options: AnimateTagFunctionOptions): Promise<void>;
|
|
887
2042
|
};
|
|
888
2043
|
clearAnimations: (bot: RuntimeBot | (RuntimeBot | string)[] | string, tag?: string | string[]) => void;
|
|
889
2044
|
webhook: WebhookInterface;
|
|
2045
|
+
/**
|
|
2046
|
+
* @hidden
|
|
2047
|
+
*/
|
|
890
2048
|
sleep: (time: number) => Promise<void>;
|
|
2049
|
+
/**
|
|
2050
|
+
* @hidden
|
|
2051
|
+
*/
|
|
891
2052
|
__energyCheck: () => void;
|
|
892
2053
|
clearTimeout: (id: number) => void;
|
|
893
2054
|
clearInterval: (id: number) => void;
|
|
@@ -897,6 +2058,26 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
897
2058
|
assertEqual: (first: any, second: any) => void;
|
|
898
2059
|
expect: import("@casual-simulation/expect/src/types").Expect<import("@casual-simulation/expect/src/types").MatcherState>;
|
|
899
2060
|
html: HtmlFunction;
|
|
2061
|
+
/**
|
|
2062
|
+
* Gets the config bot (formerly known as the player bot).
|
|
2063
|
+
* This is the bot that represents the player's browser tab.
|
|
2064
|
+
*
|
|
2065
|
+
* It is `tempLocal` and is used to configure various portals.
|
|
2066
|
+
*
|
|
2067
|
+
* @example Get the config bot and set a username on it.
|
|
2068
|
+
* configBot.tags.username = "bob";
|
|
2069
|
+
*
|
|
2070
|
+
* @example Open the sheetPortal to "testDimension".
|
|
2071
|
+
* configBot.tags.sheetPortal = "testDimension";
|
|
2072
|
+
*
|
|
2073
|
+
* @dochash actions/os
|
|
2074
|
+
* @doctitle OS Actions
|
|
2075
|
+
* @docsidebar OS
|
|
2076
|
+
* @docdescription OS actions are used to interact with the player's current session.
|
|
2077
|
+
* @docname configBot
|
|
2078
|
+
* @docgroup 01-os
|
|
2079
|
+
*/
|
|
2080
|
+
readonly _configBot: RuntimeBot;
|
|
900
2081
|
os: {
|
|
901
2082
|
[x: symbol]: boolean;
|
|
902
2083
|
sleep: (time: number) => Promise<void>;
|
|
@@ -911,11 +2092,19 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
911
2092
|
setClipboard: (text: string) => SetClipboardAction;
|
|
912
2093
|
tweenTo: (bot: Bot | string, zoomValue?: number, rotX?: number, rotY?: number, duration?: number) => FocusOnBotAction;
|
|
913
2094
|
moveTo: (bot: Bot | string, zoomValue?: number, rotX?: number, rotY?: number) => FocusOnBotAction;
|
|
2095
|
+
_focusOn_bot: (bot: Bot | string, options?: FocusOnOptions) => Promise<void>;
|
|
2096
|
+
_focusOn_position: (position: {
|
|
2097
|
+
x: number;
|
|
2098
|
+
y: number;
|
|
2099
|
+
z?: number;
|
|
2100
|
+
}, options?: FocusOnOptions) => Promise<void>;
|
|
914
2101
|
focusOn: (botOrPosition: Bot | string | {
|
|
915
2102
|
x: number;
|
|
916
2103
|
y: number;
|
|
917
2104
|
z?: number;
|
|
918
2105
|
}, options?: FocusOnOptions) => Promise<void>;
|
|
2106
|
+
_showChat_placeholder: (placeholder?: string) => void;
|
|
2107
|
+
_showChat_options: (options?: ShowChatOptions) => void;
|
|
919
2108
|
showChat: (placeholderOrOptions?: string | ShowChatOptions) => ShowChatBarAction;
|
|
920
2109
|
hideChat: () => ShowChatBarAction;
|
|
921
2110
|
run: (script: string) => Promise<any>;
|
|
@@ -927,8 +2116,8 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
927
2116
|
disableAR: () => EnableARAction;
|
|
928
2117
|
enableVR: (options?: EnableXROptions) => EnableVRAction;
|
|
929
2118
|
disableVR: () => EnableVRAction;
|
|
930
|
-
arSupported: () => Promise<
|
|
931
|
-
vrSupported: () => Promise<
|
|
2119
|
+
arSupported: () => Promise<boolean>;
|
|
2120
|
+
vrSupported: () => Promise<boolean>;
|
|
932
2121
|
enablePointOfView: (center?: {
|
|
933
2122
|
x: number;
|
|
934
2123
|
y: number;
|
|
@@ -944,7 +2133,7 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
944
2133
|
downloadServer: () => DownloadAction;
|
|
945
2134
|
downloadInst: () => DownloadAction;
|
|
946
2135
|
showUploadAuxFile: () => ShowUploadAuxFileAction;
|
|
947
|
-
showUploadFiles: () => Promise<
|
|
2136
|
+
showUploadFiles: () => Promise<UploadedFile[]>;
|
|
948
2137
|
openQRCodeScanner: (camera?: CameraType) => OpenQRCodeScannerAction;
|
|
949
2138
|
closeQRCodeScanner: () => OpenQRCodeScannerAction;
|
|
950
2139
|
showQRCode: (code: string) => ShowQRCodeAction;
|
|
@@ -955,30 +2144,76 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
955
2144
|
hideBarcode: () => ShowBarcodeAction;
|
|
956
2145
|
openImageClassifier: (options: ImageClassifierOptions) => Promise<void>;
|
|
957
2146
|
closeImageClassifier: () => Promise<void>;
|
|
2147
|
+
openPhotoCamera: (options?: OpenPhotoCameraOptions) => Promise<void>;
|
|
2148
|
+
capturePhoto: (options?: OpenPhotoCameraOptions) => Promise<Photo>;
|
|
2149
|
+
closePhotoCamera: () => Promise<void>;
|
|
958
2150
|
/**
|
|
959
|
-
* Gets the local
|
|
2151
|
+
* Gets the device-local time as the number of miliseconds since midnight January 1st, 1970 UTC-0 (i.e. the Unix Epoch). This is what your device's clock thinks the current time is.
|
|
2152
|
+
*
|
|
2153
|
+
* @example Toast the number of miliseconds since the Unix Epoch
|
|
2154
|
+
* os.toast(os.localTime);
|
|
2155
|
+
*
|
|
2156
|
+
* @dochash actions/time
|
|
2157
|
+
* @doctitle Time Actions
|
|
2158
|
+
* @docsidebar Time
|
|
2159
|
+
* @docdescription Time actions make working with time across devices easy.
|
|
2160
|
+
* @docgroup 01-time
|
|
2161
|
+
* @docname os.localTime
|
|
960
2162
|
*/
|
|
961
2163
|
readonly localTime: number;
|
|
962
2164
|
/**
|
|
963
|
-
* Gets the
|
|
2165
|
+
* Gets the shared time that has been agreed upon between devices in the inst as the number of miliseconds since midnight January 1st, 1970 UTC-0 (i.e. the Unix Epoch).
|
|
2166
|
+
* This is what your device's clock thinks the inst clock says.
|
|
2167
|
+
*
|
|
2168
|
+
* If an agreed upon time cannot be determined (for example, because collaboration is disabled in the inst), then this value will always be `NaN`.
|
|
2169
|
+
*
|
|
2170
|
+
* @example Toast the current shared time
|
|
2171
|
+
* os.toast(os.agreedUponTime);
|
|
2172
|
+
*
|
|
2173
|
+
* @dochash actions/time
|
|
2174
|
+
* @docgroup 01-time
|
|
2175
|
+
* @docname os.agreedUponTime
|
|
964
2176
|
*/
|
|
965
2177
|
readonly agreedUponTime: number;
|
|
966
2178
|
/**
|
|
967
|
-
* Gets the
|
|
2179
|
+
* Gets the average latency between this device's clock and the inst clock in miliseconds. Lower values tend to indicate a good connection while higher values tend to indicate a bad connection.
|
|
2180
|
+
*
|
|
2181
|
+
* If an agreed upon time cannot be determined (for example, because collaboration is disabled in the inst), then this value will always be `NaN`.
|
|
2182
|
+
*
|
|
2183
|
+
* @dochash actions/time
|
|
2184
|
+
* @docgroup 01-time
|
|
2185
|
+
* @docname os.instLatency
|
|
968
2186
|
*/
|
|
969
2187
|
readonly instLatency: number;
|
|
970
2188
|
/**
|
|
971
|
-
* Gets the calculated time offset between
|
|
2189
|
+
* Gets the calculated time offset between the inst clock and the local clock. This value is equivalent to `os.agreedUponTime - os.localTime`.
|
|
2190
|
+
*
|
|
2191
|
+
* If an agreed upon time cannot be determined (for example, because collaboration is disabled in the inst), then this value will always be `NaN`.
|
|
2192
|
+
*
|
|
2193
|
+
* @dochash actions/time
|
|
2194
|
+
* @docgroup 01-time
|
|
2195
|
+
* @docname os.instTimeOffset
|
|
972
2196
|
*/
|
|
973
2197
|
readonly instTimeOffset: number;
|
|
974
2198
|
/**
|
|
975
|
-
* Gets the
|
|
976
|
-
*
|
|
2199
|
+
* Gets the spread between calculated time offsets. Higher values indicate that {@link os.agreedUponTime} is less accurate. Lower values indicate that {@link os.agreedUponTime} is more accurate.
|
|
2200
|
+
*
|
|
2201
|
+
* If an agreed upon time cannot be determined (for example, because collaboration is disabled in the inst), then this value will always be `NaN`.
|
|
2202
|
+
*
|
|
2203
|
+
* @dochash actions/time
|
|
2204
|
+
* @docgroup 01-time
|
|
2205
|
+
* @docname os.instTimeOffsetSpread
|
|
977
2206
|
*/
|
|
978
2207
|
readonly instTimeOffsetSpread: number;
|
|
979
2208
|
/**
|
|
980
|
-
* Gets the
|
|
981
|
-
* changes/events will
|
|
2209
|
+
* Gets the shared time that has been agreed upon between devices but with an additional 50ms offset added.
|
|
2210
|
+
* This offset attempts to ensure that changes/events will be recieved by all connected devices by the time it occurs, thereby making synchronized actions easier to perform.
|
|
2211
|
+
*
|
|
2212
|
+
* If an agreed upon time cannot be determined (for example, because collaboration is disabled in the inst), then this value will always be `NaN`.
|
|
2213
|
+
*
|
|
2214
|
+
* @dochash actions/time
|
|
2215
|
+
* @docgroup 01-time
|
|
2216
|
+
* @docname os.deadReckoningTime
|
|
982
2217
|
*/
|
|
983
2218
|
readonly deadReckoningTime: number;
|
|
984
2219
|
loadServer: (id: string) => LoadServerAction;
|
|
@@ -987,7 +2222,7 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
987
2222
|
unloadInst: (id: string) => UnloadServerAction;
|
|
988
2223
|
importAUX: (urlOrJSON: string) => Promise<void>;
|
|
989
2224
|
parseBotsFromData: (jsonOrPdf: string | ArrayBuffer) => Bot[];
|
|
990
|
-
replaceDragBot: (bot:
|
|
2225
|
+
replaceDragBot: (bot: RuntimeBot) => ReplaceDragBotAction;
|
|
991
2226
|
isInDimension: (dimension: string) => boolean;
|
|
992
2227
|
getCurrentDimension: () => string;
|
|
993
2228
|
getCurrentServer: () => string;
|
|
@@ -997,6 +2232,7 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
997
2232
|
getPortalDimension: (portal: PortalType) => string;
|
|
998
2233
|
getDimensionalDepth: (dimension: string) => number;
|
|
999
2234
|
showInputForTag: (bot: Bot | string, tag: string, options?: Partial<ShowInputOptions>) => ShowInputForTagAction;
|
|
2235
|
+
_showInput: (currentValue?: any, options?: Partial<ShowInputOptions>) => Promise<any>;
|
|
1000
2236
|
showInput: ((currentValue?: any, options?: Partial<ShowInputOptions>) => Promise<any>) & MaskableFunction;
|
|
1001
2237
|
showConfirm: (options: ShowConfirmOptions) => Promise<boolean>;
|
|
1002
2238
|
goToDimension: (dimension: string) => GoToDimensionAction;
|
|
@@ -1046,8 +2282,8 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1046
2282
|
getRoomRemoteOptions: (roomName: string, remoteId: string) => Promise<GetRoomRemoteOptionsResult>;
|
|
1047
2283
|
registerTagPrefix: (prefix: string, options?: RegisterPrefixOptions) => Promise<void>;
|
|
1048
2284
|
registerApp: (portalId: string, bot: Bot | string) => Promise<void>;
|
|
1049
|
-
unregisterApp: (
|
|
1050
|
-
compileApp: (
|
|
2285
|
+
unregisterApp: (appId: string) => Promise<void>;
|
|
2286
|
+
compileApp: (appId: string, content: any) => SetAppOutputAction;
|
|
1051
2287
|
appHooks: {
|
|
1052
2288
|
render: typeof render;
|
|
1053
2289
|
useState<S>(initialState: S | (() => S)): [S, hooks.StateUpdater<S>];
|
|
@@ -1070,26 +2306,22 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1070
2306
|
requestAuthBot: () => Promise<Bot>;
|
|
1071
2307
|
getPublicRecordKey: (name: string) => Promise<CreatePublicRecordKeyResult>;
|
|
1072
2308
|
getSubjectlessPublicRecordKey: (name: string) => Promise<CreatePublicRecordKeyResult>;
|
|
1073
|
-
grantRecordMarkerPermission: (recordName: string, marker: string, permission:
|
|
1074
|
-
revokeRecordMarkerPermission: (recordName: string, marker: string, permission:
|
|
2309
|
+
grantRecordMarkerPermission: (recordName: string, marker: string, permission: AvailablePermissions, options?: RecordActionOptions) => Promise<GrantMarkerPermissionResult>;
|
|
2310
|
+
revokeRecordMarkerPermission: (recordName: string, marker: string, permission: AvailablePermissions, options?: RecordActionOptions) => Promise<RevokeMarkerPermissionResult>;
|
|
1075
2311
|
grantInstAdminPermission: (recordName: string, options?: RecordActionOptions) => Promise<GrantRoleResult>;
|
|
1076
2312
|
grantUserRole: (recordName: string, role: string, userId: string, expireTimeMs?: number, options?: RecordActionOptions) => Promise<GrantRoleResult>;
|
|
1077
2313
|
revokeUserRole: (recordName: string, role: string, userId: string, options?: RecordActionOptions) => Promise<RevokeRoleResult>;
|
|
1078
2314
|
grantInstRole: (recordName: string, role: string, inst: string, expireTimeMs?: number, options?: RecordActionOptions) => Promise<GrantRoleResult>;
|
|
1079
2315
|
revokeInstRole: (recordName: string, role: string, inst: string, options?: RecordActionOptions) => Promise<RevokeRoleResult>;
|
|
1080
2316
|
isRecordKey: (key: unknown) => boolean;
|
|
1081
|
-
recordData: (
|
|
1082
|
-
|
|
1083
|
-
})) => Promise<RecordDataResult>;
|
|
1084
|
-
recordManualApprovalData: (recordKey: string, address: string, data: any, endpointOrOptions?: string | (DataRecordOptions & {
|
|
1085
|
-
marker?: string;
|
|
1086
|
-
})) => Promise<RecordDataResult>;
|
|
2317
|
+
recordData: (recordKeyOrRecordName: string, address: string, data: any, endpointOrOptions?: string | DataRecordOptions) => Promise<RecordDataResult>;
|
|
2318
|
+
recordManualApprovalData: (recordKeyOrRecordName: string, address: string, data: any, endpointOrOptions?: string | DataRecordOptions) => Promise<RecordDataResult>;
|
|
1087
2319
|
getData: (recordKeyOrName: string, address: string, endpoint?: string) => Promise<GetDataResult>;
|
|
1088
2320
|
getManualApprovalData: (recordKeyOrName: string, address: string, endpoint?: string) => Promise<GetDataResult>;
|
|
1089
2321
|
listData: (recordKeyOrName: string, startingAddress?: string, endpoint?: string) => Promise<ListDataResult>;
|
|
1090
|
-
eraseData: (
|
|
1091
|
-
eraseManualApprovalData: (
|
|
1092
|
-
recordFile: (
|
|
2322
|
+
eraseData: (recordKeyOrName: string, address: string, endpoint?: string) => Promise<EraseDataResult>;
|
|
2323
|
+
eraseManualApprovalData: (recordKeyOrName: string, address: string, endpoint?: string) => Promise<EraseDataResult>;
|
|
2324
|
+
recordFile: (recordKeyOrName: string, data: any, options?: RecordFileOptions, endpoint?: string) => Promise<RecordFileApiResult>;
|
|
1093
2325
|
getFile: {
|
|
1094
2326
|
(result: RecordFileApiSuccess, endpoint?: string): Promise<any>;
|
|
1095
2327
|
(url: string, endpoint?: string): Promise<any>;
|
|
@@ -1103,10 +2335,10 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1103
2335
|
(url: string, endpoint?: string): Promise<any>;
|
|
1104
2336
|
};
|
|
1105
2337
|
eraseFile: {
|
|
1106
|
-
(
|
|
1107
|
-
(
|
|
2338
|
+
(recordKeyOrName: string, result: RecordFileApiSuccess, endpoint?: string): Promise<EraseFileResult>;
|
|
2339
|
+
(recordKeyOrName: string, url: string, endpoint?: string): Promise<EraseFileResult>;
|
|
1108
2340
|
};
|
|
1109
|
-
recordEvent: (
|
|
2341
|
+
recordEvent: (recordKeyOrName: string, eventName: string, endpoint?: string) => Promise<AddCountResult>;
|
|
1110
2342
|
countEvents: (recordNameOrKey: string, eventName: string, endpoint?: string) => Promise<GetCountResult>;
|
|
1111
2343
|
convertGeolocationToWhat3Words: (location: ConvertGeolocationToWhat3WordsOptions) => Promise<string>;
|
|
1112
2344
|
raycastFromCamera: (portal: 'grid' | 'miniGrid' | 'map' | 'miniMap', viewportCoordinates: Vector2) => Promise<RaycastResult>;
|
|
@@ -1138,6 +2370,11 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1138
2370
|
meetCommand: (command: string, ...args: any) => Promise<void>;
|
|
1139
2371
|
meetFunction: (functionName: string, ...args: any[]) => Promise<any>;
|
|
1140
2372
|
readonly vars: any;
|
|
2373
|
+
_createDebugger_normal: (options?: NormalDebuggerOptions) => Promise<NormalDebugger>;
|
|
2374
|
+
_createDebugger_pausable: (options: PausableDebuggerOptions) => Promise<PausableDebugger>;
|
|
2375
|
+
_getExecutingDebugger: () => Debugger;
|
|
2376
|
+
_attachDebugger: (debug: Debugger, options?: AttachDebuggerOptions) => Promise<void>;
|
|
2377
|
+
_detachDebugger: (debug: Debugger) => Promise<void>;
|
|
1141
2378
|
};
|
|
1142
2379
|
portal: {
|
|
1143
2380
|
registerPrefix: (prefix: string, options?: RegisterPrefixOptions) => Promise<void>;
|
|
@@ -1214,6 +2451,9 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1214
2451
|
perform: (action: any) => any;
|
|
1215
2452
|
reject: (action: any) => RejectAction;
|
|
1216
2453
|
};
|
|
2454
|
+
/**
|
|
2455
|
+
* @hidden
|
|
2456
|
+
*/
|
|
1217
2457
|
adminSpace: {
|
|
1218
2458
|
unlock: (password: string) => Promise<void>;
|
|
1219
2459
|
setPassword: (oldPassword: string, newPassword: string) => Promise<void>;
|
|
@@ -1239,11 +2479,7 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1239
2479
|
endAudioRecording: () => Promise<Blob>;
|
|
1240
2480
|
beginRecording: (options?: RecordingOptions) => Promise<void>;
|
|
1241
2481
|
endRecording: () => Promise<Recording>;
|
|
1242
|
-
speakText: (text: string, options?:
|
|
1243
|
-
rate?: number;
|
|
1244
|
-
pitch?: number;
|
|
1245
|
-
voice?: string | SyntheticVoice;
|
|
1246
|
-
}) => Promise<void>;
|
|
2482
|
+
speakText: (text: string, options?: SpeakTextApiOptions) => Promise<void>;
|
|
1247
2483
|
getVoices: () => Promise<SyntheticVoice[]>;
|
|
1248
2484
|
};
|
|
1249
2485
|
math: {
|
|
@@ -1309,12 +2545,16 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1309
2545
|
fromHexString: (hex: string) => Uint8Array;
|
|
1310
2546
|
};
|
|
1311
2547
|
crypto: {
|
|
2548
|
+
_hash_raw: (algorithm: 'sha256' | 'sha512' | 'sha1', format: 'raw', ...data: unknown[]) => Uint8Array;
|
|
2549
|
+
_hash_string: (algorithm: 'sha256' | 'sha512' | 'sha1', format: 'hex' | 'base64', ...data: unknown[]) => string;
|
|
1312
2550
|
hash: {
|
|
1313
2551
|
(algorithm: 'sha256' | 'sha512' | 'sha1', format: 'hex' | 'base64', ...data: unknown[]): string;
|
|
1314
2552
|
(algorithm: 'sha256' | 'sha512' | 'sha1', format: 'raw', ...data: unknown[]): Uint8Array;
|
|
1315
2553
|
};
|
|
1316
2554
|
sha256: (...data: unknown[]) => string;
|
|
1317
2555
|
sha512: (...data: unknown[]) => string;
|
|
2556
|
+
_hmac_string: (algorithm: 'sha256' | 'sha512' | 'sha1', format: 'hex' | 'base64', key: string, ...data: unknown[]) => string;
|
|
2557
|
+
_hmac_raw: (algorithm: 'sha256' | 'sha512' | 'sha1', format: 'raw', key: string, ...data: unknown[]) => Uint8Array;
|
|
1318
2558
|
hmac: {
|
|
1319
2559
|
(algorithm: 'hmac-sha256' | 'hmac-sha512' | 'hmac-sha1', format: 'hex' | 'base64', key: string, ...data: unknown[]): string;
|
|
1320
2560
|
(algorithm: 'hmac-sha256' | 'hmac-sha512' | 'hmac-sha1', format: 'raw', key: string, ...data: unknown[]): Uint8Array;
|
|
@@ -1343,6 +2583,9 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1343
2583
|
getStats: () => PerformanceStats;
|
|
1344
2584
|
};
|
|
1345
2585
|
web: {
|
|
2586
|
+
_webGet: (url: string, options?: WebhookOptions) => Promise<WebhookResult>;
|
|
2587
|
+
_webPost: (url: string, data?: any, options?: WebhookOptions) => Promise<WebhookResult>;
|
|
2588
|
+
_webHook: (options: WebhookOptions) => Promise<WebhookResult>;
|
|
1346
2589
|
get: ((url: string, options?: WebhookOptions) => Promise<WebhookResult>) & MaskableFunction;
|
|
1347
2590
|
post: ((url: string, data?: any, options?: WebhookOptions) => Promise<WebhookResult>) & MaskableFunction;
|
|
1348
2591
|
hook: {
|
|
@@ -1364,5 +2607,6 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1364
2607
|
watchBot: (options: TagSpecificApiOptions) => (bot: (Bot | string)[] | Bot | string, handler: () => void | Generator<InterpreterStop, any, InterpreterContinuation>) => number;
|
|
1365
2608
|
};
|
|
1366
2609
|
};
|
|
2610
|
+
export type DefaultLibrary = ReturnType<typeof createDefaultLibrary>;
|
|
1367
2611
|
export {};
|
|
1368
2612
|
//# sourceMappingURL=AuxLibrary.d.ts.map
|