-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathopenspace-api-js.d.ts
More file actions
2333 lines (2118 loc) · 129 KB
/
openspace-api-js.d.ts
File metadata and controls
2333 lines (2118 loc) · 129 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*****************************************************************************************
* *
* OpenSpace-api-js *
* *
* Copyright (c) 2024-2025 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
declare module "openspace-api-js" {
export class OpenSpaceApi {
/**
* Construct an instance of the OpenSpace API.
* @param socket An instance of Socket or WebSocket.
* The socket should not be connected prior to calling this constructor.
*/
constructor(socket: SocketWrapper | WebSocketWrapper);
/**
* Set connect callback.
* @param callback The function to execute when connection is established.
*/
onConnect(callback: () => void): void;
/**
* Set disconnect callback.
* @param callback The function to execute when socket is disconnected.
*/
onDisconnect(callback: () => void): void;
/**
* Connect to OpenSpace.
*/
connect(): void;
/**
* Disconnect from OpenSpace.
*/
disconnect(): void;
/**
* Initialize a new channel of communication
* @param type A string specifying the type of topic to construct.
* See OpenSpace's server module for available topic types.
* @param payload The JavaScript object to send. Must be possible to encode to JSON.
*
* @return An object representing the topic.
*/
startTopic(type: string, payload: object): Topic;
/**
* Authenticate this client.
* This must be done if the client is not whitelisted in openspace.cfg.
* @param secret The secret used to authenticate with OpenSpace.
*
* @return An object promise whether user was succesfully authorized.
*/
authenticate(secret: string): Promise<object>;
/**
* Set a property
* @param property The URI of the property to set.
* @param value - The value to set the property to.
*/
setProperty(property: string, value: unknown): void;
/**
* Get a property
* @param property The URI of the property to set.
*
* @return The value of the property.
*/
getProperty(property: string): Promise<unknown>;
/**
* Get a documentation object
* @param type The type of documentation to get.
* For available types, check documentationtopic.cpp in OpenSpace's
* server module.
*
* @return An object representing the requested documentation.
*/
getDocumentation(type: string): Promise<object>;
/**
* Subscribe to a property
* @param property The URI of the property.
*
* @return A topic object to represent the subscription topic.
* When cancelled, this object will unsubscribe to the property.
*/
subscribeToProperty(property: string): Topic;
/**
* Execute a lua script
* @param script The lua script to execute.
* @param getReturnValue Specified whether the return value should be collected.
* @param houldBeSynchronized Specified whether the script should be synchronized on a
* cluster
* @return The return value of the script, if `getReturnValue` is true, otherwise
* undefined.
*/
executeLuaScript(
script: string,
getReturnValue: boolean,
shouldBeSynchronized: boolean,
): Promise<unknown | undefined>;
/**
* Execute a lua function from the OpenSpace library
* @param function The lua function to execute (for example
* `openspace.addSceneGraphNode`).
* @param args The function arguments.
* @param getReturnValue Specified whether the return value should be collected.
*
* @return The return value of the script, if `getReturnValue` is true, otherwise
* undefined.
*/
executeLuaFunction(
fun: string,
args: unknown[],
getReturnValue: boolean,
): Promise<unknown | undefined>;
/**
* Get an object representing the OpenSpace lua library.
* @param MultiReturn Whether the library should return the raw lua tables.
* If this value is true, the 1-indexed lua table will be returned
* as a JavaScript object. If the value is false, then only the
* first return value will be returned
*
* @return The lua library, mapped to async JavaScript functions.
*/
library(multireturn?: boolean | undefined): Promise<OpenSpace.openspace>;
/**
* Get an object representing the OpenSpace lua library.
* @return The lua library, mapped to async JavaScript functions.
* This method only returns the first return value.
*/
singleReturnLibrary(): Promise<OpenSpace.openspace>;
/**
* Get an object representing the OpenSpace lua library.
* @return The lua library, mapped to async JavaScript functions.
* The values returned by the async functions will be the entire lua tables,
* with 1-indexed values.
*/
multiReturnLibrary(): Promise<OpenSpace.openspace>;
}
export class SocketWrapper {
/** Internal usage only */
constructor(address: string, port: number);
onConnect(cb: () => void): void;
onDisconnect(cb: () => void): void;
onMessage(cb: (message: string) => void): void;
connect(): void;
send(message: any): void;
disconnect(): void;
}
export class WebSocketWrapper {
/** Internal usage only */
constructor(address: string, port: number);
onConnect(cb: () => void): void;
onDisconnect(cb: () => void): void;
onMessage(cb: (message: string) => void): void;
connect(): void;
send(message: any): void;
disconnect(): void;
}
export class Topic {
/** Internal usage only */
constructor(
iterator: AsyncGenerator<any, void, unknown>,
talk: (payload: any) => void,
cancel: () => void,
);
/**
* Send data within a topic
* @param {object} data - The JavaScript object to send.
* Must be possible to encode into JSON.
*/
talk(data: any): void;
/**
* Get the async iterator used to get data from OpenSpace.
*/
iterator(): AsyncGenerator<any, void, unknown>;
/**
* Cancel the topic.
*/
cancel(): void;
}
export default function (host: string, port: number): OpenSpaceApi;
} // module OpenSpaceApi
/* The following declarations are automatically generated from the OpenSpace lua library */
declare namespace OpenSpace {
type path = string;
type table = object;
type action = object;
type custompropertytype = any;
type integer = number;
type vec2 = [number, number];
type vec3 = [number, number, number];
type vec4 = [number, number, number, number];
type mat2x2 = { 1: number; 2: number; 3: number; 4: number; };
type mat3x3 = { 1: number; 2: number; 3: number; 4: number; 5: number;6: number; 7: number; 8: number; 9: number; };
type mat4x4 = { 1: number; 2: number; 3: number; 4: number; 5: number;6: number; 7: number; 8: number; 9: number; 10: number; 11: number;12: number; 13: number; 14: number; 15: number; 16: number; };
type translation = object;
type spicekernel = path;
type easingfunction = "Linear" | "QuadraticEaseIn" | "QuadraticEaseOut" |"QuadraticEaseInOut" | "CubicEaseIn" | "CubicEaseOut" | "CubicEaseInOut"|"QuarticEaseIn" | "QuarticEaseOut" | "QuarticEaseInOut" | "QuinticEaseIn" |"QuinticEaseOut" | "QuinticEaseInOut" | "SineEaseIn" | "SineEaseOut" | "SineEaseInOut" |"CircularEaseIn" | "CircularEaseOut" | "CircularEaseInOut" | "ExponentialEaseIn" | "ExponentialEaseOut" | "ExponentialEaseInOut" | "ElasticEaseIn" | "ElasticEaseOut" |"ElasticEaseInOut" | "BounceEaseIn" | "BounceEaseOut" | "BounceEaseInOut"
export interface openspace {
action: actionLibrary;
asset: assetLibrary;
audio: audioLibrary;
dashboard: dashboardLibrary;
debugging: debuggingLibrary;
event: eventLibrary;
exoplanets: exoplanetsLibrary;
gaia: gaiaLibrary;
globebrowsing: globebrowsingLibrary;
iswa: iswaLibrary;
keyframeRecording: keyframeRecordingLibrary;
modules: modulesLibrary;
navigation: navigationLibrary;
openglCapabilities: openglCapabilitiesLibrary;
orbitalnavigation: orbitalnavigationLibrary;
parallel: parallelLibrary;
pathnavigation: pathnavigationLibrary;
scriptScheduler: scriptSchedulerLibrary;
sessionRecording: sessionRecordingLibrary;
skybrowser: skybrowserLibrary;
sonification: sonificationLibrary;
space: spaceLibrary;
spice: spiceLibrary;
statemachine: statemachineLibrary;
sync: syncLibrary;
systemCapabilities: systemCapabilitiesLibrary;
telemetry: telemetryLibrary;
time: timeLibrary;
/**
* Passes the argument to FileSystem::absolutePath, which resolves occuring path tokens and returns the absolute path.
*/
absPath: (path: string) => Promise<path>
/**
* Creates a new property that lives in the `UserProperty` group.
\\param identifier The identifier that is going to be used for the new property \\param type The type of the property, has to be one of \"DMat2Property\", \"DMat3Property\", \"DMat4Property\", \"Mat2Property\", \"Mat3Property\", \"Mat4Property\", \"BoolProperty\", \"DoubleProperty\", \"FloatProperty\", \"IntProperty\", \"StringProperty\", \"StringListProperty\", \"LongProperty\", \"ShortProperty\", \"UIntProperty\", \"ULongProperty\", \"DVec2Property\", \"DVec3Property\", \"DVec4Property\", \"IVec2Property\", \"IVec3Property\", \"IVec4Property\", \"UVec2Property\", \"UVec3Property\", \"UVec4Property\", \"Vec2Property\", \"Vec3Property\", \"Vec4Property\" \\param guiName The name that the property uses in the user interface. If this value is not provided, the `identifier` is used instead \\param description A description what the property is used for \\param onChange A Lua script that will be executed whenever the property changes
*/
addCustomProperty: (identifier: string, type: custompropertytype, guiName?: string, description?: string, onChange?: string) => Promise<void>
/**
* Loads the SceneGraphNode described in the table and adds it to the SceneGraph.
*/
addSceneGraphNode: (node: table) => Promise<void>
/**
* / Will create a ScreenSpaceRenderable from a lua Table and add it in the RenderEngine
*/
addScreenSpaceRenderable: (screenSpace: table) => Promise<void>
/**
* Adds a Tag to a SceneGraphNode identified by the provided uri
*/
addTag: (uri: string, tag: string) => Promise<void>
/**
* Add a value to the property with the given identifier. Works on both
numerical and string properties, where adding to a string property means appending
the given string value to the existing string value.
*/
addToPropertyValue: (identifier: string, value: string | number) => Promise<void>
/**
* Add a value to the list property with the given identifier. The
value can be any type, as long as it is the correct type for the given property.
Note that a number will be converted to a string automatically.
*/
appendToListProperty: (identifier: string, value: any) => Promise<void>
/**
* Binds a key to Lua command to both execute locally and broadcast to all clients if this node is hosting a parallel connection.
*/
bindKey: (key: string, action: string) => Promise<void>
/**
* Returns the bounding sphere of the scene graph node with the given string as identifier.
*/
boundingSphere: (identifier: string) => Promise<number>
/**
* Unbinds the key or keys that have been provided. This function can be called with a single key or with an array of keys to remove all of the provided keys at once.
*/
clearKey: (key: string | string[]) => Promise<void>
/**
* Clear all key bindings
*/
clearKeys: () => Promise<void>
/**
* Returns the whole configuration object as a Dictionary
*/
configuration: () => Promise<table>
/**
* Creates a directory at the provided path, returns true if directory was newly created and false otherwise. If `recursive` flag is set to true, it will automatically create any missing parent folder as well
*/
createDirectory: (path: path, recursive?: boolean) => Promise<boolean>
/**
* Creates a 1 pixel image with a certain color in the cache folder and returns the path to the file. If a cached file with the given name already exists, the path to that file is returned. The first argument is the name of the file, without extension. The second is the RGB color, given as {r, g, b} with values between 0 and 1.
*/
createSingleColorImage: (name: string, color: vec3) => Promise<path>
/**
* Checks whether the provided directory exists.
*/
directoryExists: (file: path) => Promise<boolean>
/**
* This function extracts the directory part of the passed path. For example, if the parameter is 'C:\\\\OpenSpace\\\\foobar\\\\foo.txt', this function returns 'C:\\\\OpenSpace\\\\foobar'.
*/
directoryForPath: (file: path) => Promise<path>
/**
* Downloads a file from Lua interpreter
*/
downloadFile: (url: string, savePath: string, waitForCompletion?: boolean, overrideExistingFile?: boolean) => Promise<void>
/**
* Extracts the DPI scaling for either the GUI window or if there is no dedicated GUI window, the first window.
*/
dpiScaling: () => Promise<number>
/**
* Fades in the node(s) with the given identifier over the given time
in seconds. The identifier can contain a tag and/or a wildcard to target several
nodes. If the fade time is not provided then the 'OpenSpaceEngine.FadeDuration'
property will be used instead. If the third argument (endScript) is provided then
that script will be run after the fade is finished.
*/
fadeIn: (identifier: string, fadeTime?: number, endScript?: string) => Promise<void>
/**
* Fades out the node(s) with the given identifier over the given time
in seconds. The identifier can contain a tag and/or a wildcard to target several
nodes. If the fade time is not provided then the 'OpenSpaceEngine.FadeDuration'
property will be used instead. If the third argument (endScript) is provided then
that script will be run after the fade is finished.
*/
fadeOut: (identifier: string, fadeTime?: number, endScript?: string) => Promise<void>
/**
* Checks whether the provided file exists.
*/
fileExists: (file: string) => Promise<boolean>
/**
* Get a dictionary containing the current map with custom orderings for the Scene GUI tree. Each key in the dictionary corresponds to a branch in the tree, i.e. a specific GUI path.
*/
guiOrder: () => Promise<table>
/**
* Returns whether a mission with the provided name has been loaded.
*/
hasMission: (identifier: string) => Promise<boolean>
/**
* Returns whether a property with the given URI exists. The `uri` identifies the property or properties that are checked by this function and can include both wildcards `*` which match anything, as well as tags (`{tag}`) which match scene graph nodes that have this tag. There is also the ability to combine two tags through the `&`, `|`, and `~` operators. `{tag1&tag2}` will match anything that has the tag1 and the tag2. `{tag1|tag2}` will match anything that has the tag1 or the tag 2, and `{tag1~tag2}` will match anything that has tag1 but not tag2. If no wildcards or tags are provided at most one property value will be changed. With wildcards or tags all properties that match the URI are changed instead.
\\param uri The URI that identifies the property or properties whose values should be changed. The URI can contain 0 or 1 wildcard `*` characters or a tag expression (`{tag}`) that identifies a property owner.
*/
hasProperty: (uri: string) => Promise<boolean>
/**
* Checks whether the specifies SceneGraphNode is present in the current scene.
*/
hasSceneGraphNode: (nodeName: string) => Promise<boolean>
/**
* Returns the interaction sphere of the scene graph node with the given string as identifier.
*/
interactionSphere: (identifier: string) => Promise<number>
/**
* Inverts the value of a boolean property with the given identifier.
*/
invertBooleanProperty: (identifier: string) => Promise<void>
/**
* A utility function to check whether an object is empty or not. Identifies `nil`
objects, Tables without any keys, and empty strings.
\\param object The object to check
\\return A Boolean that specifies if the object is empty or not
*/
isEmpty: (object: any) => Promise<boolean>
/**
* Returns whether the current OpenSpace instance is the master node of a cluster configuration. If this instance is not part of a cluster, this function also returns 'true'.
*/
isMaster: () => Promise<boolean>
/**
* Returns the identifiers of the action that are bound to the passed key and whether they were local or remote key binds. If no key is provided, all bound keybindings are returned instead.
\\param key The key for which to return the keybindings. If no key is provided, all keybindings are returned
*/
keyBindings: (key?: string) => Promise<string[]>
/**
* Returns the keybinds to which the provided action is bound. As actions can be bound to multiple keys, this function returns a list of all keys
*/
keyBindingsForAction: (action: string) => Promise<string[]>
/**
* Returns the current layer server from the configuration
*/
layerServer: () => Promise<string>
/**
* Loads the provided JSON file and returns it back to the caller. Please note that if the JSON contains keys that array of an array type, they are converted into a Dictionary with numerical keys and the numerical keys start with 1.
*/
loadJson: (path: path) => Promise<table>
/**
* Load mission phases from file.
*/
loadMission: (mission: table) => Promise<void>
/**
* Create a valid identifier from the provided input string. Will replace invalid characters like whitespaces and some punctuation marks with valid alternatives
*/
makeIdentifier: (input: string) => Promise<string>
/**
* This function marks the scene graph nodes identified by name as
interesting, which will provide shortcut access to focus buttons and featured
properties.
*/
markInterestingNodes: (sceneGraphNodes: string[]) => Promise<void>
/**
* This function marks interesting times for the current scene, which
will create shortcuts for a quick access.
*/
markInterestingTimes: (times: table[]) => Promise<void>
/**
* Returns a list of all scene graph nodes in the scene that have a renderable of the specific type
*/
nodeByRenderableType: (type: string) => Promise<string[]>
/**
* Logs the passed value to the installed LogManager with a LogLevel of 'Debug'. For Boolean, numbers, and strings, the internal values are printed, for all other types, the type is printed instead
*/
printDebug: (...args: any[]) => Promise<void>
/**
* Logs the passed value to the installed LogManager with a LogLevel of 'Error'. For Boolean, numbers, and strings, the internal values are printed, for all other types, the type is printed instead
*/
printError: (...args: any[]) => Promise<void>
/**
* Logs the passed value to the installed LogManager with a LogLevel of 'Fatal'. For Boolean, numbers, and strings, the internal values are printed, for all other types, the type is printed instead
*/
printFatal: (...args: any[]) => Promise<void>
/**
* Logs the passed value to the installed LogManager with a LogLevel of 'Info'. For Boolean, numbers, and strings, the internal values are printed, for all other types, the type is printed instead
*/
printInfo: (...args: any[]) => Promise<void>
/**
* Logs the passed value to the installed LogManager with a LogLevel of 'Trace'. For Boolean, numbers, and strings, the internal values are printed, for all other types, the type is printed instead
*/
printTrace: (...args: any[]) => Promise<void>
/**
* Logs the passed value to the installed LogManager with a LogLevel of 'Warning'. For Boolean, numbers, and strings, the internal values are printed, for all other types, the type is printed instead
*/
printWarning: (...args: any[]) => Promise<void>
/**
* Returns the name of the profile with which OpenSpace was started.
*/
profileName: () => Promise<string>
/**
* Returns the full path of the profile with which OpenSpace was started.
*/
profilePath: () => Promise<path>
/**
* Returns a list of property identifiers that match the passed regular expression. The `uri` identifies the property or properties that are returned by this function and can include both wildcards `*` which match anything, as well as tags (`{tag}`) which match scene graph nodes that have this tag. There is also the ability to combine two tags through the `&`, `|`, and `~` operators. `{tag1&tag2}` will match anything that has both tags `tag1` and `tag2`. `{tag1|tag2}` will match anything that has `tag1` or `tag2`, and `{tag1~tag2}` will match anything that has `tag1` but not `tag2`. If no wildcards or tags are provided at most one property identifier will be returned. With wildcards or tags, the identifiers of all properties that match the URI are returned instead.
\\param uri The URI that identifies the property or properties to get. The URI can contain 0 or 1 wildcard `*` characters or a tag expression (`{tag}`) that identifies a property owner. \\ return A list of property URIs
*/
property: (uri: string) => Promise<string[]>
/**
* Returns a list of property owner identifiers that match the passed regular expression. The `uri` identifies the property owner or owner that are returned by this function and can include both wildcards `*` which match anything, as well as tags (`{tag}`) which match scene graph nodes that have this tag. There is also the ability to combine two tags through the `&`, `|`, and `~` operators. `{tag1&tag2}` will match anything that has both tags `tag1` and `tag2`. `{tag1|tag2}` will match anything that has the tag `tag1` or `tag2`, * and `{tag1~tag2}` will match anything that has `tag1` but not `tag2`. If no wildcards or tags are provided at most one property owner identifier will be returned. With wildcards or tags, the identifiers of all property owners that match the URI are returned instead.
\\param uri The URI that identifies the property owner or owners to get. The URI can contain 0 or 1 wildcard `*` characters or a tag expression (`{tag}`) that identifies a property owner. \\ return A list of property owner URIs
*/
propertyOwner: (uri: string) => Promise<string[]>
/**
* Returns the value of the property identified by the provided URI. This function will provide an error message if no property matching the URI is found.
*/
propertyValue: (uri: string) => Promise<string | number | boolean | table>
/**
* Returns the number of bytes of system memory that is currently being used. This function only works on Windows.
*/
ramInUse: () => Promise<number>
/**
* Loads the CSV file provided as a parameter and returns it as a vector containing the values of the each row. The inner vector has the same number of values as the CSV has columns. The second parameter controls whether the first entry in the returned outer vector is containing the names of the columns
*/
readCSVFile: (file: path, includeFirstLine?: boolean) => Promise<string[][]>
/**
* Reads a file from disk and return its contents.
*/
readFile: (file: path) => Promise<string>
/**
* Reads a file from disk and return its as a list of lines.
*/
readFileLines: (file: path) => Promise<string[]>
/**
* Rebinds all scripts from the old key (first argument) to the new
key (second argument).
*/
rebindKey: (oldKey: string, newKey: string) => Promise<void>
/**
* This function registers another Lua script that will be periodically executed as long as the application is running. The `identifier` is used to later remove the script. The `script` is being executed every `timeout` seconds. This timeout is only as accurate as the framerate at which the application is running. Optionally the `preScript` Lua script is run when registering the repeated script and the `postScript` is run when unregistering it or when the application closes. If the `timeout` is 0, the script will be executed every frame. The `identifier` has to be a unique name that cannot have been used to register a repeated script before. A registered script is removed with the #removeRepeatedScript function.
*/
registerRepeatedScript: (identifier: string, script: string, timeout?: number, preScript?: string, postScript?: string) => Promise<void>
/**
*
*/
removeCustomProperty: (identifier: string) => Promise<void>
/**
* This function removes unmarks the scene graph nodes identified by
name as interesting, thus removing the shortcuts from the features properties list.
*/
removeInterestingNodes: (sceneGraphNodes: string[]) => Promise<void>
/**
* Removes a previously registered repeated script (see #registerRepeatedScript)
*/
removeRepeatedScript: (identifier: string) => Promise<void>
/**
* Removes the SceneGraphNode identified by name or by extracting the 'Identifier' key if the parameter is a table.
*/
removeSceneGraphNode: (node: string | table) => Promise<void>
/**
* Removes all SceneGraphNodes with identifiers matching the input regular expression.
*/
removeSceneGraphNodesFromRegex: (regex: string) => Promise<void>
/**
* Given a ScreenSpaceRenderable name this script will remove it from the RenderEngine. The parameter can also be a table in which case the 'Identifier' key is used to look up the name from the table.
*/
removeScreenSpaceRenderable: (identifier: string | table) => Promise<void>
/**
* Removes a tag (second argument) from a scene graph node (first argument)
*/
removeTag: (uri: string, tag: string) => Promise<void>
/**
* Resets the camera position to the same position where the profile originally started
*/
resetCamera: () => Promise<void>
/**
* Reset screenshot index to 0.
*/
resetScreenshotNumber: () => Promise<void>
/**
* Returns the target path for a Windows shortcut file. This function will produce an error on non-Windows operating systems. The `path` has to be a valid Windows Shell link file.
*/
resolveShortcut: (path: path) => Promise<path>
/**
* This function takes a base64 encoded data string, decodes it and saves the resulting data to the provided filepath.
\\param filePath The location where the data will be saved. Any file that already exists in that location will be overwritten \\param base64Data The base64 encoded data that should be saved to the provided file
*/
saveBase64File: (filePath: path, base64Data: string) => Promise<void>
/**
* Collects all changes that have been made since startup, including all property changes and assets required, requested, or removed. All changes will be added to the profile that OpenSpace was started with, and the new saved file will contain all of this information. If the argument is provided, the settings will be saved into new profile with that name. If the argument is blank, the current profile will be saved to a backup file and the original profile will be overwritten. The second argument determines if a file that already exists should be overwritten, which is 'false' by default.
*/
saveSettingsToProfile: (saveFilePath?: string, overwrite?: boolean) => Promise<void>
/**
* Returns a list of all scene graph nodes in the scene
*/
sceneGraphNodes: () => Promise<string[]>
/**
* Schedules a `script` to be run in `delay` seconds. The delay is measured in wallclock time, which is seconds that occur in the real world, not in relation to the in-game time.
*/
scheduleScript: (script: string, delay: number) => Promise<void>
/**
* Returns a list of all screen-space renderables
*/
screenSpaceRenderables: () => Promise<string[]>
/**
* Set the currnet mission.
*/
setCurrentMission: (identifier: string) => Promise<void>
/**
* This function sets the default values for the dashboard consisting
of 'DashboardItemDate', 'DashboardItemSimulationIncrement', 'DashboardItemDistance',
'DashboardItemFramerate', and 'DashboardItemParallelConnection'.
*/
setDefaultDashboard: () => Promise<void>
/**
* Set a custom ordering of the items in a specific branch in the Scene GUI tree, i.e. for a specific GUI path.
\\param guiPath The GUI path for which the order should be set. \\param list A list of names of scene graph nodes or subgroups in the GUI, in the order of which they should appear in the tree. The list does not have to include all items in the given GUI path. Any excluded items will be placed after the ones in the list.
*/
setGuiOrder: (guiPath: string, list: string[]) => Promise<void>
/**
* The scene graph node identified by the first string is reparented to be a child of the scene graph node identified by the second string.
*/
setParent: (identifier: string, newParent: string) => Promise<void>
/**
* Registers the path token provided by the first argument to the path in the second argument. If the path token already exists, it will be silently overridden.
*/
setPathToken: (pathToken: string, path: path) => Promise<void>
/**
* Sets the property or properties identified by the URI to the specified
value. The `uri` identifies which property or properties are affected by this function
call and can include both wildcards `*` which match anything, as well as tags (`{tag}`)
which match scene graph nodes that have this tag. There is also the ability to combine two
tags through the `&`, `|`, and `~` operators. `{tag1&tag2}` will match anything that has
the tag1 and the tag2. `{tag1|tag2}` will match anything that has the tag1 or the tag 2,
and `{tag1~tag2}` will match anything that has tag1 but not tag2. If no wildcards or tags
are provided at most one property value will be changed. With wildcards or tags all
properties that match the URI are changed instead. The second argument's type must match
the type of the property or properties or an error is raised. If a duration is provided,
the requested change will occur over the provided number of seconds. If no duration is
provided or the duration is 0, the change occurs instantaneously.
For example `openspace.setPropertyValue("*Trail.Renderable.Enabled", true)` will enable
any property that ends with "Trail.Renderable.Enabled", for example
"StarTrail.Renderable.Enabled", "EarthTrail.Renderable.Enabled", but not
"EarthTrail.Renderable.Size".
`openspace.setPropertyValue("{tag1}.Renderable.Enabled", true)` will enable any node in
the scene that has the "tag1" assigned to it.
If you only want to change a single property value, also see the #setPropertyValueSingle
function as it will do so in a more efficient way. The `setPropertyValue` function will
work for individual property value, but is more computationally expensive.
\\param uri The URI that identifies the property or properties whose values should be
changed. The URI can contain 0 or 1 wildcard `*` characters or a tag expression (`{tag}`)
that identifies a property owner
\\param value The new value to which the property/properties identified by the `uri`
should be changed to. The type of this parameter must agree with the type of the selected
property
\\param duration The number of seconds over which the change will occur. If not provided
or the provided value is 0, the change is instantaneously.
\\param easing If a duration larger than 0 is provided, this parameter controls the manner
in which the parameter is interpolated. Has to be one of "Linear", "QuadraticEaseIn",
"QuadraticEaseOut", "QuadraticEaseInOut", "CubicEaseIn", "CubicEaseOut", "CubicEaseInOut",
"QuarticEaseIn", "QuarticEaseOut", "QuarticEaseInOut", "QuinticEaseIn", "QuinticEaseOut",
"QuinticEaseInOut", "SineEaseIn", "SineEaseOut", "SineEaseInOut", "CircularEaseIn",
"CircularEaseOut", "CircularEaseInOut", "ExponentialEaseIn", "ExponentialEaseOut",
"ExponentialEaseInOut", "ElasticEaseIn", "ElasticEaseOut", "ElasticEaseInOut",
"BounceEaseIn", "BounceEaseOut", "BounceEaseInOut"
\\param postscript A Lua script that will be executed once the change of property value
is completed. If a duration larger than 0 was provided, it is at the end of the
interpolation. If 0 was provided, the script runs immediately.
*/
setPropertyValue: (uri: string, value: null | string | number | boolean | table, duration?: number, easing?: easingfunction, postscript?: string) => Promise<void>
/**
* Sets the single property identified by the URI to the specified value.
The `uri` identifies which property is affected by this function call. The second
argument's type must match the type of the property or an error is raised. If a duration
is provided, the requested change will occur over the provided number of seconds. If no
duration is provided or the duration is 0, the change occurs instantaneously.
If you want to change multiple property values simultaneously, also see the
#setPropertyValue function. The `setPropertyValueSingle` function however will work more
efficiently for individual property values.
\\param uri The URI that identifies the property
\\param value The new value to which the property identified by the `uri` should be
changed to. The type of this parameter must agree with the type of the selected property
\\param duration The number of seconds over which the change will occur. If not provided
or the provided value is 0, the change is instantaneously.
\\param easing If a duration larger than 0 is provided, this parameter controls the manner
in which the parameter is interpolated. Has to be one of "Linear", "QuadraticEaseIn",
"QuadraticEaseOut", "QuadraticEaseInOut", "CubicEaseIn", "CubicEaseOut", "CubicEaseInOut",
"QuarticEaseIn", "QuarticEaseOut", "QuarticEaseInOut", "QuinticEaseIn", "QuinticEaseOut",
"QuinticEaseInOut", "SineEaseIn", "SineEaseOut", "SineEaseInOut", "CircularEaseIn",
"CircularEaseOut", "CircularEaseInOut", "ExponentialEaseIn", "ExponentialEaseOut",
"ExponentialEaseInOut", "ElasticEaseIn", "ElasticEaseOut", "ElasticEaseInOut",
"BounceEaseIn", "BounceEaseOut", "BounceEaseInOut"
\\param postscript This parameter specifies a Lua script that will be executed once the
change of property value is completed. If a duration larger than 0 was provided, it is
at the end of the interpolation. If 0 was provided, the script runs immediately.
*/
setPropertyValueSingle: (uri: string, value: null | string | number | boolean | table, duration?: number, easing?: easingfunction, postscript?: string) => Promise<void>
/**
* Sets the folder used for storing screenshots or session recording frames
*/
setScreenshotFolder: (newFolder: string) => Promise<void>
/**
* Take a screenshot and return the screenshot number. The screenshot will be stored in the ${SCREENSHOTS} folder.
*/
takeScreenshot: () => Promise<integer>
/**
* A utility function to return a specific value based on a True/False condition.
\\param condition The condition to check against
\\param trueValue The value to return if the condition is True
\\param falseValue The value to return if the condition is False
\\return Either the trueValue of falseValue, depending on if the condition is true
or not
*/
ternary: (condition: boolean, trueValue: any, falseValue: any) => Promise<any>
/**
* Toggles the fade state of the node(s) with the given identifier over
the given time in seconds. The identifier can contain a tag and/or a wildcard to
target several nodes. If the fade time is not provided then the
"OpenSpaceEngine.FadeDuration" property will be used instead. If the third argument
(endScript) is provided then that script will be run after the fade is finished.
*/
toggleFade: (identifier: string, fadeTime?: number, endScript?: string) => Promise<void>
/**
* Toggles the shutdown mode that will close the application after the countdown timer is reached
*/
toggleShutdown: () => Promise<void>
/**
* Unloads a previously loaded mission.
*/
unloadMission: (identifierOrMission: string | table) => Promise<void>
/**
* This function extracts the contents of a zip file. The first argument is the path to the zip file. The second argument is the directory where to put the extracted files. If the third argument is true, the compressed file will be deleted after the decompression is finished.
*/
unzipFile: (source: string, destination: string, deleteSource?: boolean) => Promise<void>
/**
* This function returns information about the current OpenSpace version. The resulting table has the structure: \\code Version = { Major = <number> Minor = <number> Patch = <number> }, Commit = <string> Branch = <string> \\endcode
*/
version: () => Promise<table>
/**
* Returns the number of bytes of video memory that is currently being used. This function only works on Windows.
*/
vramInUse: () => Promise<number>
/**
* Walks a directory and returns the contents of the directory as absolute paths. The first argument is the path of the directory that should be walked, the second argument determines if the walk is recursive and will continue in contained directories. The default value for this parameter is \"false\". The third argument determines whether the table that is returned is sorted. The default value for this parameter is \"false\".
*/
walkDirectory: (path: path, recursive?: boolean, sorted?: boolean) => Promise<path[]>
/**
* Walks a directory and returns the files of the directory as absolute paths. The first argument is the path of the directory that should be walked, the second argument determines if the walk is recursive and will continue in contained directories. The default value for this parameter is \"false\". The third argument determines whether the table that is returned is sorted. The default value for this parameter is \"false\".
*/
walkDirectoryFiles: (path: path, recursive?: boolean, sorted?: boolean) => Promise<path[]>
/**
* Walks a directory and returns the subfolders of the directory as absolute paths. The first argument is the path of the directory that should be walked, the second argument determines if the walk is recursive and will continue in contained directories. The default value for this parameter is \"false\". The third argument determines whether the table that is returned is sorted. The default value for this parameter is \"false\".
*/
walkDirectoryFolders: (path: path, recursive?: boolean, sorted?: boolean) => Promise<path[]>
/**
* Returns the world position of the scene graph node with the given string as identifier.
*/
worldPosition: (identifier: string) => Promise<vec3>
/**
* Returns the world rotation matrix of the scene graph node with the given string as identifier.
*/
worldRotation: (identifier: string) => Promise<mat3x3>
/**
* Writes out documentation files
*/
writeDocumentation: () => Promise<void>
} // interface openspace
interface actionLibrary {
/**
* Returns information about the action as a table with the keys 'Identifier', 'Command', 'Name', 'Documentation', 'GuiPath', and 'Synchronization'.
*/
action: (identifier: string) => Promise<table>
/**
* Returns all registered actions in the system as a table of tables each containing the keys 'Identifier', 'Command', 'Name', 'Documentation', 'GuiPath', and 'Synchronization'.
*/
actions: () => Promise<table[]>
/**
* Checks if the passed identifier corresponds to an action.
*/
hasAction: (identifier: string) => Promise<boolean>
/**
* Registers a new action. The first argument is the identifier which cannot have been used to register a previous action before, the second argument is the Lua command that is to be executed, and the optional third argument is the name used in a user-interface to refer to this action. The fourth is a human readable description of the command for documentation purposes. The fifth is the GUI path and the last parameter determines whether the action should be executed locally (= false) or remotely (= true, the default).
*/
registerAction: (action: action) => Promise<void>
/**
* Removes an existing action from the list of possible actions. The action is identifies either by the passed name, or if it is a table, the value behind the 'Identifier' key is extract and used instead.
*/
removeAction: (action: string | table) => Promise<void>
/**
* Triggers the action given by the specified identifier.
*/
triggerAction: (id: string, arg?: table) => Promise<void>
} // interface actionLibrary
interface assetLibrary {
/**
* Adds an asset to the current scene. The parameter passed into this function is the path to the file that should be loaded.
*/
add: (assetName: string) => Promise<void>
/**
* Returns the paths to all loaded assets, loaded directly or indirectly, as a table containing the paths to all loaded assets.
*/
allAssets: () => Promise<path[]>
/**
* Returns true if the referenced asset already has been loaded. Otherwise false is returned. The parameter to this function is the path of the asset that should be tested.
*/
isLoaded: (assetName: string) => Promise<boolean>
/**
* Reloads the asset with the specified name. If the asset was previously loaded explicity it will be removed and then re-added. If the asset was not previously loaded, it will only be loaded instead.
*/
reload: (assetName: string) => Promise<void>
/**
* Removes the asset with the specfied name from the scene. The parameter to this function is the same that was originally used to load this asset, i.e. the path to the asset file.
*/
remove: (assetName: string) => Promise<void>
/**
* Removes all assets that are currently loaded
*/
removeAll: () => Promise<void>
/**
* Returns the paths to all loaded root assets, which are assets that are loaded directly either through a profile or by calling the `openspace.asset.add` method.
*/
rootAssets: () => Promise<path[]>
} // interface assetLibrary
interface audioLibrary {
/**
* Returns the list of all tracks that are currently playing.
\\return The list of all tracks that are currently playing
*/
currentlyPlaying: () => Promise<string[]>
/**
* Returns the global volume for all track. The number returned will be greater or equal to 0.
\\return The global volume
*/
globalVolume: () => Promise<number>
/**
* Returns whether the track referred to by the \\p identifier is set to be looping or whether it should played only once. The \\p identifier must be a name for a sound that was started through the #playAudio or #playAudio3d functions.
\\param identifier The identifier to the track that should be stopped \\return `Yes` if the track is looping, `No` otherwise
*/
isLooping: (identifier: string) => Promise<boolean>
/**
* Returns whether the track refered to by the \\p identifier is currently playing or paused. If it was be paused through a previous call to #pauseAudio, this function will return `true`. If it has just been created or resumed through a call to #resumeAudio, it will return `false`. The \\p identifier must be a name for a sound that was started through the #playAudio or #playAudio3d functions.
\\param identifier The identifier to the track that should be stopped \\return `true` if the track is currently paused, `false` if it is playing
*/
isPaused: (identifier: string) => Promise<boolean>
/**
* Returns whether the track referred to by the \\p identifier is currently playing. A volume of 0 is still considered to be playing. The \\p identifier must be a name for a sound that was started through the #playAudio or #playAudio3d functions.
\\param identifier The identifier to the track that should be stopped \\return `true` if the track is currently playing, `false` otherwise
*/
isPlaying: (identifier: string) => Promise<boolean>
/**
* Pauses the playback for all sounds, while keeping them valid. This function behaves the same as if calling #pauseAudio on all of the sounds that are currently playing.
*/
pauseAll: () => Promise<void>
/**
* Pauses the playback of the track referred to by the \\p identifier. The playback can later be resumed through the #resumeAudio function. Trying to pause an already paused track will not do anything, but is valid. The \\p identifier must be a name for a sound that was started through the #playAudio or #playAudio3d functions.
\\param identifier The identifier to the track that should be stopped
*/
pauseAudio: (identifier: string) => Promise<void>
/**
* Takes all of the sounds that are currently registers, unpauses them and plays them from their starting points
*/
playAllFromStart: () => Promise<void>
/**
* Starts playing the audio file located and the provided \\p path. The \\p loop parameter determines whether the file is only played once, or on a loop. The sound is later referred to by the \\p identifier name. The audio file will be played in \"background\" mode, which means that each channel will be played at full volume. To play a video using spatial audio, use the #playAudio3d function instead.
\\param path The audio file that should be played \\param identifier The name for the sound that is used to refer to the sound \\param shouldLoop If `Yes` then the song will be played in a loop until the program is closed or the playing is stopped through the #stopAudio function
*/
playAudio: (path: path, identifier: string, shouldLoop?: boolean) => Promise<void>
/**
* Starts playing the audio file located and the provided \\p path. The \\p loop parameter determines whether the file is only played once, or on a loop. The sound is later referred to by the \\p identifier name. The \\p position parameter determines the spatial location of the sound in a meter-based coordinate system. The position of the listener is (0,0,0) with the forward direction along the +y axis. This means that the \"left\" channel in a stereo setting is towards -x and the \"right\" channel towards x. This default value can be customized through the #set3dListenerParameters function. If you want to play a video without spatial audio, use the #playAudio function instead.
\\param path The audio file that should be played \\param identifier The name for the sound that is used to refer to the sound \\param position The position of the audio file in the 3D environment \\param shouldLoop If `Yes` then the song will be played in a loop until the program is closed or the playing is stopped through the #stopAudio function
*/
playAudio3d: (path: path, identifier: string, position: vec3, shouldLoop?: boolean) => Promise<void>
/**
* Resumes the playback for all sounds that have been paused. Please note that this will also resume the playback for the sounds that have been manually paused, not just those that were paused through the #pauseAll function.
*/
resumeAll: () => Promise<void>
/**
* Resumes the playback of a track that was previously paused through the #pauseAudio function. Trying to resume an already playing track will not do anything, but is valid. The \\p identifier must be a name for a sound that was started through the #playAudio or #playAudio3d functions.
\\param identifier The identifier to the track that should be stopped
*/
resumeAudio: (identifier: string) => Promise<void>
/**
* Sets the position and orientation of the listener. This new position is automatically used to adjust the relative position of all 3D tracks. Each parameter to this function call is optional and if a value is omitted, the currently set value continues to be used instead. The coordinate system for the tracks and the listener is a meter-based coordinate system.
\\param position The position of the listener. \\param lookAt The direction vector of the forward direction \\param up The up-vector of the coordinate system
*/
set3dListenerPosition: (position: vec3, lookAt?: vec3, up?: vec3) => Promise<void>
/**
* Updates the 3D position of a track started through the #playAudio3d function. See that function and the #set3dListenerParameters function for a complete description. The \\p identifier must be a name for a sound that was started through the #playAudio3d function.
\\param identifier A valid identifier for a track started through the #playAudio3d function \\param position The new position from which the track originates
*/
set3dSourcePosition: (identifier: string, position: vec3) => Promise<void>
/**
* Sets the global volume for all track referred to the new \\p volume. The total for each track is the global volume set by this function multiplied with the volume for the specific track set through the #setVolume function. The default value for the global volume is 0.5. The volume should be a number bigger than 0, where 1 is the maximum volume level. The \\p fade controls whether the volume change should be immediately (if it is 0) or over how many seconds it should change. The default is for it to change over 500 ms.
\\param volume The new volume level. Must be greater or equal to 0 \\param fade How much time the fade from the current volume to the new volume should take
*/
setGlobalVolume: (volume: number, fade?: number) => Promise<void>
/**
* Controls whether the track referred to by the \\p identifier should be looping or just be played once. If a track is converted to not looping, it will finish playing until the end of the file. The \\p identifier must be a name for a sound that was started through the #playAudio or #playAudio3d functions.
\\param identifier The identifier to the track that should be stopped \\param shouldLoop If `Yes` then the song will be played in a loop until the program is closed or the playing is stopped through the #stopAudio function
*/
setLooping: (identifier: string, shouldLoop: boolean) => Promise<void>
/**
* Sets the position of the speaker for the provided \\p channel to the provided \\p position. In general, this is considered an advanced feature to accommodate non-standard audio environments.
\\param channel The channel whose speaker's position should be changed \\param position The new position for the speaker
*/
setSpeakerPosition: (channel: integer, position: vec3) => Promise<void>
/**
* Sets the volume of the track referred to by \\p handle to the new \\p volume. The volume should be a number bigger than 0, where 1 is the maximum volume level. The \\p fade controls whether the volume change should be immediately (if it is 0) or over how many seconds it should change. The default is for it to change over 500 ms.
\\param identifier The identifier to the track whose volume should be changed \\param volume The new volume level. Must be greater or equal to 0 \\param fade How much time the fade from the current volume to the new volume should take
*/
setVolume: (identifier: string, volume: number, fade?: number) => Promise<void>
/**
* Returns the position for the speaker of the provided \\p channel.
\\param channel The channel for which the position should be returned \\return The position for the speaker of the provided \\p channel
*/
speakerPosition: (channel: integer) => Promise<vec3>
/**
* Stops all currently playing tracks. After this function, none of the identifiers used to previously play a sound a valid any longer, but can still be used by the #playAudio or #playAudio3d functions to start a new sound. This function behaves the same way as if manually calling #stopAudio on all of the sounds that have been started.
*/
stopAll: () => Promise<void>
/**
* Stops the audio referenced by the \\p identifier. The \\p identifier must be a name for a sound that was started through the #playAudio or #playAudio3d functions. After this function, the \\p identifier can not be used for any other function anymore except for #playAudio or #playAudio3d to start a new sound.
\\param identifier The identifier to the track that should be stopped
*/
stopAudio: (identifier: string) => Promise<void>
/**
* Returns the volume for the track referred to by the \\p handle. The number returned will be greater or equal to 0.
\\param identifier The identifier to the track whose volume should be returned \\return The volume for the track referred to by the \\p handle, which will be greater or equal to 0
*/
volume: (identifier: string) => Promise<number>
} // interface audioLibrary
interface dashboardLibrary {
/**
* Adds a new dashboard item to the main dashboard.
*/
addDashboardItem: (dashboard: table) => Promise<void>
/**
* Adds a new dashboard item to an existing SceenSpaceDashboard.
*/
addDashboardItemToScreenSpace: (identifier: string, dashboard: table) => Promise<void>
/**
* Removes all dashboard items from the main dashboard.
*/
clearDashboardItems: () => Promise<void>
/**
* Returns all loaded dashboard-item identifiers from the main dashboard.
\\return a list of loaded dashboard-item identifiers from the main dashbaord
*/
dashboardItems: () => Promise<string[]>
/**
* Removes the dashboard item with the specified identifier.
*/
removeDashboardItem: (identifier: string | table) => Promise<void>
/**
* Removes all dashboard items from an existing ScreenSpaceDashboard.
*/
removeDashboardItemsFromScreenSpace: (identifier: string) => Promise<void>
} // interface dashboardLibrary
interface debuggingLibrary {
/**
* Creates a new scene graph node that show the coordinate system used for the
currently selected focus node, or a specified scene graph node.
Usage:
```lua
-- To add coordinate axes for the currently selected focus node, do not specify any
-- parameters
openspace.debugging.createCoordinateAxes()
```
\\param nodeIdentifier The identifier of the scene graph node for which the axes
should be added. If this parameter is not specified, the
current focus node is used instead.
\\param scale An optional parameter that specifies the size of the coordinate axes,
in meters. If not specified, the size is set to 2.5 times the
interaction sphere of the selected node.
*/
createCoordinateAxes: (nodeIdentifier?: string, scale?: number) => Promise<void>
/**
* Removes the rendered control points.
*/
removePathControlPoints: () => Promise<void>
/**
* Removes the currently rendered camera path if there is one.
*/
removeRenderedCameraPath: () => Promise<void>
/**
* Render the current camera path from the path navigation system. The first optional argument is the number of samples to take along the path (defaults to 100). If a second optional argument is included and set to true, a line indicating the camera view direction along the path will also be rendered. This can be useful when debugging camera orientations. Finally, the third optional argument can be used to set the length (in meter) of the view direction lines.
*/
renderCameraPath: (nSteps?: integer, renderDirections?: boolean, directionLineLength?: number) => Promise<void>
/**
* Render the control points for the camera path spline as spheres. The optional argument can be used to set the radius of the created spheres.
*/
renderPathControlPoints: (radius?: number) => Promise<void>
} // interface debuggingLibrary
interface eventLibrary {
/**