@casual-simulation/aux-common 3.1.35 → 3.2.0
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/bots/Bot.d.ts +426 -43
- package/bots/Bot.js.map +1 -1
- package/bots/BotEvents.d.ts +238 -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/runtime/AuxDevice.d.ts +3 -0
- package/runtime/AuxLibrary.d.ts +1275 -49
- package/runtime/AuxLibrary.js +5165 -828
- package/runtime/AuxLibrary.js.map +1 -1
- package/runtime/AuxLibraryDefinitions.def +58 -4
- package/runtime/AuxVersion.d.ts +2 -0
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 } 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;
|
|
@@ -325,8 +364,701 @@ export interface DebuggerInterface {
|
|
|
325
364
|
*/
|
|
326
365
|
[GET_RUNTIME]: () => AuxRuntime;
|
|
327
366
|
}
|
|
367
|
+
export interface DebuggerBase {
|
|
368
|
+
/**
|
|
369
|
+
* Gets the list of portal bots in the debugger.
|
|
370
|
+
*/
|
|
371
|
+
getPortalBots(): Map<string, Bot>;
|
|
372
|
+
/**
|
|
373
|
+
* Gets the list of action objects that have been performed by bots in the current debugger.
|
|
374
|
+
* Action objects are used by CasualOS to represent changes to bots or external effects that should be performed.
|
|
375
|
+
* Examples of this are {@link create}, {@link os.toast} and {@link os.enableVR}.
|
|
376
|
+
*
|
|
377
|
+
* @example Get the list of bot changes and actions that have been performed in a debugger
|
|
378
|
+
* const debug = await os.createDebugger();
|
|
379
|
+
* debug.create({
|
|
380
|
+
* test: '@os.toast("Hello")'
|
|
381
|
+
* });
|
|
382
|
+
* debug.shout("test");
|
|
383
|
+
*
|
|
384
|
+
* const actions = debug.getAllActions();
|
|
385
|
+
*
|
|
386
|
+
* assertEqual(actions, [
|
|
387
|
+
* {
|
|
388
|
+
* type: 'add_bot',
|
|
389
|
+
* id: 'uuid-1',
|
|
390
|
+
* bot: {
|
|
391
|
+
* id: 'uuid-1',
|
|
392
|
+
* tags: {
|
|
393
|
+
* test: '@os.toast("Hello")'
|
|
394
|
+
* }
|
|
395
|
+
* }
|
|
396
|
+
* },
|
|
397
|
+
* {
|
|
398
|
+
* type: 'show_toast',
|
|
399
|
+
* message: 'Hello',
|
|
400
|
+
* duration: 2000
|
|
401
|
+
* }
|
|
402
|
+
* ]);
|
|
403
|
+
*/
|
|
404
|
+
getAllActions(): BotAction[];
|
|
405
|
+
/**
|
|
406
|
+
* 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.
|
|
407
|
+
* Common actions are actions that do not immediately change bots or bot tags or masks.
|
|
408
|
+
*
|
|
409
|
+
* Examples of common actions are {@link os.toast} and {@link os.enableVR}.
|
|
410
|
+
*
|
|
411
|
+
* @example Get the list of actions that have been performed in a debugger
|
|
412
|
+
* const debug = await os.createDebugger();
|
|
413
|
+
* debug.create({
|
|
414
|
+
* test: '@os.toast("Hello")'
|
|
415
|
+
* });
|
|
416
|
+
* debug.shout("test");
|
|
417
|
+
*
|
|
418
|
+
* const actions = debug.getCommonActions();
|
|
419
|
+
*
|
|
420
|
+
* assertEqual(actions, [
|
|
421
|
+
* {
|
|
422
|
+
* type: 'show_toast',
|
|
423
|
+
* message: 'Hello',
|
|
424
|
+
* duration: 2000
|
|
425
|
+
* }
|
|
426
|
+
* ]);
|
|
427
|
+
*/
|
|
428
|
+
getCommonActions(): BotAction[];
|
|
429
|
+
/**
|
|
430
|
+
* Gets the list of bot actions that have been performed by bots in the current debugger.
|
|
431
|
+
* Action objects are used by CasualOS to represent changes to bots or external effects that should be performed.
|
|
432
|
+
* Bot actions are actions that immediately change bots or bot tags or masks.
|
|
433
|
+
*
|
|
434
|
+
* Examples of bot actions are {@link create}, {@link destroy} or {@link setTagMask}.
|
|
435
|
+
*
|
|
436
|
+
* @example Get the list of bot changes that have been performed in a debugger
|
|
437
|
+
* const debug = await os.createDebugger();
|
|
438
|
+
* debug.create({
|
|
439
|
+
* test: '@os.toast("Hello")'
|
|
440
|
+
* });
|
|
441
|
+
* debug.shout("test");
|
|
442
|
+
*
|
|
443
|
+
* const actions = debug.getBotActions();
|
|
444
|
+
*
|
|
445
|
+
* assertEqual(actions, [
|
|
446
|
+
* {
|
|
447
|
+
* type: 'add_bot',
|
|
448
|
+
* id: 'uuid-1',
|
|
449
|
+
* bot: {
|
|
450
|
+
* id: 'uuid-1',
|
|
451
|
+
* tags: {
|
|
452
|
+
* test: '@os.toast("Hello")'
|
|
453
|
+
* }
|
|
454
|
+
* }
|
|
455
|
+
* },
|
|
456
|
+
* ]);
|
|
457
|
+
*/
|
|
458
|
+
getBotActions(): BotAction[];
|
|
459
|
+
/**
|
|
460
|
+
* 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.
|
|
461
|
+
*
|
|
462
|
+
* Debuggers capture these errors and let you inspect them afterwards.
|
|
463
|
+
*
|
|
464
|
+
* @example Get the list of errors that have happened in a debugger
|
|
465
|
+
* const debug = await os.createDebugger();
|
|
466
|
+
* debug.create({
|
|
467
|
+
* test: '@throw new Error("My Error")'
|
|
468
|
+
* });
|
|
469
|
+
* debug.shout("test");
|
|
470
|
+
*
|
|
471
|
+
* const errors = debug.getErrors();
|
|
472
|
+
*
|
|
473
|
+
* assertEqual(errors.length, 1);
|
|
474
|
+
* assertEqual(errors[0].error, new Error("My Error"));
|
|
475
|
+
* assertEqual(errors[0].tag, "test");
|
|
476
|
+
*/
|
|
477
|
+
getErrors(): any[];
|
|
478
|
+
/**
|
|
479
|
+
* Registers the given handler to be called before a bot action is executed in this debugger.
|
|
480
|
+
* @param handler The handler that should be called.
|
|
481
|
+
*/
|
|
482
|
+
onBeforeAction(handler: (action: BotAction) => void): void;
|
|
483
|
+
/**
|
|
484
|
+
* Registers the given handler to be called after a bot action is executed in this debugger.
|
|
485
|
+
* @param handler The handler that should be called.
|
|
486
|
+
*/
|
|
487
|
+
onAfterAction(handler: (action: BotAction) => void): void;
|
|
488
|
+
/**
|
|
489
|
+
* Registers the given handler function to be called before a user action is performed in the debugger.
|
|
490
|
+
*
|
|
491
|
+
* User actions are like normal actions, except they are generated by the CasualOS frontend.
|
|
492
|
+
* Generally, this only happens for built-in shouts and whispers.
|
|
493
|
+
* Additionally, these actions can only be automatically created for debuggers that are attached using {@link os.attachDebugger}.
|
|
494
|
+
*
|
|
495
|
+
* @param listener the function that should be called before a user action is performed.
|
|
496
|
+
*
|
|
497
|
+
* @example Listen for tag updates in a debugger
|
|
498
|
+
* const debug = await os.createDebugger({
|
|
499
|
+
* pausable: true
|
|
500
|
+
* });
|
|
501
|
+
*
|
|
502
|
+
* // Register a listener that gets called whenever a user action is about to be performed.
|
|
503
|
+
* debug.onBeforeUserAction(update => {
|
|
504
|
+
* console.log('user action', update);
|
|
505
|
+
* });
|
|
506
|
+
*
|
|
507
|
+
* // Because the debugger is pausable, the create() function returns a promise
|
|
508
|
+
* // because it calls @onCreate which could cause a pause trigger to be hit.
|
|
509
|
+
* const debuggerBot = await debug.create({
|
|
510
|
+
* home: true,
|
|
511
|
+
* });
|
|
512
|
+
*
|
|
513
|
+
* // Attach the debugger to the front end
|
|
514
|
+
* await os.attachDebugger(debug);
|
|
515
|
+
*
|
|
516
|
+
* @docname onBeforeUserAction
|
|
517
|
+
* @docid debug.onBeforeUserAction
|
|
518
|
+
*/
|
|
519
|
+
onBeforeUserAction(listener: (action: BotAction) => void): void;
|
|
520
|
+
/**
|
|
521
|
+
* Registers the given handler function to be called by the debugger whenever a script enqueues an action.
|
|
522
|
+
* This occurrs for common actions like {@link os.toast} and {@link os.showInput}.
|
|
523
|
+
*
|
|
524
|
+
* Every action that is enqueued ends up being performed.
|
|
525
|
+
*
|
|
526
|
+
* @param listener the function that should be called whenever an action is scheduled to be performed.
|
|
527
|
+
*
|
|
528
|
+
* @example Listen for actions to be enqueued in a debugger
|
|
529
|
+
* const debug = await os.createDebugger({
|
|
530
|
+
* pausable: true
|
|
531
|
+
* });
|
|
532
|
+
*
|
|
533
|
+
* // Register a listener that gets called whenever an action is scheduled to be performed.
|
|
534
|
+
* debug.onScriptActionEnqueued(action => {
|
|
535
|
+
* console.log('action enqueued', action);
|
|
536
|
+
* });
|
|
537
|
+
*
|
|
538
|
+
* // Because the debugger is pausable, the create() function returns a promise
|
|
539
|
+
* // because it calls @onCreate which could cause a pause trigger to be hit.
|
|
540
|
+
* const debuggerBot = await debug.create({
|
|
541
|
+
* test: '@let abc = 123; os.toast(abc);'
|
|
542
|
+
* });
|
|
543
|
+
*
|
|
544
|
+
* // Send a shout. Just like the create() function above, we recieve a promise that we can await.
|
|
545
|
+
* await debug.shout('test');
|
|
546
|
+
*/
|
|
547
|
+
onScriptActionEnqueued(listener: (action: BotAction) => void): void;
|
|
548
|
+
/**
|
|
549
|
+
* Registers the given handler function to be called after any tag is updated in the debugger.
|
|
550
|
+
*
|
|
551
|
+
* @param listener the function that should be called when a tag is updated.
|
|
552
|
+
*
|
|
553
|
+
* @example Listen for tag updates in a debugger
|
|
554
|
+
* const debug = await os.createDebugger({
|
|
555
|
+
* pausable: true
|
|
556
|
+
* });
|
|
557
|
+
*
|
|
558
|
+
* // Register a listener that gets called whenever a tag is updated.
|
|
559
|
+
* debug.onAfterScriptUpdatedTag(update => {
|
|
560
|
+
* console.log('tag updated', update);
|
|
561
|
+
* });
|
|
562
|
+
*
|
|
563
|
+
* // Because the debugger is pausable, the create() function returns a promise
|
|
564
|
+
* // because it calls @onCreate which could cause a pause trigger to be hit.
|
|
565
|
+
* const debuggerBot = await debug.create({
|
|
566
|
+
* test: '@tags.message = "hello, world";'
|
|
567
|
+
* });
|
|
568
|
+
*
|
|
569
|
+
* // Send a shout. Just like the create() function above, we recieve a promise that we can await.
|
|
570
|
+
* await debug.shout('test');
|
|
571
|
+
*/
|
|
572
|
+
onAfterScriptUpdatedTag(listener: (update: DebuggerTagUpdate) => void): void;
|
|
573
|
+
/**
|
|
574
|
+
* Registers the given handler function to be called after any tag mask is updated in the debugger.
|
|
575
|
+
*
|
|
576
|
+
* @param listener the function that should be called when a tag mask is updated.
|
|
577
|
+
*
|
|
578
|
+
* @example Listen for tag mask updates in a debugger
|
|
579
|
+
* const debug = await os.createDebugger({
|
|
580
|
+
* pausable: true
|
|
581
|
+
* });
|
|
582
|
+
*
|
|
583
|
+
* // Register a listener that gets called whenever a tag mask is updated.
|
|
584
|
+
* debug.onAfterScriptUpdatedTagMask(update => {
|
|
585
|
+
* console.log('tag mask updated', update);
|
|
586
|
+
* });
|
|
587
|
+
*
|
|
588
|
+
* // Because the debugger is pausable, the create() function returns a promise
|
|
589
|
+
* // because it calls @onCreate which could cause a pause trigger to be hit.
|
|
590
|
+
* const debuggerBot = await debug.create({
|
|
591
|
+
* test: '@masks.message = "hello, world";'
|
|
592
|
+
* });
|
|
593
|
+
*
|
|
594
|
+
* // Send a shout. Just like the create() function above, we recieve a promise that we can await.
|
|
595
|
+
* await debug.shout('test');
|
|
596
|
+
*/
|
|
597
|
+
onAfterScriptUpdatedTagMask(listener: (update: DebuggerTagMaskUpdate) => void): void;
|
|
598
|
+
/**
|
|
599
|
+
* Performs the given actions in order as if they were user actions.
|
|
600
|
+
*
|
|
601
|
+
* This function works similarly to {@link action.perform} except that actions performed with it will also call handlers registered with {@link debug.onBeforeUserAction}.
|
|
602
|
+
* @param actions the actions that should be performed.
|
|
603
|
+
*/
|
|
604
|
+
performUserAction(...actions: BotAction[]): Promise<(any[] | null)[]>;
|
|
605
|
+
/**
|
|
606
|
+
* The web actions that are available in this debugger.
|
|
607
|
+
*
|
|
608
|
+
* @docreferenceactions ^web\.
|
|
609
|
+
* @docsource WebActions
|
|
610
|
+
*/
|
|
611
|
+
web: {};
|
|
612
|
+
/**
|
|
613
|
+
* The OS actions that are available in this debugger.
|
|
614
|
+
*
|
|
615
|
+
* @docreferenceactions ^os\.
|
|
616
|
+
* @docsource OSActions
|
|
617
|
+
*/
|
|
618
|
+
os: {};
|
|
619
|
+
/**
|
|
620
|
+
* The action-related actions that are available in this debugger.
|
|
621
|
+
*
|
|
622
|
+
* @docreferenceactions ^action\.
|
|
623
|
+
* @docsource ActionActions
|
|
624
|
+
*/
|
|
625
|
+
action: {};
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Defines the possible types that represent a debugger.
|
|
629
|
+
*
|
|
630
|
+
* @dochash types/debuggers
|
|
631
|
+
* @docname Debugger
|
|
632
|
+
*/
|
|
633
|
+
export type Debugger = NormalDebugger | PausableDebugger;
|
|
634
|
+
/**
|
|
635
|
+
* Defines an interface that represents a debugger.
|
|
636
|
+
*
|
|
637
|
+
* @dochash types/debuggers/debugger
|
|
638
|
+
* @doctitle Debugger
|
|
639
|
+
* @docsidebar Debugger
|
|
640
|
+
* @docdescription Defines an interface that represents a debugger.
|
|
641
|
+
* @docname Debugger
|
|
642
|
+
* @docreferenceactions ^\w+$
|
|
643
|
+
*/
|
|
644
|
+
export interface NormalDebugger extends DebuggerBase {
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Defines an interface that represents a pausable debugger.
|
|
648
|
+
*
|
|
649
|
+
* @dochash types/debuggers/pausable-debugger
|
|
650
|
+
* @doctitle Pausable Debugger
|
|
651
|
+
* @docsidebar Pausable Debugger
|
|
652
|
+
* @docdescription Defines an interface that represents a pausable debugger.
|
|
653
|
+
* @docname PausableDebugger
|
|
654
|
+
* @docreferenceactions ^\w+$
|
|
655
|
+
*/
|
|
656
|
+
export interface PausableDebugger extends DebuggerBase {
|
|
657
|
+
/**
|
|
658
|
+
* Registers the given function to be called whenever the debugger is paused by hitting a pause trigger.
|
|
659
|
+
*
|
|
660
|
+
* @param handler the function that should be called when the debugger is paused.
|
|
661
|
+
*
|
|
662
|
+
* @example Listen for pauses on a debugger
|
|
663
|
+
* const debug = await os.createDebugger({
|
|
664
|
+
* pausable: true
|
|
665
|
+
* });
|
|
666
|
+
*
|
|
667
|
+
* debug.onPause(pause => {
|
|
668
|
+
* console.log('pause happened!', pause);
|
|
669
|
+
* });
|
|
670
|
+
*
|
|
671
|
+
* @docname onPause
|
|
672
|
+
* @docid debug.onPause
|
|
673
|
+
*/
|
|
674
|
+
onPause(handler: (pause: DebuggerPause) => void): void;
|
|
675
|
+
/**
|
|
676
|
+
* Registers or updates a pause trigger with a debugger. Returns the newly created trigger.
|
|
677
|
+
*
|
|
678
|
+
* 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.
|
|
679
|
+
* Additionally, the debugger will call all handlers that have been registered with {@link debug.onPause}.
|
|
680
|
+
*
|
|
681
|
+
* @param trigger The trigger that should be registered or updated.
|
|
682
|
+
*
|
|
683
|
+
* @docname setPauseTrigger
|
|
684
|
+
* @docid debug.setPauseTrigger-trigger
|
|
685
|
+
*/
|
|
686
|
+
_setPauseTrigger_trigger(trigger: PauseTrigger): PauseTrigger;
|
|
687
|
+
/**
|
|
688
|
+
* Registers or updates a pause trigger with this debugger.
|
|
689
|
+
* Pause triggers can be used to tell the debugger when you want it to stop execution.
|
|
690
|
+
* You specify the bot, tag, line and column numbers and the debugger will stop before/after it executes the code at that location.
|
|
691
|
+
* @param botOrIdOrTrigger the bot, or bot ID that should be registered.
|
|
692
|
+
* @param tag the name of the tag that the trigger should be set on.
|
|
693
|
+
* @param options The options that go with this pause trigger.
|
|
694
|
+
*
|
|
695
|
+
* @example Set a pause trigger on a script
|
|
696
|
+
* const debug = await os.createDebugger({
|
|
697
|
+
* pausable: true
|
|
698
|
+
* });
|
|
699
|
+
*
|
|
700
|
+
* const b = await debug.create({
|
|
701
|
+
* test: '@os.toast("Hello, World!")'
|
|
702
|
+
* });
|
|
703
|
+
*
|
|
704
|
+
* const trigger = debug.setPauseTrigger(b, 'test', {
|
|
705
|
+
* lineNumber: 1,
|
|
706
|
+
* columnNumber: 1
|
|
707
|
+
* });
|
|
708
|
+
*
|
|
709
|
+
* @example Update a pause trigger on a script
|
|
710
|
+
* const debug = await os.createDebugger({
|
|
711
|
+
* pausable: true
|
|
712
|
+
* });
|
|
713
|
+
*
|
|
714
|
+
* const b = await debug.create({
|
|
715
|
+
* test: '@os.toast("Hello, World!")'
|
|
716
|
+
* });
|
|
717
|
+
*
|
|
718
|
+
* let trigger = debug.setPauseTrigger(b, 'test', {
|
|
719
|
+
* lineNumber: 1,
|
|
720
|
+
* columnNumber: 1
|
|
721
|
+
* });
|
|
722
|
+
*
|
|
723
|
+
* trigger = debug.setPauseTrigger({
|
|
724
|
+
* ...trigger,
|
|
725
|
+
* states: ['before', 'after']
|
|
726
|
+
* });
|
|
727
|
+
|
|
728
|
+
* @docname setPauseTrigger
|
|
729
|
+
* @docid debug.setPauseTrigger-botOrId
|
|
730
|
+
*/
|
|
731
|
+
_setPauseTrigger_botOrId(botOrIdOrTrigger: Bot | string, tag?: string, options?: PauseTriggerOptions): PauseTrigger;
|
|
732
|
+
/**
|
|
733
|
+
* Removes the given pause trigger from the debugger.
|
|
734
|
+
* @param triggerOrId the trigger or trigger ID that should be removed from the debugger.
|
|
735
|
+
*
|
|
736
|
+
* @example Remove a pause trigger
|
|
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
|
+
* const trigger = debug.setPauseTrigger(b, 'test', {
|
|
746
|
+
* lineNumber: 1,
|
|
747
|
+
* columnNumber: 1
|
|
748
|
+
* });
|
|
749
|
+
*
|
|
750
|
+
* debug.removePauseTrigger(trigger);
|
|
751
|
+
*/
|
|
752
|
+
removePauseTrigger(triggerOrId: string | PauseTrigger): void;
|
|
753
|
+
/**
|
|
754
|
+
* Disables the given pause trigger.
|
|
755
|
+
* Disabled pause triggers will continue to be listed with {@link debug.listPauseTriggers}, but will not cause a pause to happen while they are disabled.
|
|
756
|
+
*
|
|
757
|
+
* @param triggerOrId The trigger or trigger ID that should be disabled.
|
|
758
|
+
*
|
|
759
|
+
* @example Disable a pause trigger
|
|
760
|
+
* const debug = await os.createDebugger({
|
|
761
|
+
* pausable: true
|
|
762
|
+
* });
|
|
763
|
+
*
|
|
764
|
+
* const b = await debug.create({
|
|
765
|
+
* test: '@os.toast("Hello, World!")'
|
|
766
|
+
* });
|
|
767
|
+
*
|
|
768
|
+
* const trigger = debug.setPauseTrigger(b, 'test', {
|
|
769
|
+
* lineNumber: 1,
|
|
770
|
+
* columnNumber: 1
|
|
771
|
+
* });
|
|
772
|
+
*
|
|
773
|
+
* debug.disablePauseTrigger(trigger);
|
|
774
|
+
*/
|
|
775
|
+
disablePauseTrigger(triggerOrId: string | PauseTrigger): void;
|
|
776
|
+
/**
|
|
777
|
+
* Enables the given pause trigger
|
|
778
|
+
* @param triggerOrId The trigger or trigger ID that should be enabled.
|
|
779
|
+
*
|
|
780
|
+
* @example Enable a pause trigger
|
|
781
|
+
* const debug = await os.createDebugger({
|
|
782
|
+
* pausable: true
|
|
783
|
+
* });
|
|
784
|
+
*
|
|
785
|
+
* const b = await debug.create({
|
|
786
|
+
* test: '@os.toast("Hello, World!")'
|
|
787
|
+
* });
|
|
788
|
+
*
|
|
789
|
+
* const trigger = debug.setPauseTrigger(b, 'test', {
|
|
790
|
+
* lineNumber: 1,
|
|
791
|
+
* columnNumber: 1,
|
|
792
|
+
* enabled: false
|
|
793
|
+
* });
|
|
794
|
+
*
|
|
795
|
+
* debug.enablePauseTrigger(trigger);
|
|
796
|
+
*/
|
|
797
|
+
enablePauseTrigger(triggerOrId: string | PauseTrigger): void;
|
|
798
|
+
/**
|
|
799
|
+
* Gets the list of pause triggers that have been registered with this debugger.
|
|
800
|
+
*
|
|
801
|
+
* @example List the triggers that are set on this debugger
|
|
802
|
+
* const debug = await os.createDebugger({
|
|
803
|
+
* pausable: true
|
|
804
|
+
* });
|
|
805
|
+
*
|
|
806
|
+
* const b = await debug.create({
|
|
807
|
+
* test: '@os.toast("Hello, World!")'
|
|
808
|
+
* });
|
|
809
|
+
*
|
|
810
|
+
* const trigger = debug.setPauseTrigger(b, 'test', {
|
|
811
|
+
* lineNumber: 1,
|
|
812
|
+
* columnNumber: 1,
|
|
813
|
+
* enabled: false
|
|
814
|
+
* });
|
|
815
|
+
*
|
|
816
|
+
* const triggers = debug.listPauseTriggers();
|
|
817
|
+
*
|
|
818
|
+
* @docname listPauseTriggers
|
|
819
|
+
* @docid debug.listPauseTriggers
|
|
820
|
+
*/
|
|
821
|
+
listPauseTriggers(): PauseTrigger[];
|
|
822
|
+
/**
|
|
823
|
+
* 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.
|
|
824
|
+
*
|
|
825
|
+
* @param botOrId the bot or bot ID that the locations should be listed for.
|
|
826
|
+
* @param tag the name of the tag that the locations should be listed for.
|
|
827
|
+
*
|
|
828
|
+
* @example List common trigger locations for a script
|
|
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 triggerLocations = debug.listCommonPauseTriggers(b, 'test');
|
|
838
|
+
*
|
|
839
|
+
* @example Register a trigger from a common location
|
|
840
|
+
* const debug = await os.createDebugger({
|
|
841
|
+
* pausable: true
|
|
842
|
+
* });
|
|
843
|
+
*
|
|
844
|
+
* const b = await debug.create({
|
|
845
|
+
* test: '@os.toast("Hello, World!")'
|
|
846
|
+
* });
|
|
847
|
+
*
|
|
848
|
+
* const triggerLocations = debug.listCommonPauseTriggers(b, 'test');
|
|
849
|
+
*
|
|
850
|
+
* const trigger = debug.setPauseTrigger(b, 'test', {
|
|
851
|
+
* lineNumber: triggerLocations[0].lineNumber,
|
|
852
|
+
* columnNumber: triggerLocations[0].columnNumber,
|
|
853
|
+
* states: triggerLocations[0].possibleStates
|
|
854
|
+
* });
|
|
855
|
+
*/
|
|
856
|
+
listCommonPauseTriggers(botOrId: Bot | string, tag: string): PossiblePauseTriggerLocation[];
|
|
857
|
+
/**
|
|
858
|
+
* Resumes the debugger execution from the given pause.
|
|
859
|
+
* @param pause the debugger pause that was passed to the handler of {@link debug.onPause}.
|
|
860
|
+
*
|
|
861
|
+
* @example Resume execution on a debugger
|
|
862
|
+
* const debug = await os.createDebugger({
|
|
863
|
+
* pausable: true
|
|
864
|
+
* });
|
|
865
|
+
*
|
|
866
|
+
* // Register a listener that gets called whenever a pause happens in this debugger.
|
|
867
|
+
* debug.onPause(pause => {
|
|
868
|
+
* // Get the current stack frame from the pause
|
|
869
|
+
* const currentFrame = pause.callStack[pause.callStack.length - 1];
|
|
870
|
+
*
|
|
871
|
+
* // Set the abc variable to 999
|
|
872
|
+
* currentFrame.setVariableValue('abc', 999);
|
|
873
|
+
*
|
|
874
|
+
* // Resume execution after the pause.
|
|
875
|
+
* debug.resume(pause);
|
|
876
|
+
* });
|
|
877
|
+
*
|
|
878
|
+
* // Because the debugger is pausable, the create() function returns a promise
|
|
879
|
+
* // because it calls @onCreate which could cause a pause trigger to be hit.
|
|
880
|
+
* const debuggerBot = await debug.create({
|
|
881
|
+
* test: '@let abc = 123; os.toast(abc);'
|
|
882
|
+
* });
|
|
883
|
+
*
|
|
884
|
+
* // Set a pause trigger in the "test" script of the bot we just created
|
|
885
|
+
* // at line 1 column 16
|
|
886
|
+
* const trigger = debug.setPauseTrigger(debuggerBot, 'test', {
|
|
887
|
+
* lineNumber: 1,
|
|
888
|
+
* columnNumber: 16
|
|
889
|
+
* });
|
|
890
|
+
*
|
|
891
|
+
* // Send a shout. Just like the create() function above, we recieve a promise that we can await.
|
|
892
|
+
* await debug.shout('test');
|
|
893
|
+
*
|
|
894
|
+
* // Get the resulting actions from the debugger
|
|
895
|
+
* // and perform the first one. This should be the os.toast(), but instead of printing 123,
|
|
896
|
+
* // it should print 999 because we changed the value of abc during the debugger pause.
|
|
897
|
+
* const actions = debug.getCommonActions();
|
|
898
|
+
* action.perform(actions[0]);
|
|
899
|
+
*/
|
|
900
|
+
resume(pause: DebuggerPause): void;
|
|
901
|
+
/**
|
|
902
|
+
* Gets the current call stack for the debugger. Call stacks are useful for determining program flow and how scripts interact with each other.
|
|
903
|
+
*
|
|
904
|
+
* @example Get the call stack from a debugger
|
|
905
|
+
* const debug = os.createDebugger({
|
|
906
|
+
* pausable: true
|
|
907
|
+
* });
|
|
908
|
+
*
|
|
909
|
+
* const callStack = debug.getCallStack();
|
|
910
|
+
*/
|
|
911
|
+
getCallStack(): DebuggerCallFrame[];
|
|
912
|
+
/**
|
|
913
|
+
* Creates a new bot and returns it.
|
|
914
|
+
* @param parent The bot that should be the parent of the new bot.
|
|
915
|
+
* @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.
|
|
916
|
+
* @returns The bot(s) that were created.
|
|
917
|
+
*
|
|
918
|
+
* @example Create a red bot without a parent.
|
|
919
|
+
* let debugger = await os.createDebugger({
|
|
920
|
+
* pausable: true
|
|
921
|
+
* });
|
|
922
|
+
* let redBot = await debugger.create(null, { "color": "red" });
|
|
923
|
+
*
|
|
924
|
+
* @example Create a red bot and a blue bot with `this` as the parent.
|
|
925
|
+
* let debugger = await os.createDebugger({
|
|
926
|
+
* pausable: true
|
|
927
|
+
* });
|
|
928
|
+
* let [redBot, blueBot] = await debugger.create(this, [
|
|
929
|
+
* { "color": "red" },
|
|
930
|
+
* { "color": "blue" }
|
|
931
|
+
* ]);
|
|
932
|
+
*/
|
|
933
|
+
create(...mods: Mod[]): Promise<Bot | Bot[]>;
|
|
934
|
+
/**
|
|
935
|
+
* Destroys the given bot, bot ID, or list of bots.
|
|
936
|
+
* @param bot The bot, bot ID, or list of bots to destroy.
|
|
937
|
+
*/
|
|
938
|
+
destroy(bot: Bot | string | Bot[]): Promise<void>;
|
|
939
|
+
/**
|
|
940
|
+
* Shouts the given events in order until a bot returns a result.
|
|
941
|
+
* Returns the result that was produced or undefined if no result was produced.
|
|
942
|
+
* @param eventNames The names of the events to shout.
|
|
943
|
+
* @param arg The argument to shout.
|
|
944
|
+
*/
|
|
945
|
+
priorityShout(eventNames: string[], arg?: any): Promise<any>;
|
|
946
|
+
/**
|
|
947
|
+
* Asks every bot in the inst to run the given action.
|
|
948
|
+
* In effect, this is like shouting to a bunch of people in a room.
|
|
949
|
+
*
|
|
950
|
+
* @param name The event name.
|
|
951
|
+
* @param arg The optional argument to include in the shout.
|
|
952
|
+
* @returns Returns a list which contains the values returned from each script that was run for the shout.
|
|
953
|
+
*
|
|
954
|
+
* @example Tell every bot to reset themselves.
|
|
955
|
+
* let debugger = await os.createDebugger({
|
|
956
|
+
* pausable: true
|
|
957
|
+
* });
|
|
958
|
+
* await debugger.shout("reset()");
|
|
959
|
+
*
|
|
960
|
+
* @example Ask every bot for its name.
|
|
961
|
+
* let debugger = await os.createDebugger({
|
|
962
|
+
* pausable: true
|
|
963
|
+
* });
|
|
964
|
+
* const names = await debugger.shout("getName()");
|
|
965
|
+
*
|
|
966
|
+
* @example Tell every bot say "Hi" to you.
|
|
967
|
+
* let debugger = await os.createDebugger({
|
|
968
|
+
* pausable: true
|
|
969
|
+
* });
|
|
970
|
+
* await debugger.shout("sayHi()", "My Name");
|
|
971
|
+
*/
|
|
972
|
+
shout(name: string, arg?: any): Promise<any[]>;
|
|
973
|
+
/**
|
|
974
|
+
* Asks the given bots to run the given action.
|
|
975
|
+
* In effect, this is like whispering to a specific set of people in a room.
|
|
976
|
+
*
|
|
977
|
+
* @param bot The bot(s) to send the event to.
|
|
978
|
+
* @param eventName The name of the event to send.
|
|
979
|
+
* @param arg The optional argument to include.
|
|
980
|
+
* @returns Returns a list which contains the values returned from each script that was run for the shout.
|
|
981
|
+
*/
|
|
982
|
+
whisper(bot: (Bot | string)[] | Bot | string, eventName: string, arg?: any): Promise<any>;
|
|
983
|
+
/**
|
|
984
|
+
* Changes the state that the given bot is in.
|
|
985
|
+
* @param bot The bot to change.
|
|
986
|
+
* @param stateName The state that the bot should move to.
|
|
987
|
+
* @param groupName The group of states that the bot's state should change in. (Defaults to "state")
|
|
988
|
+
*/
|
|
989
|
+
changeState(bot: Bot, stateName: string, groupName?: string): Promise<void>;
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Defines an interface for a possible pause trigger location.
|
|
993
|
+
*
|
|
994
|
+
* @dochash types/debuggers/common
|
|
995
|
+
* @docname PossiblePauseTriggerLocation
|
|
996
|
+
*/
|
|
997
|
+
export interface PossiblePauseTriggerLocation {
|
|
998
|
+
/**
|
|
999
|
+
* The line number that the trigger would pause the debugger at.
|
|
1000
|
+
*/
|
|
1001
|
+
lineNumber: number;
|
|
1002
|
+
/**
|
|
1003
|
+
* The column number that the trigger would pause the debugger at.
|
|
1004
|
+
*/
|
|
1005
|
+
columnNumber: number;
|
|
1006
|
+
/**
|
|
1007
|
+
* The states that are reasonable for this pause trigger to stop at.
|
|
1008
|
+
*/
|
|
1009
|
+
possibleStates: PossiblePauseTriggerStates;
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
* The possible states that a pause trigger can be set to.
|
|
1013
|
+
*
|
|
1014
|
+
* @dochash types/debuggers/common
|
|
1015
|
+
* @docname PossiblePauseTriggerStates
|
|
1016
|
+
*/
|
|
1017
|
+
export type PossiblePauseTriggerStates = ['before' | 'after'] | ['before', 'after'];
|
|
1018
|
+
/**
|
|
1019
|
+
* Defines an interface for a debugger trace that represents when a tag was updated.
|
|
1020
|
+
*
|
|
1021
|
+
* @dochash types/debuggers/common
|
|
1022
|
+
* @docname DebuggerTagUpdate
|
|
1023
|
+
*/
|
|
1024
|
+
export interface DebuggerTagUpdate {
|
|
1025
|
+
/**
|
|
1026
|
+
* The ID of the bot that was updated.
|
|
1027
|
+
*/
|
|
1028
|
+
botId: string;
|
|
1029
|
+
/**
|
|
1030
|
+
* The tag that was updated.
|
|
1031
|
+
*/
|
|
1032
|
+
tag: string;
|
|
1033
|
+
/**
|
|
1034
|
+
* The old value of the tag.
|
|
1035
|
+
*/
|
|
1036
|
+
oldValue: any;
|
|
1037
|
+
/**
|
|
1038
|
+
* The new value for the tag.
|
|
1039
|
+
*/
|
|
1040
|
+
newValue: any;
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Defines an interface for a debugger trace that represents when a tag mask was updated.
|
|
1044
|
+
*
|
|
1045
|
+
* @dochash types/debuggers/common
|
|
1046
|
+
* @docname DebuggerTagMaskUpdate
|
|
1047
|
+
*/
|
|
1048
|
+
export interface DebuggerTagMaskUpdate extends DebuggerTagUpdate {
|
|
1049
|
+
/**
|
|
1050
|
+
* The space of the tag mask.
|
|
1051
|
+
*/
|
|
1052
|
+
space: string;
|
|
1053
|
+
}
|
|
328
1054
|
/**
|
|
329
1055
|
* Defines an interface that contains options for attaching a debugger.
|
|
1056
|
+
*
|
|
1057
|
+
* @dochash types/debuggers/common
|
|
1058
|
+
* @doctitle Common
|
|
1059
|
+
* @docsidebar Common
|
|
1060
|
+
* @docdescription Defines common interfaces related to debuggers.
|
|
1061
|
+
* @docname AttachDebuggerOptions
|
|
330
1062
|
*/
|
|
331
1063
|
export interface AttachDebuggerOptions {
|
|
332
1064
|
/**
|
|
@@ -335,8 +1067,51 @@ export interface AttachDebuggerOptions {
|
|
|
335
1067
|
*/
|
|
336
1068
|
tagNameMapper?: TagMapper;
|
|
337
1069
|
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Defines an interface that contains options for a debugger.
|
|
1072
|
+
*/
|
|
1073
|
+
export interface CommonDebuggerOptions {
|
|
1074
|
+
/**
|
|
1075
|
+
* Whether to use "real" UUIDs instead of predictable ones.
|
|
1076
|
+
*/
|
|
1077
|
+
useRealUUIDs?: boolean;
|
|
1078
|
+
/**
|
|
1079
|
+
* Whether to allow scripts to be asynchronous.
|
|
1080
|
+
* If false, then all scripts will be forced to be synchronous.
|
|
1081
|
+
* Defaults to true.
|
|
1082
|
+
*/
|
|
1083
|
+
allowAsynchronousScripts?: boolean;
|
|
1084
|
+
/**
|
|
1085
|
+
* The data that the configBot should be created from.
|
|
1086
|
+
* Can be a mod or another bot.
|
|
1087
|
+
*/
|
|
1088
|
+
configBot?: Bot | BotTags;
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* Defines an interface that contains options for a normal debugger.
|
|
1092
|
+
* That is, a debugger that is not pausable.
|
|
1093
|
+
*
|
|
1094
|
+
* @dochash types/debuggers/common
|
|
1095
|
+
* @docname NormalDebuggerOptions
|
|
1096
|
+
*/
|
|
1097
|
+
export interface NormalDebuggerOptions extends CommonDebuggerOptions {
|
|
1098
|
+
pausable?: false;
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* Defines an interface that contains options for a pausable debugger.
|
|
1102
|
+
* That is, a debugger that is pausable.
|
|
1103
|
+
*
|
|
1104
|
+
* @dochash types/debuggers/common
|
|
1105
|
+
* @docname PausableDebuggerOptions
|
|
1106
|
+
*/
|
|
1107
|
+
export interface PausableDebuggerOptions extends CommonDebuggerOptions {
|
|
1108
|
+
pausable: true;
|
|
1109
|
+
}
|
|
338
1110
|
/**
|
|
339
1111
|
* Defines an interface that contains options for an aux debugger.
|
|
1112
|
+
*
|
|
1113
|
+
* @dochash types/debuggers/common
|
|
1114
|
+
* @docname DebuggerOptions
|
|
340
1115
|
*/
|
|
341
1116
|
export interface AuxDebuggerOptions {
|
|
342
1117
|
/**
|
|
@@ -361,6 +1136,9 @@ export interface AuxDebuggerOptions {
|
|
|
361
1136
|
}
|
|
362
1137
|
/**
|
|
363
1138
|
* Defines an interface that contains options for a pause trigger.
|
|
1139
|
+
*
|
|
1140
|
+
* @dochash types/debuggers/common
|
|
1141
|
+
* @docname PauseTriggerOptions
|
|
364
1142
|
*/
|
|
365
1143
|
export interface PauseTriggerOptions {
|
|
366
1144
|
/**
|
|
@@ -384,6 +1162,9 @@ export interface PauseTriggerOptions {
|
|
|
384
1162
|
}
|
|
385
1163
|
/**
|
|
386
1164
|
* Defines an interface that represents a pause trigger.
|
|
1165
|
+
*
|
|
1166
|
+
* @dochash types/debuggers/common
|
|
1167
|
+
* @docname PauseTrigger
|
|
387
1168
|
*/
|
|
388
1169
|
export interface PauseTrigger extends PauseTriggerOptions {
|
|
389
1170
|
/**
|
|
@@ -401,6 +1182,8 @@ export interface PauseTrigger extends PauseTriggerOptions {
|
|
|
401
1182
|
}
|
|
402
1183
|
/**
|
|
403
1184
|
* Defines an interface that contains information about the current debugger pause state.
|
|
1185
|
+
* @dochash types/debuggers/common
|
|
1186
|
+
* @docname DebuggerPause
|
|
404
1187
|
*/
|
|
405
1188
|
export interface DebuggerPause {
|
|
406
1189
|
/**
|
|
@@ -427,6 +1210,9 @@ export interface DebuggerPause {
|
|
|
427
1210
|
}
|
|
428
1211
|
/**
|
|
429
1212
|
* Defines an interface that contains information about a single call stack frame.
|
|
1213
|
+
*
|
|
1214
|
+
* @dochash types/debuggers/common
|
|
1215
|
+
* @docname DebuggerCallFrame
|
|
430
1216
|
*/
|
|
431
1217
|
export interface DebuggerCallFrame {
|
|
432
1218
|
/**
|
|
@@ -446,6 +1232,9 @@ export interface DebuggerCallFrame {
|
|
|
446
1232
|
}
|
|
447
1233
|
/**
|
|
448
1234
|
* Defines an interface that represents a location in a debugger.
|
|
1235
|
+
*
|
|
1236
|
+
* @dochash types/debuggers/common
|
|
1237
|
+
* @docname DebuggerFunctionLocation
|
|
449
1238
|
*/
|
|
450
1239
|
export interface DebuggerFunctionLocation {
|
|
451
1240
|
/**
|
|
@@ -471,6 +1260,9 @@ export interface DebuggerFunctionLocation {
|
|
|
471
1260
|
}
|
|
472
1261
|
/**
|
|
473
1262
|
* Defines an interface that represents a debugger variable.
|
|
1263
|
+
*
|
|
1264
|
+
* @dochash types/debuggers/common
|
|
1265
|
+
* @docname DebuggerVariable
|
|
474
1266
|
*/
|
|
475
1267
|
export interface DebuggerVariable {
|
|
476
1268
|
/**
|
|
@@ -500,6 +1292,9 @@ export interface DebuggerVariable {
|
|
|
500
1292
|
}
|
|
501
1293
|
/**
|
|
502
1294
|
* Defines an interface for a random number generator.
|
|
1295
|
+
*
|
|
1296
|
+
* @dochash types/core
|
|
1297
|
+
* @docname PseudoRandomNumberGenerator
|
|
503
1298
|
*/
|
|
504
1299
|
export interface PseudoRandomNumberGenerator {
|
|
505
1300
|
/**
|
|
@@ -536,6 +1331,9 @@ export interface WebhookInterface extends MaskableFunction {
|
|
|
536
1331
|
}
|
|
537
1332
|
/**
|
|
538
1333
|
* Defines an interface that represents the result of a webhook.
|
|
1334
|
+
*
|
|
1335
|
+
* @dochash types/web
|
|
1336
|
+
* @docname WebhookResult
|
|
539
1337
|
*/
|
|
540
1338
|
export interface WebhookResult {
|
|
541
1339
|
/**
|
|
@@ -550,12 +1348,30 @@ export interface WebhookResult {
|
|
|
550
1348
|
/**
|
|
551
1349
|
* The HTTP Headers that were included in the response.
|
|
552
1350
|
* See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers for more information.
|
|
1351
|
+
*
|
|
1352
|
+
* @docsource Headers
|
|
553
1353
|
*/
|
|
554
1354
|
headers: {
|
|
555
1355
|
[name: string]: string;
|
|
556
1356
|
};
|
|
557
1357
|
}
|
|
1358
|
+
/**
|
|
1359
|
+
* Defines the possible results of a "record file" request.
|
|
1360
|
+
*
|
|
1361
|
+
* @dochash types/records/files
|
|
1362
|
+
* @docgroup 01-create
|
|
1363
|
+
* @docorder 1
|
|
1364
|
+
* @docname RecordFileResult
|
|
1365
|
+
*/
|
|
558
1366
|
export type RecordFileApiResult = RecordFileApiSuccess | RecordFileApiFailure;
|
|
1367
|
+
/**
|
|
1368
|
+
* Defines an interface that represents a successful "record file" request.
|
|
1369
|
+
*
|
|
1370
|
+
* @dochash types/records/files
|
|
1371
|
+
* @docgroup 01-create
|
|
1372
|
+
* @docorder 2
|
|
1373
|
+
* @docname RecordFileSuccess
|
|
1374
|
+
*/
|
|
559
1375
|
export interface RecordFileApiSuccess {
|
|
560
1376
|
success: true;
|
|
561
1377
|
/**
|
|
@@ -568,11 +1384,38 @@ export interface RecordFileApiSuccess {
|
|
|
568
1384
|
*/
|
|
569
1385
|
sha256Hash: string;
|
|
570
1386
|
}
|
|
1387
|
+
/**
|
|
1388
|
+
* Defines an interface that represents a failed "record file" request.
|
|
1389
|
+
*
|
|
1390
|
+
* @dochash types/records/files
|
|
1391
|
+
* @doctitle File Types
|
|
1392
|
+
* @docsidebar Files
|
|
1393
|
+
* @docdescription File types are used for uploading and downloading files.
|
|
1394
|
+
* @docgroup 01-create
|
|
1395
|
+
* @docorder 3
|
|
1396
|
+
* @docname RecordFileFailure
|
|
1397
|
+
*/
|
|
571
1398
|
export interface RecordFileApiFailure {
|
|
572
1399
|
success: false;
|
|
1400
|
+
/**
|
|
1401
|
+
* The error code that describes why the request failed.
|
|
1402
|
+
*/
|
|
573
1403
|
errorCode: RecordFileFailure['errorCode'] | 'file_already_exists' | 'invalid_file_data';
|
|
1404
|
+
/**
|
|
1405
|
+
* The error message that describes why the request failed.
|
|
1406
|
+
*/
|
|
574
1407
|
errorMessage: string;
|
|
1408
|
+
/**
|
|
1409
|
+
* The URL that the file is available at if it has already been uploaded.
|
|
1410
|
+
*/
|
|
1411
|
+
existingFileUrl?: string;
|
|
575
1412
|
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Defines an interface that contains options for a snap grid for {@link os.addDropGrid}.
|
|
1415
|
+
*
|
|
1416
|
+
* @dochash types/os
|
|
1417
|
+
* @docname SnapGridTarget
|
|
1418
|
+
*/
|
|
576
1419
|
export interface SnapGridTarget {
|
|
577
1420
|
/**
|
|
578
1421
|
* The 3D position that the grid should appear at.
|
|
@@ -627,90 +1470,324 @@ export interface SnapGridTarget {
|
|
|
627
1470
|
*/
|
|
628
1471
|
type?: 'grid' | 'sphere';
|
|
629
1472
|
}
|
|
1473
|
+
/**
|
|
1474
|
+
* The possible results for a "join room" request.
|
|
1475
|
+
*
|
|
1476
|
+
* @dochash types/os
|
|
1477
|
+
* @docname JoinRoomResult
|
|
1478
|
+
*/
|
|
630
1479
|
export type JoinRoomResult = JoinRoomSuccess | JoinRoomFailure;
|
|
1480
|
+
/**
|
|
1481
|
+
* Defines an interface that represents a successful "join room" request.
|
|
1482
|
+
*
|
|
1483
|
+
* @dochash types/os
|
|
1484
|
+
* @docname JoinRoomSuccess
|
|
1485
|
+
*/
|
|
631
1486
|
export interface JoinRoomSuccess {
|
|
632
1487
|
success: true;
|
|
1488
|
+
/**
|
|
1489
|
+
* The name of the room that was joined.
|
|
1490
|
+
*/
|
|
633
1491
|
roomName: string;
|
|
634
1492
|
}
|
|
1493
|
+
/**
|
|
1494
|
+
* Defines an interface that represents a failed "join room" request.
|
|
1495
|
+
*
|
|
1496
|
+
* @dochash types/os
|
|
1497
|
+
* @docname JoinRoomFailure
|
|
1498
|
+
*/
|
|
635
1499
|
export interface JoinRoomFailure {
|
|
636
1500
|
success: false;
|
|
1501
|
+
/**
|
|
1502
|
+
* The name of the room that was attempted to be joined.
|
|
1503
|
+
*/
|
|
637
1504
|
roomName: string;
|
|
1505
|
+
/**
|
|
1506
|
+
* The error code that describes why the request failed.
|
|
1507
|
+
*/
|
|
638
1508
|
errorCode: string;
|
|
1509
|
+
/**
|
|
1510
|
+
* The error message that describes why the request failed.
|
|
1511
|
+
*/
|
|
639
1512
|
errorMessage: string;
|
|
640
1513
|
}
|
|
1514
|
+
/**
|
|
1515
|
+
* The possible results for a "leave room" request.
|
|
1516
|
+
*
|
|
1517
|
+
* @dochash types/os
|
|
1518
|
+
* @docname LeaveRoomResult
|
|
1519
|
+
*/
|
|
641
1520
|
export type LeaveRoomResult = LeaveRoomSuccess | LeaveRoomFailure;
|
|
1521
|
+
/**
|
|
1522
|
+
* Defines an interface that represents a successful "leave room" request.
|
|
1523
|
+
*
|
|
1524
|
+
* @dochash types/os
|
|
1525
|
+
* @docname LeaveRoomSuccess
|
|
1526
|
+
*/
|
|
642
1527
|
export interface LeaveRoomSuccess {
|
|
643
1528
|
success: true;
|
|
1529
|
+
/**
|
|
1530
|
+
* The name of the room that was left.
|
|
1531
|
+
*/
|
|
644
1532
|
roomName: string;
|
|
645
1533
|
}
|
|
1534
|
+
/**
|
|
1535
|
+
* Defines an interface that represents a failed "leave room" request.
|
|
1536
|
+
*
|
|
1537
|
+
* @dochash types/os
|
|
1538
|
+
* @docname LeaveRoomFailure
|
|
1539
|
+
*/
|
|
646
1540
|
export interface LeaveRoomFailure {
|
|
647
1541
|
success: false;
|
|
1542
|
+
/**
|
|
1543
|
+
* The name of the room that was attempted to be left.
|
|
1544
|
+
*/
|
|
648
1545
|
roomName: string;
|
|
1546
|
+
/**
|
|
1547
|
+
* The error code that describes why the request failed.
|
|
1548
|
+
*/
|
|
649
1549
|
errorCode: string;
|
|
1550
|
+
/**
|
|
1551
|
+
* The error message that describes why the request failed.
|
|
1552
|
+
*/
|
|
650
1553
|
errorMessage: string;
|
|
651
1554
|
}
|
|
1555
|
+
/**
|
|
1556
|
+
* The possible results for a "set room options" request.
|
|
1557
|
+
*
|
|
1558
|
+
* @dochash types/os
|
|
1559
|
+
* @docname SetRoomOptionsResult
|
|
1560
|
+
*/
|
|
652
1561
|
export type SetRoomOptionsResult = SetRoomOptionsSuccess | SetRoomOptionsFailure;
|
|
1562
|
+
/**
|
|
1563
|
+
* Defines an interface that represents a successful "set room options" request.
|
|
1564
|
+
*
|
|
1565
|
+
* @dochash types/os
|
|
1566
|
+
* @docname SetRoomOptionsSuccess
|
|
1567
|
+
*/
|
|
653
1568
|
export interface SetRoomOptionsSuccess {
|
|
654
1569
|
success: true;
|
|
1570
|
+
/**
|
|
1571
|
+
* The name of the room that the options were set on.
|
|
1572
|
+
*/
|
|
655
1573
|
roomName: true;
|
|
656
1574
|
}
|
|
1575
|
+
/**
|
|
1576
|
+
* Defines an interface that represents a failed "set room options" request.
|
|
1577
|
+
*/
|
|
657
1578
|
export interface SetRoomOptionsFailure {
|
|
658
1579
|
success: false;
|
|
1580
|
+
/**
|
|
1581
|
+
* The name of the room that the options were attempted to be set on.
|
|
1582
|
+
*/
|
|
659
1583
|
roomName: string;
|
|
1584
|
+
/**
|
|
1585
|
+
* The error code that describes why the request failed.
|
|
1586
|
+
*/
|
|
660
1587
|
errorCode: string;
|
|
1588
|
+
/**
|
|
1589
|
+
* The error message that describes why the request failed.
|
|
1590
|
+
*/
|
|
661
1591
|
errorMessage: string;
|
|
662
1592
|
}
|
|
1593
|
+
/**
|
|
1594
|
+
* The possible results for a "get room options" request.
|
|
1595
|
+
*
|
|
1596
|
+
* @dochash types/os
|
|
1597
|
+
* @docname GetRoomOptionsResult
|
|
1598
|
+
*/
|
|
663
1599
|
export type GetRoomOptionsResult = GetRoomOptionsSuccess | GetRoomOptionsFailure;
|
|
1600
|
+
/**
|
|
1601
|
+
* Defines an interface that represents a successful "get room options" request.
|
|
1602
|
+
*
|
|
1603
|
+
* @dochash types/os
|
|
1604
|
+
* @docname GetRoomOptionsSuccess
|
|
1605
|
+
*/
|
|
664
1606
|
export interface GetRoomOptionsSuccess {
|
|
665
1607
|
success: true;
|
|
1608
|
+
/**
|
|
1609
|
+
* The name of the room that the options were retrieved from.
|
|
1610
|
+
*/
|
|
666
1611
|
roomName: string;
|
|
1612
|
+
/**
|
|
1613
|
+
* The options that were retrieved.
|
|
1614
|
+
*/
|
|
667
1615
|
options: RoomOptions;
|
|
668
1616
|
}
|
|
1617
|
+
/**
|
|
1618
|
+
* Defines an interface that represents a failed "get room options" request.
|
|
1619
|
+
*
|
|
1620
|
+
* @dochash types/os
|
|
1621
|
+
* @docname GetRoomOptionsFailure
|
|
1622
|
+
*/
|
|
669
1623
|
export interface GetRoomOptionsFailure {
|
|
670
1624
|
success: false;
|
|
1625
|
+
/**
|
|
1626
|
+
* The error code that describes why the request failed.
|
|
1627
|
+
*/
|
|
671
1628
|
errorCode: string;
|
|
1629
|
+
/**
|
|
1630
|
+
* The error message that describes why the request failed.
|
|
1631
|
+
*/
|
|
672
1632
|
errorMessage: string;
|
|
673
1633
|
}
|
|
1634
|
+
/**
|
|
1635
|
+
* The possible results for a "get room track options" request.
|
|
1636
|
+
*
|
|
1637
|
+
* @dochash types/os
|
|
1638
|
+
* @docname GetRoomTrackOptionsResult
|
|
1639
|
+
*/
|
|
674
1640
|
export type GetRoomTrackOptionsResult = GetRoomTrackOptionsSuccess | GetRoomTrackOptionsFailure;
|
|
1641
|
+
/**
|
|
1642
|
+
* Defines an interface that represents a successful "get room track options" request.
|
|
1643
|
+
*
|
|
1644
|
+
* @dochash types/os
|
|
1645
|
+
* @docname GetRoomTrackOptionsSuccess
|
|
1646
|
+
*/
|
|
675
1647
|
export interface GetRoomTrackOptionsSuccess {
|
|
676
1648
|
success: true;
|
|
1649
|
+
/**
|
|
1650
|
+
* The name of the room that the options were retrieved from.
|
|
1651
|
+
*/
|
|
677
1652
|
roomName: string;
|
|
1653
|
+
/**
|
|
1654
|
+
* The address of the track that the options were retrieved from.
|
|
1655
|
+
*/
|
|
678
1656
|
address: string;
|
|
1657
|
+
/**
|
|
1658
|
+
* The options that were retrieved.
|
|
1659
|
+
*/
|
|
679
1660
|
options: RoomTrackOptions;
|
|
680
1661
|
}
|
|
1662
|
+
/**
|
|
1663
|
+
* Defines an interface that represents a failed "get room track options" request.
|
|
1664
|
+
*
|
|
1665
|
+
* @dochash types/os
|
|
1666
|
+
* @docname GetRoomTrackOptionsFailure
|
|
1667
|
+
*/
|
|
681
1668
|
export interface GetRoomTrackOptionsFailure {
|
|
682
1669
|
success: false;
|
|
1670
|
+
/**
|
|
1671
|
+
* The error code that describes why the request failed.
|
|
1672
|
+
*/
|
|
683
1673
|
errorCode: string;
|
|
1674
|
+
/**
|
|
1675
|
+
* The error message that describes why the request failed.
|
|
1676
|
+
*/
|
|
684
1677
|
errorMessage: string;
|
|
1678
|
+
/**
|
|
1679
|
+
* The name of the room that the options were attempted to be retrieved from.
|
|
1680
|
+
*/
|
|
685
1681
|
roomName: string;
|
|
1682
|
+
/**
|
|
1683
|
+
* The address of the track that the options were attempted to be retrieved from.
|
|
1684
|
+
*/
|
|
686
1685
|
address: string;
|
|
687
1686
|
}
|
|
1687
|
+
/**
|
|
1688
|
+
* The possible results for a "set room track options" request.
|
|
1689
|
+
*
|
|
1690
|
+
* @dochash types/os
|
|
1691
|
+
* @docname SetRoomTrackOptionsResult
|
|
1692
|
+
*/
|
|
688
1693
|
export type SetRoomTrackOptionsResult = SetRoomTrackOptionsSuccess | SetRoomTrackOptionsFailure;
|
|
1694
|
+
/**
|
|
1695
|
+
* Defines an interface that represents a successful "set room track options" request.
|
|
1696
|
+
*
|
|
1697
|
+
* @dochash types/os
|
|
1698
|
+
* @docname SetRoomTrackOptionsSuccess
|
|
1699
|
+
*/
|
|
689
1700
|
export interface SetRoomTrackOptionsSuccess {
|
|
690
1701
|
success: true;
|
|
1702
|
+
/**
|
|
1703
|
+
* The name of the room that the options were set on.
|
|
1704
|
+
*/
|
|
691
1705
|
roomName: string;
|
|
1706
|
+
/**
|
|
1707
|
+
* The address of the track that the options were set on.
|
|
1708
|
+
*/
|
|
692
1709
|
address: string;
|
|
1710
|
+
/**
|
|
1711
|
+
* The options that were set.
|
|
1712
|
+
*/
|
|
693
1713
|
options: RoomTrackOptions;
|
|
694
1714
|
}
|
|
1715
|
+
/**
|
|
1716
|
+
* Defines an interface that represents a failed "set room track options" request.
|
|
1717
|
+
*
|
|
1718
|
+
* @dochash types/os
|
|
1719
|
+
* @docname SetRoomTrackOptionsFailure
|
|
1720
|
+
*/
|
|
695
1721
|
export interface SetRoomTrackOptionsFailure {
|
|
696
1722
|
success: false;
|
|
1723
|
+
/**
|
|
1724
|
+
* The error code that describes why the request failed.
|
|
1725
|
+
*/
|
|
697
1726
|
errorCode: string;
|
|
1727
|
+
/**
|
|
1728
|
+
* The error message that describes why the request failed.
|
|
1729
|
+
*/
|
|
698
1730
|
errorMessage: string;
|
|
1731
|
+
/**
|
|
1732
|
+
* The name of the room that the options were attempted to be set on.
|
|
1733
|
+
*/
|
|
699
1734
|
roomName: string;
|
|
1735
|
+
/**
|
|
1736
|
+
* The address of the track that the options were attempted to be set on.
|
|
1737
|
+
*/
|
|
700
1738
|
address: string;
|
|
701
1739
|
}
|
|
1740
|
+
/**
|
|
1741
|
+
* The possible results for a "get room remote options" request.
|
|
1742
|
+
*
|
|
1743
|
+
* @dochash types/os
|
|
1744
|
+
* @docname GetRoomRemoteOptionsResult
|
|
1745
|
+
*/
|
|
702
1746
|
export type GetRoomRemoteOptionsResult = GetRoomRemoteOptionsSuccess | GetRoomRemoteOptionsFailure;
|
|
1747
|
+
/**
|
|
1748
|
+
* Defines an interface that represents a successful "get room remote options" request.
|
|
1749
|
+
*
|
|
1750
|
+
* @dochash types/os
|
|
1751
|
+
* @docname GetRoomRemoteOptionsSuccess
|
|
1752
|
+
*/
|
|
703
1753
|
export interface GetRoomRemoteOptionsSuccess {
|
|
704
1754
|
success: true;
|
|
1755
|
+
/**
|
|
1756
|
+
* The name of the room that the options were retrieved from.
|
|
1757
|
+
*/
|
|
705
1758
|
roomName: string;
|
|
1759
|
+
/**
|
|
1760
|
+
* The ID of the remote that the options were retrieved from.
|
|
1761
|
+
*/
|
|
706
1762
|
remoteId: string;
|
|
1763
|
+
/**
|
|
1764
|
+
* The options that were retrieved.
|
|
1765
|
+
*/
|
|
707
1766
|
options: RoomRemoteOptions;
|
|
708
1767
|
}
|
|
1768
|
+
/**
|
|
1769
|
+
* Defines an interface that represents a failed "get room remote options" request.
|
|
1770
|
+
*
|
|
1771
|
+
* @dochash types/os
|
|
1772
|
+
* @docname GetRoomRemoteOptionsFailure
|
|
1773
|
+
*/
|
|
709
1774
|
export interface GetRoomRemoteOptionsFailure {
|
|
710
1775
|
success: false;
|
|
1776
|
+
/**
|
|
1777
|
+
* The error code that describes why the request failed.
|
|
1778
|
+
*/
|
|
711
1779
|
errorCode: string;
|
|
1780
|
+
/**
|
|
1781
|
+
* The error message that describes why the request failed.
|
|
1782
|
+
*/
|
|
712
1783
|
errorMessage: string;
|
|
1784
|
+
/**
|
|
1785
|
+
* The name of the room that the options were attempted to be retrieved from.
|
|
1786
|
+
*/
|
|
713
1787
|
roomName: string;
|
|
1788
|
+
/**
|
|
1789
|
+
* The ID of the remote that the options were attempted to be retrieved from.
|
|
1790
|
+
*/
|
|
714
1791
|
remoteId: string;
|
|
715
1792
|
}
|
|
716
1793
|
/**
|
|
@@ -737,6 +1814,9 @@ export interface RecordFileOptions {
|
|
|
737
1814
|
}
|
|
738
1815
|
/**
|
|
739
1816
|
* Defines an interface that represents the result of a raycast operation.
|
|
1817
|
+
*
|
|
1818
|
+
* @dochash types/os
|
|
1819
|
+
* @docname RaycastResult
|
|
740
1820
|
*/
|
|
741
1821
|
export interface RaycastResult {
|
|
742
1822
|
/**
|
|
@@ -786,7 +1866,10 @@ export interface BotIntersection {
|
|
|
786
1866
|
dimension: string;
|
|
787
1867
|
}
|
|
788
1868
|
/**
|
|
789
|
-
* Defines an interface that represents a ray.
|
|
1869
|
+
* Defines an interface that represents a ray. That is, a line that has a start position and a direction, but no end.
|
|
1870
|
+
*
|
|
1871
|
+
* @dochash types/os
|
|
1872
|
+
* @docname RaycastRay
|
|
790
1873
|
*/
|
|
791
1874
|
export interface RaycastRay {
|
|
792
1875
|
/**
|
|
@@ -798,13 +1881,37 @@ export interface RaycastRay {
|
|
|
798
1881
|
*/
|
|
799
1882
|
direction: Vector3;
|
|
800
1883
|
}
|
|
1884
|
+
/**
|
|
1885
|
+
* Defines an interface that represents a file that was uploaded.
|
|
1886
|
+
*
|
|
1887
|
+
* @dochash types/os
|
|
1888
|
+
* @docname UploadedFile
|
|
1889
|
+
*/
|
|
1890
|
+
export interface UploadedFile {
|
|
1891
|
+
/**
|
|
1892
|
+
* The name of the file that was uploaded.
|
|
1893
|
+
*/
|
|
1894
|
+
name: string;
|
|
1895
|
+
/**
|
|
1896
|
+
* The size of the file in bytes.
|
|
1897
|
+
*/
|
|
1898
|
+
size: number;
|
|
1899
|
+
/**
|
|
1900
|
+
* The data that the file contains.
|
|
1901
|
+
*/
|
|
1902
|
+
data: string | ArrayBuffer;
|
|
1903
|
+
}
|
|
801
1904
|
/**
|
|
802
1905
|
* Creates a library that includes the default functions and APIs.
|
|
803
1906
|
* @param context The global context that should be used.
|
|
804
1907
|
*/
|
|
805
1908
|
export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
806
1909
|
api: {
|
|
807
|
-
|
|
1910
|
+
_getBots: (...filters: BotFilter[]) => RuntimeBot[];
|
|
1911
|
+
__getBots: (tag: string, value?: any) => RuntimeBot[];
|
|
1912
|
+
getBots: (...filters: any[]) => RuntimeBot[];
|
|
1913
|
+
_getBot: (...filters: BotFilter[]) => RuntimeBot;
|
|
1914
|
+
__getBot: (tag: string, value?: any) => RuntimeBot;
|
|
808
1915
|
getBot: (...args: any[]) => RuntimeBot;
|
|
809
1916
|
getBotTagValues: (tag: string, filter?: TagFilter) => any[];
|
|
810
1917
|
getMod: (bot: any, ...tags: (string | RegExp)[]) => Mod;
|
|
@@ -826,32 +1933,50 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
826
1933
|
deleteTagMaskText: (bot: RuntimeBot, tag: string, index: number, count: number, space?: string) => string;
|
|
827
1934
|
removeTags: (bot: Bot | Bot[], tagSection: string | RegExp) => void;
|
|
828
1935
|
renameTag: (bot: Bot | Bot[], originalTag: string, newTag: string) => void;
|
|
829
|
-
applyMod: (bot: any, ...
|
|
830
|
-
subtractMods: (bot: any, ...
|
|
1936
|
+
applyMod: (bot: any, ...mods: Mod[]) => void;
|
|
1937
|
+
subtractMods: (bot: any, ...mods: Mod[]) => void;
|
|
1938
|
+
_create: (...mods: Mod[]) => RuntimeBot | RuntimeBot[];
|
|
1939
|
+
_destroy: (bot: string | Bot | string[] | Bot[]) => void;
|
|
831
1940
|
destroy: {
|
|
832
1941
|
(bot: string | Bot | RuntimeBot | (string | Bot | RuntimeBot)[]): void;
|
|
833
1942
|
[INTERPRETABLE_FUNCTION]: (bot: string | Bot | RuntimeBot | (string | Bot | RuntimeBot)[]) => Generator<any, void, any>;
|
|
834
1943
|
};
|
|
1944
|
+
_changeState: (bot: Bot, stateName: string, groupName?: string) => void;
|
|
835
1945
|
changeState: {
|
|
836
1946
|
(bot: Bot, stateName: string, groupName?: string): void;
|
|
837
1947
|
[INTERPRETABLE_FUNCTION]: (bot: Bot, stateName: string, groupName?: string) => Generator<any, void, any>;
|
|
838
1948
|
};
|
|
839
1949
|
getLink: (...bots: (Bot | string | (Bot | string)[])[]) => string;
|
|
840
1950
|
getBotLinks: (bot: Bot) => ParsedBotLink[];
|
|
1951
|
+
_updateBotLinks: (bot: Bot, idMap: object) => void;
|
|
841
1952
|
updateBotLinks: (bot: Bot, idMap: Map<string, string | Bot> | {
|
|
842
1953
|
[id: string]: string | Bot;
|
|
843
1954
|
}) => void;
|
|
844
1955
|
getDateTime: (value: unknown) => DateTime;
|
|
845
1956
|
DateTime: typeof DateTime;
|
|
1957
|
+
/**
|
|
1958
|
+
* @hidden
|
|
1959
|
+
*/
|
|
846
1960
|
Vector2: typeof Vector2;
|
|
1961
|
+
/**
|
|
1962
|
+
* @hidden
|
|
1963
|
+
*/
|
|
847
1964
|
Vector3: typeof Vector3;
|
|
1965
|
+
/**
|
|
1966
|
+
* @hidden
|
|
1967
|
+
*/
|
|
848
1968
|
Quaternion: typeof Quaternion;
|
|
1969
|
+
/**
|
|
1970
|
+
* @hidden
|
|
1971
|
+
*/
|
|
849
1972
|
Rotation: typeof Rotation;
|
|
850
1973
|
superShout: (eventName: string, arg?: any) => SuperShoutAction;
|
|
1974
|
+
_priorityShout: (eventNames: string[], arg?: any) => any;
|
|
851
1975
|
priorityShout: {
|
|
852
1976
|
(eventNames: string[], arg?: any): any;
|
|
853
1977
|
[INTERPRETABLE_FUNCTION]: (eventNames: string[], arg?: any) => Generator<any, any, any>;
|
|
854
1978
|
};
|
|
1979
|
+
_shout: (name: string, arg?: any) => any;
|
|
855
1980
|
shout: {
|
|
856
1981
|
(name: string, arg?: any): any[];
|
|
857
1982
|
[name: string]: (arg?: any) => any[];
|
|
@@ -861,33 +1986,42 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
861
1986
|
[name: string]: (arg?: any) => Generator<any, any[], any>;
|
|
862
1987
|
};
|
|
863
1988
|
};
|
|
1989
|
+
_whisper: (bot: (Bot | string)[] | Bot | string, eventName: string, arg?: any) => any;
|
|
864
1990
|
whisper: {
|
|
865
1991
|
(bot: string | Bot | (string | Bot)[], eventName: string, arg?: any): any[];
|
|
866
1992
|
[INTERPRETABLE_FUNCTION]: (bot: string | Bot | (string | Bot)[], eventName: string, arg?: any) => Generator<any, any[], any>;
|
|
867
1993
|
};
|
|
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: (
|
|
1994
|
+
byTag: (tag: string, filter?: TagFilter) => BotFilter;
|
|
1995
|
+
byID: (id: string) => BotFilter;
|
|
1996
|
+
byMod: (mod: Mod) => BotFilter;
|
|
1997
|
+
inDimension: (dimension: string) => BotFilter;
|
|
1998
|
+
atPosition: (dimension: string, x: number, y: number) => BotFilter;
|
|
1999
|
+
inStack: (bot: Bot, dimension: string) => BotFilter;
|
|
2000
|
+
neighboring: (bot: Bot, dimension: string, direction?: 'front' | 'left' | 'right' | 'back') => BotFilter;
|
|
2001
|
+
bySpace: (space: string) => BotFilter;
|
|
2002
|
+
byCreator: (bot: Bot | string) => BotFilter;
|
|
2003
|
+
either: (...filters: BotFilter[]) => BotFilter;
|
|
2004
|
+
not: (filter: BotFilter) => BotFilter;
|
|
2005
|
+
remote: (action: BotAction, selector?: SessionSelector | string | (SessionSelector | string)[], allowBatching?: boolean) => RemoteAction | RemoteAction[];
|
|
880
2006
|
sendRemoteData: (remoteId: string | string[], name: string, arg?: any) => RemoteAction | RemoteAction[];
|
|
881
2007
|
remoteWhisper: (remoteId: string | string[], name: string, arg?: any) => RemoteAction | RemoteAction[];
|
|
882
2008
|
remoteShout: (name: string, arg?: any) => RemoteAction | RemoteAction[];
|
|
883
2009
|
uuid: () => string;
|
|
2010
|
+
_animateTag: (bot: RuntimeBot | string | (RuntimeBot | string)[], tag: string, options: AnimateTagFunctionOptions) => Promise<void>;
|
|
2011
|
+
__animateTag: (bot: RuntimeBot | string | (RuntimeBot | string)[], options: AnimateTagFunctionOptions) => Promise<void>;
|
|
884
2012
|
animateTag: {
|
|
885
2013
|
(bot: RuntimeBot | (RuntimeBot | string)[] | string, tag: string, options: AnimateTagFunctionOptions): Promise<void>;
|
|
886
2014
|
(bot: RuntimeBot | (RuntimeBot | string)[] | string, options: AnimateTagFunctionOptions): Promise<void>;
|
|
887
2015
|
};
|
|
888
2016
|
clearAnimations: (bot: RuntimeBot | (RuntimeBot | string)[] | string, tag?: string | string[]) => void;
|
|
889
2017
|
webhook: WebhookInterface;
|
|
2018
|
+
/**
|
|
2019
|
+
* @hidden
|
|
2020
|
+
*/
|
|
890
2021
|
sleep: (time: number) => Promise<void>;
|
|
2022
|
+
/**
|
|
2023
|
+
* @hidden
|
|
2024
|
+
*/
|
|
891
2025
|
__energyCheck: () => void;
|
|
892
2026
|
clearTimeout: (id: number) => void;
|
|
893
2027
|
clearInterval: (id: number) => void;
|
|
@@ -897,6 +2031,26 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
897
2031
|
assertEqual: (first: any, second: any) => void;
|
|
898
2032
|
expect: import("@casual-simulation/expect/src/types").Expect<import("@casual-simulation/expect/src/types").MatcherState>;
|
|
899
2033
|
html: HtmlFunction;
|
|
2034
|
+
/**
|
|
2035
|
+
* Gets the config bot (formerly known as the player bot).
|
|
2036
|
+
* This is the bot that represents the player's browser tab.
|
|
2037
|
+
*
|
|
2038
|
+
* It is `tempLocal` and is used to configure various portals.
|
|
2039
|
+
*
|
|
2040
|
+
* @example Get the config bot and set a username on it.
|
|
2041
|
+
* configBot.tags.username = "bob";
|
|
2042
|
+
*
|
|
2043
|
+
* @example Open the sheetPortal to "testDimension".
|
|
2044
|
+
* configBot.tags.sheetPortal = "testDimension";
|
|
2045
|
+
*
|
|
2046
|
+
* @dochash actions/os
|
|
2047
|
+
* @doctitle OS Actions
|
|
2048
|
+
* @docsidebar OS
|
|
2049
|
+
* @docdescription OS actions are used to interact with the player's current session.
|
|
2050
|
+
* @docname configBot
|
|
2051
|
+
* @docgroup 01-os
|
|
2052
|
+
*/
|
|
2053
|
+
readonly _configBot: RuntimeBot;
|
|
900
2054
|
os: {
|
|
901
2055
|
[x: symbol]: boolean;
|
|
902
2056
|
sleep: (time: number) => Promise<void>;
|
|
@@ -911,11 +2065,19 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
911
2065
|
setClipboard: (text: string) => SetClipboardAction;
|
|
912
2066
|
tweenTo: (bot: Bot | string, zoomValue?: number, rotX?: number, rotY?: number, duration?: number) => FocusOnBotAction;
|
|
913
2067
|
moveTo: (bot: Bot | string, zoomValue?: number, rotX?: number, rotY?: number) => FocusOnBotAction;
|
|
2068
|
+
_focusOn_bot: (bot: Bot | string, options?: FocusOnOptions) => Promise<void>;
|
|
2069
|
+
_focusOn_position: (position: {
|
|
2070
|
+
x: number;
|
|
2071
|
+
y: number;
|
|
2072
|
+
z?: number;
|
|
2073
|
+
}, options?: FocusOnOptions) => Promise<void>;
|
|
914
2074
|
focusOn: (botOrPosition: Bot | string | {
|
|
915
2075
|
x: number;
|
|
916
2076
|
y: number;
|
|
917
2077
|
z?: number;
|
|
918
2078
|
}, options?: FocusOnOptions) => Promise<void>;
|
|
2079
|
+
_showChat_placeholder: (placeholder?: string) => void;
|
|
2080
|
+
_showChat_options: (options?: ShowChatOptions) => void;
|
|
919
2081
|
showChat: (placeholderOrOptions?: string | ShowChatOptions) => ShowChatBarAction;
|
|
920
2082
|
hideChat: () => ShowChatBarAction;
|
|
921
2083
|
run: (script: string) => Promise<any>;
|
|
@@ -927,8 +2089,8 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
927
2089
|
disableAR: () => EnableARAction;
|
|
928
2090
|
enableVR: (options?: EnableXROptions) => EnableVRAction;
|
|
929
2091
|
disableVR: () => EnableVRAction;
|
|
930
|
-
arSupported: () => Promise<
|
|
931
|
-
vrSupported: () => Promise<
|
|
2092
|
+
arSupported: () => Promise<boolean>;
|
|
2093
|
+
vrSupported: () => Promise<boolean>;
|
|
932
2094
|
enablePointOfView: (center?: {
|
|
933
2095
|
x: number;
|
|
934
2096
|
y: number;
|
|
@@ -944,7 +2106,7 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
944
2106
|
downloadServer: () => DownloadAction;
|
|
945
2107
|
downloadInst: () => DownloadAction;
|
|
946
2108
|
showUploadAuxFile: () => ShowUploadAuxFileAction;
|
|
947
|
-
showUploadFiles: () => Promise<
|
|
2109
|
+
showUploadFiles: () => Promise<UploadedFile[]>;
|
|
948
2110
|
openQRCodeScanner: (camera?: CameraType) => OpenQRCodeScannerAction;
|
|
949
2111
|
closeQRCodeScanner: () => OpenQRCodeScannerAction;
|
|
950
2112
|
showQRCode: (code: string) => ShowQRCodeAction;
|
|
@@ -956,29 +2118,72 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
956
2118
|
openImageClassifier: (options: ImageClassifierOptions) => Promise<void>;
|
|
957
2119
|
closeImageClassifier: () => Promise<void>;
|
|
958
2120
|
/**
|
|
959
|
-
* Gets the local
|
|
2121
|
+
* 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.
|
|
2122
|
+
*
|
|
2123
|
+
* @example Toast the number of miliseconds since the Unix Epoch
|
|
2124
|
+
* os.toast(os.localTime);
|
|
2125
|
+
*
|
|
2126
|
+
* @dochash actions/time
|
|
2127
|
+
* @doctitle Time Actions
|
|
2128
|
+
* @docsidebar Time
|
|
2129
|
+
* @docdescription Time actions make working with time across devices easy.
|
|
2130
|
+
* @docgroup 01-time
|
|
2131
|
+
* @docname os.localTime
|
|
960
2132
|
*/
|
|
961
2133
|
readonly localTime: number;
|
|
962
2134
|
/**
|
|
963
|
-
* Gets the
|
|
2135
|
+
* 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).
|
|
2136
|
+
* This is what your device's clock thinks the inst clock says.
|
|
2137
|
+
*
|
|
2138
|
+
* If an agreed upon time cannot be determined (for example, because collaboration is disabled in the inst), then this value will always be `NaN`.
|
|
2139
|
+
*
|
|
2140
|
+
* @example Toast the current shared time
|
|
2141
|
+
* os.toast(os.agreedUponTime);
|
|
2142
|
+
*
|
|
2143
|
+
* @dochash actions/time
|
|
2144
|
+
* @docgroup 01-time
|
|
2145
|
+
* @docname os.agreedUponTime
|
|
964
2146
|
*/
|
|
965
2147
|
readonly agreedUponTime: number;
|
|
966
2148
|
/**
|
|
967
|
-
* Gets the
|
|
2149
|
+
* 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.
|
|
2150
|
+
*
|
|
2151
|
+
* If an agreed upon time cannot be determined (for example, because collaboration is disabled in the inst), then this value will always be `NaN`.
|
|
2152
|
+
*
|
|
2153
|
+
* @dochash actions/time
|
|
2154
|
+
* @docgroup 01-time
|
|
2155
|
+
* @docname os.instLatency
|
|
968
2156
|
*/
|
|
969
2157
|
readonly instLatency: number;
|
|
970
2158
|
/**
|
|
971
|
-
* Gets the calculated time offset between
|
|
2159
|
+
* Gets the calculated time offset between the inst clock and the local clock. This value is equivalent to `os.agreedUponTime - os.localTime`.
|
|
2160
|
+
*
|
|
2161
|
+
* If an agreed upon time cannot be determined (for example, because collaboration is disabled in the inst), then this value will always be `NaN`.
|
|
2162
|
+
*
|
|
2163
|
+
* @dochash actions/time
|
|
2164
|
+
* @docgroup 01-time
|
|
2165
|
+
* @docname os.instTimeOffset
|
|
972
2166
|
*/
|
|
973
2167
|
readonly instTimeOffset: number;
|
|
974
2168
|
/**
|
|
975
|
-
* Gets the
|
|
976
|
-
*
|
|
2169
|
+
* 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.
|
|
2170
|
+
*
|
|
2171
|
+
* If an agreed upon time cannot be determined (for example, because collaboration is disabled in the inst), then this value will always be `NaN`.
|
|
2172
|
+
*
|
|
2173
|
+
* @dochash actions/time
|
|
2174
|
+
* @docgroup 01-time
|
|
2175
|
+
* @docname os.instTimeOffsetSpread
|
|
977
2176
|
*/
|
|
978
2177
|
readonly instTimeOffsetSpread: number;
|
|
979
2178
|
/**
|
|
980
|
-
* Gets the
|
|
981
|
-
* changes/events will
|
|
2179
|
+
* Gets the shared time that has been agreed upon between devices but with an additional 50ms offset added.
|
|
2180
|
+
* 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.
|
|
2181
|
+
*
|
|
2182
|
+
* If an agreed upon time cannot be determined (for example, because collaboration is disabled in the inst), then this value will always be `NaN`.
|
|
2183
|
+
*
|
|
2184
|
+
* @dochash actions/time
|
|
2185
|
+
* @docgroup 01-time
|
|
2186
|
+
* @docname os.deadReckoningTime
|
|
982
2187
|
*/
|
|
983
2188
|
readonly deadReckoningTime: number;
|
|
984
2189
|
loadServer: (id: string) => LoadServerAction;
|
|
@@ -987,7 +2192,7 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
987
2192
|
unloadInst: (id: string) => UnloadServerAction;
|
|
988
2193
|
importAUX: (urlOrJSON: string) => Promise<void>;
|
|
989
2194
|
parseBotsFromData: (jsonOrPdf: string | ArrayBuffer) => Bot[];
|
|
990
|
-
replaceDragBot: (bot:
|
|
2195
|
+
replaceDragBot: (bot: RuntimeBot) => ReplaceDragBotAction;
|
|
991
2196
|
isInDimension: (dimension: string) => boolean;
|
|
992
2197
|
getCurrentDimension: () => string;
|
|
993
2198
|
getCurrentServer: () => string;
|
|
@@ -997,6 +2202,7 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
997
2202
|
getPortalDimension: (portal: PortalType) => string;
|
|
998
2203
|
getDimensionalDepth: (dimension: string) => number;
|
|
999
2204
|
showInputForTag: (bot: Bot | string, tag: string, options?: Partial<ShowInputOptions>) => ShowInputForTagAction;
|
|
2205
|
+
_showInput: (currentValue?: any, options?: Partial<ShowInputOptions>) => Promise<any>;
|
|
1000
2206
|
showInput: ((currentValue?: any, options?: Partial<ShowInputOptions>) => Promise<any>) & MaskableFunction;
|
|
1001
2207
|
showConfirm: (options: ShowConfirmOptions) => Promise<boolean>;
|
|
1002
2208
|
goToDimension: (dimension: string) => GoToDimensionAction;
|
|
@@ -1046,8 +2252,8 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1046
2252
|
getRoomRemoteOptions: (roomName: string, remoteId: string) => Promise<GetRoomRemoteOptionsResult>;
|
|
1047
2253
|
registerTagPrefix: (prefix: string, options?: RegisterPrefixOptions) => Promise<void>;
|
|
1048
2254
|
registerApp: (portalId: string, bot: Bot | string) => Promise<void>;
|
|
1049
|
-
unregisterApp: (
|
|
1050
|
-
compileApp: (
|
|
2255
|
+
unregisterApp: (appId: string) => Promise<void>;
|
|
2256
|
+
compileApp: (appId: string, content: any) => SetAppOutputAction;
|
|
1051
2257
|
appHooks: {
|
|
1052
2258
|
render: typeof render;
|
|
1053
2259
|
useState<S>(initialState: S | (() => S)): [S, hooks.StateUpdater<S>];
|
|
@@ -1070,35 +2276,39 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1070
2276
|
requestAuthBot: () => Promise<Bot>;
|
|
1071
2277
|
getPublicRecordKey: (name: string) => Promise<CreatePublicRecordKeyResult>;
|
|
1072
2278
|
getSubjectlessPublicRecordKey: (name: string) => Promise<CreatePublicRecordKeyResult>;
|
|
1073
|
-
grantRecordMarkerPermission: (recordName: string, marker: string, permission:
|
|
1074
|
-
revokeRecordMarkerPermission: (recordName: string, marker: string, permission:
|
|
2279
|
+
grantRecordMarkerPermission: (recordName: string, marker: string, permission: AvailablePermissions, options?: RecordActionOptions) => Promise<GrantMarkerPermissionResult>;
|
|
2280
|
+
revokeRecordMarkerPermission: (recordName: string, marker: string, permission: AvailablePermissions, options?: RecordActionOptions) => Promise<RevokeMarkerPermissionResult>;
|
|
1075
2281
|
grantInstAdminPermission: (recordName: string, options?: RecordActionOptions) => Promise<GrantRoleResult>;
|
|
1076
2282
|
grantUserRole: (recordName: string, role: string, userId: string, expireTimeMs?: number, options?: RecordActionOptions) => Promise<GrantRoleResult>;
|
|
1077
2283
|
revokeUserRole: (recordName: string, role: string, userId: string, options?: RecordActionOptions) => Promise<RevokeRoleResult>;
|
|
1078
2284
|
grantInstRole: (recordName: string, role: string, inst: string, expireTimeMs?: number, options?: RecordActionOptions) => Promise<GrantRoleResult>;
|
|
1079
2285
|
revokeInstRole: (recordName: string, role: string, inst: string, options?: RecordActionOptions) => Promise<RevokeRoleResult>;
|
|
1080
2286
|
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>;
|
|
2287
|
+
recordData: (recordKeyOrRecordName: string, address: string, data: any, endpointOrOptions?: string | DataRecordOptions) => Promise<RecordDataResult>;
|
|
2288
|
+
recordManualApprovalData: (recordKeyOrRecordName: string, address: string, data: any, endpointOrOptions?: string | DataRecordOptions) => Promise<RecordDataResult>;
|
|
1087
2289
|
getData: (recordKeyOrName: string, address: string, endpoint?: string) => Promise<GetDataResult>;
|
|
1088
2290
|
getManualApprovalData: (recordKeyOrName: string, address: string, endpoint?: string) => Promise<GetDataResult>;
|
|
1089
2291
|
listData: (recordKeyOrName: string, startingAddress?: string, endpoint?: string) => Promise<ListDataResult>;
|
|
1090
|
-
eraseData: (
|
|
1091
|
-
eraseManualApprovalData: (
|
|
1092
|
-
recordFile: (
|
|
2292
|
+
eraseData: (recordKeyOrName: string, address: string, endpoint?: string) => Promise<EraseDataResult>;
|
|
2293
|
+
eraseManualApprovalData: (recordKeyOrName: string, address: string, endpoint?: string) => Promise<EraseDataResult>;
|
|
2294
|
+
recordFile: (recordKeyOrName: string, data: any, options?: RecordFileOptions, endpoint?: string) => Promise<RecordFileApiResult>;
|
|
1093
2295
|
getFile: {
|
|
2296
|
+
(result: RecordFileApiSuccess, endpoint?: string): Promise<any>;
|
|
2297
|
+
(url: string, endpoint?: string): Promise<any>;
|
|
2298
|
+
};
|
|
2299
|
+
getPublicFile: {
|
|
1094
2300
|
(result: RecordFileApiSuccess): Promise<any>;
|
|
1095
2301
|
(url: string): Promise<any>;
|
|
1096
2302
|
};
|
|
2303
|
+
getPrivateFile: {
|
|
2304
|
+
(result: RecordFileApiSuccess, endpoint?: string): Promise<any>;
|
|
2305
|
+
(url: string, endpoint?: string): Promise<any>;
|
|
2306
|
+
};
|
|
1097
2307
|
eraseFile: {
|
|
1098
|
-
(
|
|
1099
|
-
(
|
|
2308
|
+
(recordKeyOrName: string, result: RecordFileApiSuccess, endpoint?: string): Promise<EraseFileResult>;
|
|
2309
|
+
(recordKeyOrName: string, url: string, endpoint?: string): Promise<EraseFileResult>;
|
|
1100
2310
|
};
|
|
1101
|
-
recordEvent: (
|
|
2311
|
+
recordEvent: (recordKeyOrName: string, eventName: string, endpoint?: string) => Promise<AddCountResult>;
|
|
1102
2312
|
countEvents: (recordNameOrKey: string, eventName: string, endpoint?: string) => Promise<GetCountResult>;
|
|
1103
2313
|
convertGeolocationToWhat3Words: (location: ConvertGeolocationToWhat3WordsOptions) => Promise<string>;
|
|
1104
2314
|
raycastFromCamera: (portal: 'grid' | 'miniGrid' | 'map' | 'miniMap', viewportCoordinates: Vector2) => Promise<RaycastResult>;
|
|
@@ -1130,6 +2340,11 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1130
2340
|
meetCommand: (command: string, ...args: any) => Promise<void>;
|
|
1131
2341
|
meetFunction: (functionName: string, ...args: any[]) => Promise<any>;
|
|
1132
2342
|
readonly vars: any;
|
|
2343
|
+
_createDebugger_normal: (options?: NormalDebuggerOptions) => Promise<NormalDebugger>;
|
|
2344
|
+
_createDebugger_pausable: (options: PausableDebuggerOptions) => Promise<PausableDebugger>;
|
|
2345
|
+
_getExecutingDebugger: () => Debugger;
|
|
2346
|
+
_attachDebugger: (debug: Debugger, options?: AttachDebuggerOptions) => Promise<void>;
|
|
2347
|
+
_detachDebugger: (debug: Debugger) => Promise<void>;
|
|
1133
2348
|
};
|
|
1134
2349
|
portal: {
|
|
1135
2350
|
registerPrefix: (prefix: string, options?: RegisterPrefixOptions) => Promise<void>;
|
|
@@ -1206,6 +2421,9 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1206
2421
|
perform: (action: any) => any;
|
|
1207
2422
|
reject: (action: any) => RejectAction;
|
|
1208
2423
|
};
|
|
2424
|
+
/**
|
|
2425
|
+
* @hidden
|
|
2426
|
+
*/
|
|
1209
2427
|
adminSpace: {
|
|
1210
2428
|
unlock: (password: string) => Promise<void>;
|
|
1211
2429
|
setPassword: (oldPassword: string, newPassword: string) => Promise<void>;
|
|
@@ -1301,12 +2519,16 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1301
2519
|
fromHexString: (hex: string) => Uint8Array;
|
|
1302
2520
|
};
|
|
1303
2521
|
crypto: {
|
|
2522
|
+
_hash_raw: (algorithm: 'sha256' | 'sha512' | 'sha1', format: 'raw', ...data: unknown[]) => Uint8Array;
|
|
2523
|
+
_hash_string: (algorithm: 'sha256' | 'sha512' | 'sha1', format: 'hex' | 'base64', ...data: unknown[]) => string;
|
|
1304
2524
|
hash: {
|
|
1305
2525
|
(algorithm: 'sha256' | 'sha512' | 'sha1', format: 'hex' | 'base64', ...data: unknown[]): string;
|
|
1306
2526
|
(algorithm: 'sha256' | 'sha512' | 'sha1', format: 'raw', ...data: unknown[]): Uint8Array;
|
|
1307
2527
|
};
|
|
1308
2528
|
sha256: (...data: unknown[]) => string;
|
|
1309
2529
|
sha512: (...data: unknown[]) => string;
|
|
2530
|
+
_hmac_string: (algorithm: 'sha256' | 'sha512' | 'sha1', format: 'hex' | 'base64', key: string, ...data: unknown[]) => string;
|
|
2531
|
+
_hmac_raw: (algorithm: 'sha256' | 'sha512' | 'sha1', format: 'raw', key: string, ...data: unknown[]) => Uint8Array;
|
|
1310
2532
|
hmac: {
|
|
1311
2533
|
(algorithm: 'hmac-sha256' | 'hmac-sha512' | 'hmac-sha1', format: 'hex' | 'base64', key: string, ...data: unknown[]): string;
|
|
1312
2534
|
(algorithm: 'hmac-sha256' | 'hmac-sha512' | 'hmac-sha1', format: 'raw', key: string, ...data: unknown[]): Uint8Array;
|
|
@@ -1335,6 +2557,9 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1335
2557
|
getStats: () => PerformanceStats;
|
|
1336
2558
|
};
|
|
1337
2559
|
web: {
|
|
2560
|
+
_webGet: (url: string, options?: WebhookOptions) => Promise<WebhookResult>;
|
|
2561
|
+
_webPost: (url: string, data?: any, options?: WebhookOptions) => Promise<WebhookResult>;
|
|
2562
|
+
_webHook: (options: WebhookOptions) => Promise<WebhookResult>;
|
|
1338
2563
|
get: ((url: string, options?: WebhookOptions) => Promise<WebhookResult>) & MaskableFunction;
|
|
1339
2564
|
post: ((url: string, data?: any, options?: WebhookOptions) => Promise<WebhookResult>) & MaskableFunction;
|
|
1340
2565
|
hook: {
|
|
@@ -1356,5 +2581,6 @@ export declare function createDefaultLibrary(context: AuxGlobalContext): {
|
|
|
1356
2581
|
watchBot: (options: TagSpecificApiOptions) => (bot: (Bot | string)[] | Bot | string, handler: () => void | Generator<InterpreterStop, any, InterpreterContinuation>) => number;
|
|
1357
2582
|
};
|
|
1358
2583
|
};
|
|
2584
|
+
export type DefaultLibrary = ReturnType<typeof createDefaultLibrary>;
|
|
1359
2585
|
export {};
|
|
1360
2586
|
//# sourceMappingURL=AuxLibrary.d.ts.map
|