Skip to content

Commit 160aaea

Browse files
committed
update generated d.ts
1 parent 0b7e4f4 commit 160aaea

File tree

1 file changed

+34
-32
lines changed

1 file changed

+34
-32
lines changed

declaration/openspace-api-js.d.ts

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
2323
****************************************************************************************/
2424

25-
declare module 'openspace-api-js' {
25+
declare module "openspace-api-js" {
2626
export class OpenSpaceApi {
2727
/**
2828
* Construct an instance of the OpenSpace API.
@@ -118,21 +118,23 @@ declare module 'openspace-api-js' {
118118
executeLuaScript(
119119
script: string,
120120
getReturnValue: boolean,
121-
shouldBeSynchronized: boolean
121+
shouldBeSynchronized: boolean,
122122
): Promise<unknown | undefined>;
123123

124124
/**
125125
* Execute a lua function from the OpenSpace library
126126
* @param function The lua function to execute (for example
127127
* `openspace.addSceneGraphNode`).
128+
* @param args The function arguments.
128129
* @param getReturnValue Specified whether the return value should be collected.
129130
*
130131
* @return The return value of the script, if `getReturnValue` is true, otherwise
131132
* undefined.
132133
*/
133134
executeLuaFunction(
134135
fun: string,
135-
getReturnValue: boolean
136+
args: unknown[],
137+
getReturnValue: boolean,
136138
): Promise<unknown | undefined>;
137139

138140
/**
@@ -189,7 +191,7 @@ declare module 'openspace-api-js' {
189191
constructor(
190192
iterator: AsyncGenerator<any, void, unknown>,
191193
talk: (payload: any) => void,
192-
cancel: () => void
194+
cancel: () => void,
193195
);
194196
/**
195197
* Send data within a topic
@@ -330,7 +332,7 @@ export interface openspace {
330332
/**
331333
* Downloads a file from Lua interpreter
332334
*/
333-
downloadFile: (url: string, savePath: string, waitForCompletion?: boolean) => Promise<void>
335+
downloadFile: (url: string, savePath: string, waitForCompletion?: boolean, overrideExistingFile?: boolean) => Promise<void>
334336
/**
335337
* Extracts the DPI scaling for either the GUI window or if there is no dedicated GUI window, the first window.
336338
*/
@@ -553,7 +555,7 @@ export interface openspace {
553555
554556
\\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
555557
*/
556-
saveBase64File: (filepath: path, base64Data: string) => Promise<void>
558+
saveBase64File: (filePath: path, base64Data: string) => Promise<void>
557559
/**
558560
* 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.
559561
*/
@@ -848,13 +850,13 @@ interface audioLibrary {
848850
/**
849851
* 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.
850852
851-
\\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 loop 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
853+
\\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
852854
*/
853855
playAudio: (path: path, identifier: string, shouldLoop?: boolean) => Promise<void>
854856
/**
855857
* 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.
856858
857-
\\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 loop 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
859+
\\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
858860
*/
859861
playAudio3d: (path: path, identifier: string, position: vec3, shouldLoop?: boolean) => Promise<void>
860862
/**
@@ -876,7 +878,7 @@ interface audioLibrary {
876878
/**
877879
* 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.
878880
879-
\\param handle A valid handle for a track started through the #playAudio3d function \\param position The new position from which the track originates
881+
\\param identifier A valid identifier for a track started through the #playAudio3d function \\param position The new position from which the track originates
880882
*/
881883
set3dSourcePosition: (identifier: string, position: vec3) => Promise<void>
882884
/**
@@ -888,25 +890,27 @@ interface audioLibrary {
888890
/**
889891
* 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.
890892
891-
\\param identifier The identifier to the track that should be stopped \\param loop 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
893+
\\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
892894
*/
893895
setLooping: (identifier: string, shouldLoop: boolean) => Promise<void>
894896
/**
895897
* 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.
896898
897899
\\param channel The channel whose speaker's position should be changed \\param position The new position for the speaker
898900
*/
899-
setSpeakerPosition: (handle: integer, position: vec3) => Promise<void>
901+
setSpeakerPosition: (channel: integer, position: vec3) => Promise<void>
900902
/**
901903
* 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.
902904
903-
\\param handle The handle 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
905+
\\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
904906
*/
905907
setVolume: (identifier: string, volume: number, fade?: number) => Promise<void>
906908
/**
907-
* Returns the position for the speaker of the provided \\p channel. \\return The position for the speaker of the provided \\p channel
909+
* Returns the position for the speaker of the provided \\p channel.
910+
911+
\\param channel The channel for which the position should be returned \\return The position for the speaker of the provided \\p channel
908912
*/
909-
speakerPosition: (handle: integer) => Promise<vec3>
913+
speakerPosition: (channel: integer) => Promise<vec3>
910914
/**
911915
* 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.
912916
*/
@@ -920,7 +924,7 @@ interface audioLibrary {
920924
/**
921925
* Returns the volume for the track referred to by the \\p handle. The number returned will be greater or equal to 0.
922926
923-
\\return The volume for the track referred to by the \\p handle, which will be greater or equal to 0
927+
\\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
924928
*/
925929
volume: (identifier: string) => Promise<number>
926930
} // interface audioLibrary
@@ -1437,35 +1441,33 @@ interface modulesLibrary {
14371441

14381442
interface navigationLibrary {
14391443
/**
1440-
* Directly adds to the global roll of the camera. This is a rotation around the line between the focus node and the camera (not always the same as the camera view direction)
1444+
* Adds an instantaneous impulse to the global roll of the camera. This is a rotation around the line between the focus node and the camera. This is almost always the same as the forward direction of the camera, unless a local rotation has panned the camera away from the focus object. The global roll corresponds to using the middle mouse button and moving the mouse left and right. The unit for the provided parameter is somewhat arbitrary and the magnitude depends on the explicit use-case (continuously executing this function vs an individual impulse), but typically a range of [-250, 250] produces reasonable results.
14411445
1442-
\\param value the value to add
1446+
\\param value A positive value rolls the camera to the left and a negative value rolls the camera to the right
14431447
*/
14441448
addGlobalRoll: (value: number) => Promise<void>
14451449
/**
1446-
* Directly add to the global rotation of the camera (around the focus node).
1450+
* Adds an instantaneous impulse to the global rotation of the camera (around the focus node). This type of rotation corresponds to using the left mouse button and moving the mouse to rotate around the current focus object. The units for the provided parameters are somewhat arbitrary and the magnitude depends on the explicit use-case (continuously executing this function vs an individual impulse), but typically a range of [-500, 500] produces reasonable results.
14471451
1448-
\\param xValue the value to add in the x-direction (a positive value rotates to the right and a negative value to the left) \\param yValue the value to add in the y-direction (a positive value rotates the focus upwards and a negative value downwards)
1452+
\\param horizontal The value to add in the x-direction (a positive value rotates to the right and a negative value to the left) \\param vertical The value to add in the y-direction (a positive value rotates the focus upwards and a negative value downwards)
14491453
*/
1450-
addGlobalRotation: (xValue: number, yValue: number) => Promise<void>
1454+
addGlobalRotation: (horizontal: number, vertical: number) => Promise<void>
14511455
/**
1452-
* Directly adds to the local roll of the camera. This is the rotation around the camera's forward/view direction.
1456+
* Adds an instantaneous impulse to the local roll of the camera. This is the rotation around the camera's forward direction and corresponds to using the middle mouse button and pressing and holding the middle mouse button while moving the mouse to the left and right. The unit for the provided parameter is somewhat arbitrary and the magnitude depends on the explicit use-case (continuously executing this function vs an individual impulse), but typically a range of [-250, 250] produces reasonable results.
14531457
1454-
\\param value the value to add
1458+
\\param value A positive value rolls the camera to the left and a negative value rolls the camera to the right
14551459
*/
14561460
addLocalRoll: (value: number) => Promise<void>
14571461
/**
1458-
* Directly adds to the local rotation of the camera (around the camera's current position).
1462+
* Adds an instantaneous impulse to the local rotation of the camera (around the camera's current position). This type of rotation corresponds to using the left mouse button and pressing the Ctrl key while moving mouse to rotate around the current camera position. The units for the provided parameters are somewhat arbitrary and the magnitude depends on the explicit use-case (continuously executing this function vs an individual impulse), but typically a range of [-250, 250] produces reasonable results.
14591463
1460-
\\param xValue the value to add in the x-direction (a positive value rotates to the left and a negative value to the right) \\param yValue the value to add in the y-direction (a positive value rotates the camera upwards and a negative value downwards)
1464+
\\param horizontal The value to add in the x-direction (a positive value rotates to the left and a negative value to the right) \\param vertical The value to add in the y-direction (a positive value rotates the camera upwards and a negative value downwards)
14611465
*/
1462-
addLocalRotation: (xValue: number, yValue: number) => Promise<void>
1466+
addLocalRotation: (horizontal: number, vertical: number) => Promise<void>
14631467
/**
1464-
* Directly adds to the truck movement of the camera. This is the movement along the line from the camera to the focus node.
1465-
1466-
A positive value moves the camera closer to the focus, and a negative value moves the camera further away.
1468+
* Adds an instantaneous impulse to create a truck movement of the camera. This is the movement along the line from the camera to the focus node and corresponds to using the right mouse button and moving the mous up and down. The unit for the provided parameter is somewhat arbitrary and the magnitude depends on the explicit use-case (continuously executing this function vs an individual impulse), but typically a range of [-1000, 1000] produces reasonable results.
14671469
1468-
\\param value the value to add
1470+
\\param value A positive value moves the camera closer to the focus node, and a negative value moves the camera further away.
14691471
*/
14701472
addTruckMovement: (value: number) => Promise<void>
14711473
/**
@@ -2241,7 +2243,7 @@ Note that providing time zone using the Z format is not supported. UTC is assume
22412243
22422244
\\param time The time to set. If the parameter is a number, the value is the number of seconds past the J2000 epoch. If it is a string, it has to be a valid ISO 8601-like date string of the format YYYY-MM-DDTHH:MN:SS. \\param interpolationDuration The number of seconds that the interpolation should be done over. If excluded, the time is decided based on the default value for time interpolation specified in the TimeManager.
22432245
*/
2244-
interpolateTime: (time: string | number, interpolationDutation?: number) => Promise<void>
2246+
interpolateTime: (time: string | number, interpolationDuration?: number) => Promise<void>
22452247
/**
22462248
* Increment the current simulation time by the specified number of seconds, using interpolation.
22472249
@@ -2311,11 +2313,11 @@ Note that providing time zone using the Z format is not supported. UTC is assume
23112313
*/
23122314
setTime: (time: number | string) => Promise<void>
23132315
/**
2314-
* Returns the current time as an date string of the form (YYYY MON DDTHR:MN:SC.### ::RND) as returned by SPICE.
2316+
* Returns the current time as an date string. The format of the returned string can be adjusted by providing the format picture. The default picture that is used will be (YYYY MON DDTHR:MN:SC.### ::RND). See https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/timout_c.html for documentation on how the format string can be formatted
23152317
23162318
\\return The current time, in the format used by SPICE (YYYY MON DDTHR:MN:SC.### ::RND)
23172319
*/
2318-
SPICE: () => Promise<string>
2320+
SPICE: (format?: string) => Promise<string>
23192321
/**
23202322
* Toggle the pause function, i.e. if the simulation is paused it will resume, and otherwise it will be paused. Note that to pause means temporarily setting the delta time to 0, and unpausing means restoring it to whatever delta time value is set.
23212323
*/

0 commit comments

Comments
 (0)