diff --git a/README.md b/README.md index cc40875..995737f 100644 --- a/README.md +++ b/README.md @@ -81,9 +81,9 @@ const api = openspaceApi('localhost', 4682); The package ships with pre-generated types targeting a specific OpenSpace version. If your build differs, you can regenerate them locally. There are two separate generators, one for topic types and one for the Lua library. Both write directly into `src/types/generated/`. -### Topic types (`generate-topic-types`) +### Generate topic types (`generate-topic-types`) -Reads JSON schema files from OpenSpace's `support/types/` directory and compiles them to TypeScript using `json-schema-to-typescript`. +Reads JSON schema files from OpenSpace's `support/types/` directory and compiles them to TypeScript using the npm library `json-schema-to-typescript`. **Prerequisites:** @@ -102,8 +102,7 @@ npm run generate-topic-types -- "/support/types" This writes the generated files into `src/types/generated/` and rebuilds the `AllTopics` union type used throughout the API. - -### Lua library types (`generate-lua-library`) +### Generate Lua library types (`generate-lua-library`) Connects to a running OpenSpace instance, fetches the full Lua API documentation via the `documentation` topic, and generates `src/types/generated/openspacelualibrary.ts`. @@ -124,6 +123,10 @@ Connects to a running OpenSpace instance, fetches the full Lua API documentation npm run generate-lua-library ``` -This installs the Python dependencies (via `pip install -r script/requirements.txt`) and runs `script/generatetypescriptfile.py`, writing the result to `src/types/generated/openspacelualibrary.ts`. +This installs the Python dependencies (via `pip install -r script/requirements.txt`) and runs the script `script/generatetypescriptfile.py`, writing the result to `src/types/generated/openspacelualibrary.ts`. > **Note:** The generated file is specific to the OpenSpace version that was running when the script executed. Type hints may be inaccurate if your runtime version differs from the version used to generate them. + +## Adding a new OpenSpace Topic + +Adding a new Topic involves engine-side registration as well as regenerating, testing, and publishing the types above as a `-dev` prerelease before promoting them to a stable release. See [Creating a new OpenSpace Topic](https://docs.openspaceproject.com/latest/contribute/development/api/creating-a-new-topic.html) in the documentation for the full workflow. diff --git a/script/generatetopictypes.mjs b/script/generatetopictypes.mjs index de267dc..ffb4837 100644 --- a/script/generatetopictypes.mjs +++ b/script/generatetopictypes.mjs @@ -34,8 +34,9 @@ const Style = { const BannerComment = '/**\n' + ' * This file was automatically generated by json-schema-to-typescript.\n' + - ' * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file,\n' + - ' * and run json-schema-to-typescript to regenerate this file.\n */'; + ' * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run\n' + + ' * `generate-topic-types` to regenerate this file. See the openspace-api-js repository:\n' + + ' * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build\n */'; /** * Extracts all type names defined in the $defs of a JSON schema file. diff --git a/script/generatetypescriptfile.py b/script/generatetypescriptfile.py index e49aabc..65c8cc4 100644 --- a/script/generatetypescriptfile.py +++ b/script/generatetypescriptfile.py @@ -122,6 +122,8 @@ def writeCustomTypes(file): file.write("type path = string;\n") file.write("type table = object;\n") file.write("type action = object;\n") + file.write("type trail = object;\n") + file.write("type position = object;\n") file.write("type custompropertytype = any;\n") file.write("type integer = number;\n") file.write("type vec2 = [number, number];\n") diff --git a/src/types/generated/actionkeybindtopic.ts b/src/types/generated/actionkeybindtopic.ts index 75ee1a6..38f3185 100644 --- a/src/types/generated/actionkeybindtopic.ts +++ b/src/types/generated/actionkeybindtopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface ActionKeybindTopic { @@ -34,6 +35,7 @@ export interface Action { documentation: string; guiPath: string; identifier: string; + isHidden?: boolean; isLocal: boolean; name: string; } diff --git a/src/types/generated/assettreetopic.ts b/src/types/generated/assettreetopic.ts new file mode 100644 index 0000000..1980bc6 --- /dev/null +++ b/src/types/generated/assettreetopic.ts @@ -0,0 +1,30 @@ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build + */ + +export interface AssetTreeTopic { + data: PathList | StateSnapshot | AssetState; + topicId: 'assetTree'; + topicPayload: { + event: 'start_subscription' | 'stop_subscription' | 'scan_assets'; + }; +} +export interface PathList { + category: 'shipped' | 'user' | 'other' | 'rootAssets'; + paths: string[]; + type: 'pathList'; +} +export interface StateSnapshot { + states: { + [k: string]: 'Loaded' | 'Loading' | 'Unloaded' | 'Error'; + }; + type: 'stateSnapshot'; +} +export interface AssetState { + path: string; + state: 'Loaded' | 'Loading' | 'Unloaded' | 'Error'; + type: 'state'; +} diff --git a/src/types/generated/authorizationtopic.ts b/src/types/generated/authorizationtopic.ts index eb5c536..b33f88c 100644 --- a/src/types/generated/authorizationtopic.ts +++ b/src/types/generated/authorizationtopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface AuthorizationTopic { diff --git a/src/types/generated/camerapathtopic.ts b/src/types/generated/camerapathtopic.ts index 961da02..7ce26f7 100644 --- a/src/types/generated/camerapathtopic.ts +++ b/src/types/generated/camerapathtopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface CameraPathTopic { diff --git a/src/types/generated/cameratopic.ts b/src/types/generated/cameratopic.ts index 32fa607..7047cd7 100644 --- a/src/types/generated/cameratopic.ts +++ b/src/types/generated/cameratopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface CameraTopic { diff --git a/src/types/generated/documentationtopic.ts b/src/types/generated/documentationtopic.ts index 784af83..649e27c 100644 --- a/src/types/generated/documentationtopic.ts +++ b/src/types/generated/documentationtopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface DocumentationTopic { diff --git a/src/types/generated/downloadeventtopic.ts b/src/types/generated/downloadeventtopic.ts index c652de9..e53f2b0 100644 --- a/src/types/generated/downloadeventtopic.ts +++ b/src/types/generated/downloadeventtopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface DownloadEventTopic { diff --git a/src/types/generated/enginemodetopic.ts b/src/types/generated/enginemodetopic.ts index 873a9ef..ccd2d9f 100644 --- a/src/types/generated/enginemodetopic.ts +++ b/src/types/generated/enginemodetopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface EngineModeTopic { diff --git a/src/types/generated/errorlogtopic.ts b/src/types/generated/errorlogtopic.ts index 1be891f..db22cd8 100644 --- a/src/types/generated/errorlogtopic.ts +++ b/src/types/generated/errorlogtopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface ErrorLogTopic { diff --git a/src/types/generated/eventtopic.ts b/src/types/generated/eventtopic.ts index 28ca747..b19bcb8 100644 --- a/src/types/generated/eventtopic.ts +++ b/src/types/generated/eventtopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export type EventData = @@ -20,7 +21,7 @@ export type EventData = | MissionAddedEventData | MissionEventReachedEventData | MissionRemovedEventData - | ParallelConnectionEventData + | AstrocastConnectionEventData | PlanetEclipsedEventData | PointSpacecraftEventData | ProfileLoadingFinishedEventData @@ -48,7 +49,7 @@ export type EventType = | 'MissionAdded' | 'MissionEventReached' | 'MissionRemoved' - | 'ParallelConnection' + | 'AstrocastConnection' | 'PlanetEclipsed' | 'PointSpacecraft' | 'ProfileLoadingFinished' @@ -136,9 +137,9 @@ export interface MissionRemovedEventData { Identifier: string; event: 'MissionRemoved'; } -export interface ParallelConnectionEventData { +export interface AstrocastConnectionEventData { State: 'Established' | 'Lost' | 'HostshipGained' | 'HostshipLost'; - event: 'ParallelConnection'; + event: 'AstrocastConnection'; } export interface PlanetEclipsedEventData { Eclipsee: string; diff --git a/src/types/generated/flightcontrollertopic.ts b/src/types/generated/flightcontrollertopic.ts index 0bc6097..2f80266 100644 --- a/src/types/generated/flightcontrollertopic.ts +++ b/src/types/generated/flightcontrollertopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export type FlightControllerCommand = diff --git a/src/types/generated/getpropertytopic.ts b/src/types/generated/getpropertytopic.ts index c3f3535..458012a 100644 --- a/src/types/generated/getpropertytopic.ts +++ b/src/types/generated/getpropertytopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ import type { BoolProperty, DMat2Property, DMat3Property, DMat4Property, DVec2Property, DVec3Property, DVec4Property, DoubleListProperty, DoubleProperty, FloatProperty, IVec2Property, IVec3Property, IVec4Property, IntListProperty, IntProperty, LongProperty, Mat2Property, Mat3Property, Mat4Property, OptionProperty, PropertyOwner, SelectionProperty, ShortProperty, StringListProperty, StringProperty, TriggerProperty, UIntProperty, ULongProperty, UShortProperty, UVec2Property, UVec3Property, UVec4Property, Vec2Property, Vec3Property, Vec4Property } from './properties'; diff --git a/src/types/generated/index.ts b/src/types/generated/index.ts index e0207d2..c272999 100644 --- a/src/types/generated/index.ts +++ b/src/types/generated/index.ts @@ -3,6 +3,7 @@ export * from './properties'; export * from './openspacelualibrary'; export * from './actionkeybindtopic'; +export * from './assettreetopic'; export * from './authorizationtopic'; export * from './camerapathtopic'; export * from './cameratopic'; @@ -26,6 +27,7 @@ export * from './triggerpropertytopic'; export * from './versiontopic'; import { ActionKeybindTopic } from './actionkeybindtopic'; +import { AssetTreeTopic } from './assettreetopic'; import { AuthorizationTopic } from './authorizationtopic'; import { CameraPathTopic } from './camerapathtopic'; import { CameraTopic } from './cameratopic'; @@ -50,6 +52,7 @@ import { VersionTopic } from './versiontopic'; export type AllTopics = | ActionKeybindTopic + | AssetTreeTopic | AuthorizationTopic | CameraPathTopic | CameraTopic diff --git a/src/types/generated/luascripttopic.ts b/src/types/generated/luascripttopic.ts index 2c0bb80..366b6b3 100644 --- a/src/types/generated/luascripttopic.ts +++ b/src/types/generated/luascripttopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface LuaScriptTopic { diff --git a/src/types/generated/missiontopic.ts b/src/types/generated/missiontopic.ts index 3b3f779..ac801a6 100644 --- a/src/types/generated/missiontopic.ts +++ b/src/types/generated/missiontopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface MissionTopic { diff --git a/src/types/generated/openspacelualibrary.ts b/src/types/generated/openspacelualibrary.ts index ae484b8..47e6304 100644 --- a/src/types/generated/openspacelualibrary.ts +++ b/src/types/generated/openspacelualibrary.ts @@ -30,6 +30,8 @@ type path = string; type table = object; type action = object; +type trail = object; +type position = object; type custompropertytype = any; type integer = number; type vec2 = [number, number]; @@ -37,15 +39,54 @@ type vec3 = [number, number, number]; //type vec4 = [number, number, number, number]; type ivec2 = [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 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" +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 OpenSpaceLibrary { action: ActionLibrary; asset: AssetLibrary; + astrocast: AstrocastLibrary; audio: AudioLibrary; dashboard: DashboardLibrary; debugging: DebuggingLibrary; @@ -55,11 +96,12 @@ export interface OpenSpaceLibrary { globebrowsing: GlobebrowsingLibrary; iswa: IswaLibrary; keyframeRecording: KeyframeRecordingLibrary; + model: ModelLibrary; modules: ModulesLibrary; + molecule: MoleculeLibrary; navigation: NavigationLibrary; openglCapabilities: OpenglCapabilitiesLibrary; orbitalnavigation: OrbitalnavigationLibrary; - parallel: ParallelLibrary; pathnavigation: PathnavigationLibrary; scriptScheduler: ScriptSchedulerLibrary; sessionRecording: SessionRecordingLibrary; @@ -76,350 +118,394 @@ export interface OpenSpaceLibrary { /** * Passes the argument to FileSystem::absolutePath, which resolves occuring path tokens and returns the absolute path. */ - absPath: (path: string) => Promise + absPath: (path: string) => Promise; /** - * Creates a new property that lives in the `UserProperty` group. + * Creates a new property that lives in the `UserProperties` 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 + addCustomProperty: ( + identifier: string, + type: custompropertytype, + guiName?: string, + description?: string, + onChange?: string + ) => Promise; /** * Loads the SceneGraphNode described in the table and adds it to the SceneGraph. */ - addSceneGraphNode: (node: table) => Promise + addSceneGraphNode: (node: table) => Promise; /** * Will create a ScreenSpaceRenderable from a lua Table and add it in the RenderEngine. */ - addScreenSpaceRenderable: (screenSpace: table) => Promise + addScreenSpaceRenderable: (screenSpace: table) => Promise; /** * Adds a Tag to a SceneGraphNode identified by the provided URI. */ - addTag: (uri: string, tag: string) => Promise + addTag: (uri: string, tag: string) => Promise; /** - * 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. + * 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 + addToPropertyValue: (identifier: string, value: string | number) => Promise; /** - * 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. + * 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 + appendToListProperty: (identifier: string, value: any) => Promise; /** - * Binds a key to Lua command to both execute locally and broadcast to all clients if this node is hosting a parallel connection. + * Binds a key to Lua command to both execute locally and broadcast to all clients if this node is hosting an astrocast connection. */ - bindKey: (key: string, action: string | table) => Promise + bindKey: (key: string, action: string | table) => Promise; /** * Returns the bounding sphere of the scene graph node with the given string as identifier. */ - boundingSphere: (identifier: string) => Promise + boundingSphere: (identifier: string) => Promise; /** * 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 + clearKey: (key: string | string[]) => Promise; /** * Clear all key bindings. */ - clearKeys: () => Promise + clearKeys: () => Promise; + /** + * Returns the name of the computer. + */ + computerName: () => Promise; /** * Returns the whole configuration object as a Dictionary. */ - configuration: () => Promise + configuration: () => Promise
; /** * 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 + createDirectory: (path: path, recursive?: boolean) => Promise; /** * 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 + createSingleColorImage: (name: string, color: vec3) => Promise; /** * Checks whether the provided directory exists. */ - directoryExists: (file: path) => Promise + directoryExists: (file: path) => Promise; /** * 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 + directoryForPath: (file: path) => Promise; /** - * Downloads a file from Lua interpreter. + * Downloads the provided `url` into the location provided by `savePath`. + * @param url The URL to the file that should be downloaded @param savePath The location on disk where the file should be downloaded to @param waitForCompletion If `true`, this function will wait until the download is finished. If the parameter is `false`, the download will occur in the background and this function returns immediately @param overrideExistingFile If `true`, the file will be downloaded even if a file already exists at the `savePath` location. The existing file will be overritten. If it is `false` and a file already exists, no file will be downloaded @returns `true` if the download completed successfully, `false` otherwise. IMPORTANT: If `waitForCompletion` is `true`, this function will always return `true` */ - downloadFile: (url: string, savePath: string, waitForCompletion?: boolean, overrideExistingFile?: boolean) => Promise + downloadFile: ( + url: string, + savePath: string, + waitForCompletion?: boolean, + overrideExistingFile?: boolean + ) => Promise; /** * Extracts the DPI scaling for either the GUI window or if there is no dedicated GUI window, the first window. */ - dpiScaling: () => Promise + dpiScaling: () => Promise; /** - * 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. + * 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 + * stead. If the third argument (endScript) is provided then that script will be run + * ter the fade is finished. */ - fadeIn: (identifier: string, fadeTime?: number, endScript?: string) => Promise + fadeIn: (identifier: string, fadeTime?: number, endScript?: string) => Promise; /** - * 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. + * 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 + * ter the fade is finished. */ - fadeOut: (identifier: string, fadeTime?: number, endScript?: string) => Promise + fadeOut: (identifier: string, fadeTime?: number, endScript?: string) => Promise; /** * Checks whether the provided file exists. */ - fileExists: (file: string) => Promise + fileExists: (file: string) => Promise; + /** + * Returns the size of the provided file. The file must exist for this function to work. + * @param file The path to the file @returns The size of the file + */ + fileSize: (file: string) => Promise; /** * 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
+ guiOrder: () => Promise
; /** * Returns whether a mission with the provided name has been loaded. */ - hasMission: (identifier: string) => Promise + hasMission: (identifier: string) => Promise; /** * 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 + hasProperty: (uri: string) => Promise; /** * Checks whether the specifies SceneGraphNode is present in the current scene. */ - hasSceneGraphNode: (nodeName: string) => Promise + hasSceneGraphNode: (nodeName: string) => Promise; /** * This function returns the size in pixels of an image file. * @param path The location of the image file for which the pixel size will be returned @returns The size of the image in pixels */ - imageSize: (path: path) => Promise + imageSize: (path: path) => Promise; /** * Returns the interaction sphere of the scene graph node with the given string as identifier. */ - interactionSphere: (identifier: string) => Promise + interactionSphere: (identifier: string) => Promise; /** * Inverts the value of a boolean property with the given identifier. */ - invertBooleanProperty: (identifier: string) => Promise + invertBooleanProperty: (identifier: string) => Promise; /** * 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 * @returns A Boolean that specifies if the object is empty or not */ - isEmpty: (object: any) => Promise + isEmpty: (object: any) => Promise; /** * 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 + isMaster: () => Promise; /** * 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 + keyBindings: (key?: string) => Promise; /** * 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 + keyBindingsForAction: (action: string) => Promise; /** * Returns the current layer server from the configuration. */ - layerServer: () => Promise + layerServer: () => Promise; /** * 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
+ loadJson: (path: path) => Promise
; /** * Load mission phases from file. */ - loadMission: (mission: table) => Promise + loadMission: (mission: table) => Promise; /** * 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 + makeIdentifier: (input: string) => Promise; /** - * This function marks the scene graph nodes identified by name as - * interesting, which will provide shortcut access to focus buttons and featured - * properties. + * This function marks the scene graph nodes identified by name as interesting, which + * ll provide shortcut access to focus buttons and featured properties. */ - markInterestingNodes: (sceneGraphNodes: string[]) => Promise + markInterestingNodes: (sceneGraphNodes: string[]) => Promise; /** - * This function marks interesting times for the current scene, which - * will create shortcuts for a quick access. + * This function marks interesting times for the current scene, which will create + * shortcuts for a quick access. */ - markInterestingTimes: (times: table[]) => Promise + markInterestingTimes: (times: table[]) => Promise; /** * Returns a list of all scene graph nodes in the scene that have a renderable of the specific type. */ - nodeByRenderableType: (type: string) => Promise + nodeByRenderableType: (type: string) => Promise; + /** + * Open a file or folder path in the native OS explorer window. For Windows the path is opened in windows explorer and for Linux the default explorer app. + */ + openFileExplorer: (path: path) => Promise; /** * 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 + printDebug: (...args: any[]) => Promise; /** * 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 + printError: (...args: any[]) => Promise; /** * 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 + printFatal: (...args: any[]) => Promise; /** * 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 + printInfo: (...args: any[]) => Promise; /** * 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 + printTrace: (...args: any[]) => Promise; /** * 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 + printWarning: (...args: any[]) => Promise; /** * Returns the enabled add-ons of the profile that was started. */ - profileAddons: () => Promise + profileAddons: () => Promise; /** * Returns the name of the profile with which OpenSpace was started. */ - profileName: () => Promise + profileName: () => Promise; /** * Returns the full path of the profile with which OpenSpace was started. */ - profilePath: () => Promise + profilePath: () => Promise; /** * 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 @returns A list of property URIs */ - property: (uri: string) => Promise + property: (uri: string) => Promise; /** * 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 @returns A list of property owner URIs */ - propertyOwner: (uri: string) => Promise + propertyOwner: (uri: string) => Promise; /** * 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 + propertyValue: (uri: string) => Promise; /** * Returns the number of bytes of system memory that is currently being used. This function only works on Windows. */ - ramInUse: () => Promise + ramInUse: () => Promise; /** * 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 + readCSVFile: (file: path, includeFirstLine?: boolean) => Promise; /** * Reads a file from disk and return its contents. */ - readFile: (file: path) => Promise + readFile: (file: path) => Promise; /** * Reads a file from disk and return its as a list of lines. */ - readFileLines: (file: path) => Promise + readFileLines: (file: path) => Promise; /** - * Rebinds all scripts from the old key (first argument) to the new - * key (second argument). + * Rebinds all scripts from the old key (first argument) to the new key (second + * argument). */ - rebindKey: (oldKey: string, newKey: string) => Promise + rebindKey: (oldKey: string, newKey: string) => Promise; /** * 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 + registerRepeatedScript: ( + identifier: string, + script: string, + timeout?: number, + preScript?: string, + postScript?: string + ) => Promise; /** * Registers the pair of light source, shadower, shadowee, and shadowGroup to act together in order to produce a depth image that is used for shadow calculations. The lightSource, the shadower, and the shadowee must be existing scene graph nodes that are used to calculate the positions of the light and to determine which object is rendered to cast a shadow and which object should receive the shadow. Shadowcasters registered using the same shadow group will have their shadows interact with each other, whereas objects with different shadowGroups will not cast shadows on objects other than the shadowee. * @param lightSource The identifier of the scene graph node that should act as the source of the light for shadowing purposes @param shadower The identifier of the scene graph node that is the object that casts a shadow on the shadowee and other shadowers in the tsame shadow group @param shadowee The identifier of the scene graph node that is the object that receives the shadow of the shadower @param shadowGroup An arbitrary name that identifies a shadow group, meaning multiple shadowcaster registrations that should act in unison. The name must not start with a `_` character. If this parameter is omitted, a suitable unique name will be automatically generated */ - registerShadowcaster: (lightSource: string, shadower: string, shadowee: string, shadowGroup?: string) => Promise + registerShadowcaster: ( + lightSource: string, + shadower: string, + shadowee: string, + shadowGroup?: string + ) => Promise; /** */ - removeCustomProperty: (identifier: string) => Promise + removeCustomProperty: (identifier: string) => Promise; /** - * This function removes unmarks the scene graph nodes identified by - * name as interesting, thus removing the shortcuts from the features properties list. + * Removes a value from 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. If the value was not found, this + * function will not do anything. */ - removeInterestingNodes: (sceneGraphNodes: string[]) => Promise + removeFromListProperty: (identifier: string, value: any) => Promise; + /** + * This function removes unmarks the scene graph nodes identified by name as + * teresting, thus removing the shortcuts from the features properties list. + */ + removeInterestingNodes: (sceneGraphNodes: string[]) => Promise; /** * Removes a previously registered repeated script (see #registerRepeatedScript). */ - removeRepeatedScript: (identifier: string) => Promise + removeRepeatedScript: (identifier: string) => Promise; /** * Removes the SceneGraphNode identified by name or by extracting the 'Identifier' key if the parameter is a table. */ - removeSceneGraphNode: (node: string | table) => Promise + removeSceneGraphNode: (node: string | table) => Promise; /** * Removes all SceneGraphNodes with identifiers matching the input regular expression. */ - removeSceneGraphNodesFromRegex: (regex: string) => Promise + removeSceneGraphNodesFromRegex: (regex: string) => Promise; /** * 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 + removeScreenSpaceRenderable: (identifier: string | table) => Promise; /** * Removes an existing pairing of a shadowcaster group, consisting of a light source, a shadower, a shadowee, and a shadow group. If the pairing exists, it will be removed, causing the shadow calculations to cease. If the pairing does not exist, an error message will be raised. * @param lightSource The identifier of the scene graph node that should act as the source of the light for shadowing purposes @param shadower The identifier of the scene graph node that is the object that casts a shadow on the shadowee and other shadowers in the same shadow group @param shadowee The identifier of the scene graph node that is the object that receives the shadow of the shadower @param shadowGroup An arbitrary name that identifies a shadow group, meaning multiple shadowcaster registrations that should act in unison. The name must not start with a `_` character. If this parameter is omitted, a suitable unique name will be automatically generated. If the same light source, shadower, and shadowee are provided as for a previous register call, the generated name will be identical */ - removeShadowcaster: (lightSource: string, shadower: string, shadowee: string, shadowGroup?: string) => Promise + removeShadowcaster: ( + lightSource: string, + shadower: string, + shadowee: string, + shadowGroup?: string + ) => Promise; /** * Removes a tag(second argument) from a scene graph node (first argument). */ - removeTag: (uri: string, tag: string) => Promise + removeTag: (uri: string, tag: string) => Promise; /** * Resets the camera position to the same position where the profile originally started. */ - resetCamera: () => Promise + resetCamera: () => Promise; /** * Reset screenshot index to 0. */ - resetScreenshotNumber: () => Promise + resetScreenshotNumber: () => Promise; /** * 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 + resolveShortcut: (path: path) => Promise; /** * 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 + saveBase64File: (filePath: path, base64Data: string) => Promise; /** * 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, shouldOverwrite?: boolean) => Promise + saveSettingsToProfile: ( + saveFileName?: string, + shouldOverwrite?: boolean + ) => Promise; /** * Returns a list of all scene graph nodes in the scene. */ - sceneGraphNodes: () => Promise + sceneGraphNodes: () => Promise; /** * 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 + scheduleScript: (script: string, delay: number) => Promise; /** * Returns a list of all screen - space renderables. */ - screenSpaceRenderables: () => Promise + screenSpaceRenderables: () => Promise; /** * Set the current mission. */ - setCurrentMission: (identifier: string) => Promise - /** - * This function sets the default values for the dashboard consisting - * of 'DashboardItemDate', 'DashboardItemSimulationIncrement', 'DashboardItemDistance', - * 'DashboardItemFramerate', and 'DashboardItemParallelConnection'. - */ - setDefaultDashboard: () => Promise + setCurrentMission: (identifier: string) => Promise; /** * 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 + setGuiOrder: (guiPath: string, list: string[]) => Promise; /** * 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 + setParent: (identifier: string, newParent: string) => Promise; /** * 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 + setPathToken: (pathToken: string, path: path) => Promise; /** * 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 @@ -464,7 +550,14 @@ export interface OpenSpaceLibrary { * @param isBouncing If this value is set to `true`, the property will interpolate to the * provided new value, then back to the original value, until manually stopped. */ - setPropertyValue: (uri: string, value: null | string | number | boolean | table, duration?: number, easing?: easingfunction, postscript?: string, isBouncing?: boolean) => Promise + setPropertyValue: ( + uri: string, + value: null | string | number | boolean | table, + duration?: number, + easing?: easingfunction, + postscript?: string, + isBouncing?: boolean + ) => Promise; /** * 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 @@ -493,20 +586,27 @@ export interface OpenSpaceLibrary { * @param isBouncing If this value is set to `true`, the property will interpolate to the * provided new value, then back to the original value, until manually stopped. */ - setPropertyValueSingle: (uri: string, value: null | string | number | boolean | table, duration?: number, easing?: easingfunction, postscript?: string, isBouncing?: boolean) => Promise + setPropertyValueSingle: ( + uri: string, + value: null | string | number | boolean | table, + duration?: number, + easing?: easingfunction, + postscript?: string, + isBouncing?: boolean + ) => Promise; /** * Sets the folder used for storing screenshots or session recording frames. */ - setScreenshotFolder: (newFolder: string) => Promise + setScreenshotFolder: (newFolder: string) => Promise; /** * Stops the bouncing interpolation on the provided property and interpolate the value to the original starting value over the original duration. * @param uri The URI of the property whose bouncing interpolation should be stopped */ - stopPropertyBouncing: (uri: string) => Promise + stopPropertyBouncing: (uri: string) => Promise; /** * Take a screenshot and return the screenshot number. The screenshot will be stored in the ${SCREENSHOTS} folder. */ - takeScreenshot: () => Promise + takeScreenshot: () => Promise; /** * A utility function to return a specific value based on a True/False condition. * @param condition The condition to check against @@ -515,258 +615,308 @@ export interface OpenSpaceLibrary { * @returns Either the trueValue of falseValue, depending on if the condition is true * or not */ - ternary: (condition: boolean, trueValue: any, falseValue: any) => Promise + ternary: (condition: boolean, trueValue: any, falseValue: any) => Promise; /** - * 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. + * 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" + * operty will be used instead. If the third argument (endScript) is provided then + * at script will be run after the fade is finished. */ - toggleFade: (identifier: string, fadeTime?: number, endScript?: string) => Promise + toggleFade: ( + identifier: string, + fadeTime?: number, + endScript?: string + ) => Promise; /** * Toggles the shutdown mode that will close the application after the countdown timer is reached. */ - toggleShutdown: () => Promise + toggleShutdown: () => Promise; /** * Unloads a previously loaded mission */ - unloadMission: (identifierOrMission: string | table) => Promise + unloadMission: (identifierOrMission: string | table) => Promise; /** * 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 + unzipFile: ( + source: string, + destination: string, + deleteSource?: boolean + ) => Promise; /** * This function returns information about the current OpenSpace version. The resulting table has the structure: \\code Version = { Major = Minor = Patch = }, Commit = Branch = \\endcode */ - version: () => Promise
+ version: () => Promise
; /** * Returns the number of bytes of video memory that is currently being used. This function only works on Windows. */ - vramInUse: () => Promise + vramInUse: () => Promise; /** * 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 + walkDirectory: (path: path, recursive?: boolean, sorted?: boolean) => Promise; /** * 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 + walkDirectoryFiles: ( + path: path, + recursive?: boolean, + sorted?: boolean + ) => Promise; /** * 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 + walkDirectoryFolders: ( + path: path, + recursive?: boolean, + sorted?: boolean + ) => Promise; /** * Returns the world position of the scene graph node with the given string as identifier. */ - worldPosition: (identifier: string) => Promise + worldPosition: (identifier: string) => Promise; /** * Returns the world rotation matrix of the scene graph node with the given string as identifier. */ - worldRotation: (identifier: string) => Promise + worldRotation: (identifier: string) => Promise; /** * Writes out documentation files. */ - writeDocumentation: () => Promise + writeDocumentation: () => Promise; } // interface OpenSpaceLibrary export interface ActionLibrary { /** - * Returns information about the action as a table with the keys 'Identifier', 'Command', 'Name', 'Documentation', 'GuiPath', and 'Synchronization'. + * Returns information about the action as a table with the keys 'Identifier', 'Command', Returns information about the action as a table with the keys: `Identifier`, `Command`, `Name`, `Documentation`, `GuiPath`, `IsLocal`, and `IsHidden`. */ - action: (identifier: string) => Promise
+ action: (identifier: string) => Promise
; /** - * Returns all registered actions in the system as a table of tables each containing the keys 'Identifier', 'Command', 'Name', 'Documentation', 'GuiPath', and 'Synchronization'. + * Returns all registered actions in the system as a table of tables each containing the keys 'Identifier', 'Command', 'Name', 'Documentation', 'GuiPath', and keys: `Identifier`, `Command`, `Name`, `Documentation`, `GuiPath`, `IsLocal`, and `IsHidden`. */ - actions: () => Promise + actions: () => Promise; /** * Checks if the passed identifier corresponds to an action. */ - hasAction: (identifier: string) => Promise + hasAction: (identifier: string) => Promise; /** - * 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). + * 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 (= true) or remotely (= false, the default). */ - registerAction: (action: action) => Promise + registerAction: (action: action) => Promise; /** * 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 + removeAction: (action: string | table) => Promise; /** * Triggers the action given by the specified identifier. */ - triggerAction: (id: string, arg?: table) => Promise + triggerAction: (id: string, arg?: table) => Promise; } // interface ActionLibrary export 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 + add: (assetName: string) => Promise; /** * Returns the paths to all loaded assets, loaded directly or indirectly, as a table containing the paths to all loaded assets. */ - allAssets: () => Promise + allAssets: () => Promise; /** * 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 + isLoaded: (assetName: string) => Promise; /** * Returns the path to all parents that are still interested in this Asset e.g., through 'asset.require()'. */ - parents: (assetName: string) => Promise + parents: (assetName: string) => Promise; /** * 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 + reload: (assetName: string) => Promise; /** * 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 + remove: (assetName: string) => Promise; /** * Removes all assets that are currently loaded. */ - removeAll: () => Promise + removeAll: () => Promise; /** * 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 + rootAssets: () => Promise; } // interface AssetLibrary +export interface AstrocastLibrary { + /** + * Connect to astrocasting. + */ + connect: () => Promise; + /** + * Disconnect from astrocasting. + */ + disconnect: () => Promise; + /** + */ + joinServer: ( + port: string, + address: string, + serverName: string, + password: string, + hostpassword?: string, + name?: string + ) => Promise; + /** + * Request to be the host for this session. + */ + requestHostship: (hostPassword?: string) => Promise; + /** + * Resign hostship. + */ + resignHostship: () => Promise; +} // interface AstrocastLibrary + export interface AudioLibrary { /** * Returns the list of all tracks that are currently playing. * @returns The list of all tracks that are currently playing */ - currentlyPlaying: () => Promise + currentlyPlaying: () => Promise; /** * Returns the global volume for all track. The number returned will be greater or equal to 0. * @returns The global volume */ - globalVolume: () => Promise + globalVolume: () => Promise; /** * 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 @returns `Yes` if the track is looping, `No` otherwise */ - isLooping: (identifier: string) => Promise + isLooping: (identifier: string) => Promise; /** * 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 @returns `true` if the track is currently paused, `false` if it is playing */ - isPaused: (identifier: string) => Promise + isPaused: (identifier: string) => Promise; /** * 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 @returns `true` if the track is currently playing, `false` otherwise */ - isPlaying: (identifier: string) => Promise + isPlaying: (identifier: string) => Promise; /** * 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 + pauseAll: () => Promise; /** * 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 + pauseAudio: (identifier: string) => Promise; /** * Takes all of the sounds that are currently registers, unpauses them and plays them from their starting points. */ - playAllFromStart: () => Promise + playAllFromStart: () => Promise; /** * 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 + playAudio: (path: path, identifier: string, shouldLoop?: boolean) => Promise; /** * 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 + playAudio3d: ( + path: path, + identifier: string, + position: vec3, + shouldLoop?: boolean + ) => Promise; /** * 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 + resumeAll: () => Promise; /** * 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 + resumeAudio: (identifier: string) => Promise; /** * 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 + set3dListenerPosition: (position: vec3, lookAt?: vec3, up?: vec3) => Promise; /** * 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 + set3dSourcePosition: (identifier: string, position: vec3) => Promise; /** * 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 + setGlobalVolume: (volume: number, fade?: number) => Promise; /** * 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 + setLooping: (identifier: string, shouldLoop: boolean) => Promise; /** * 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 + setSpeakerPosition: (channel: integer, position: vec3) => Promise; /** * 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 + setVolume: (identifier: string, volume: number, fade?: number) => Promise; /** * Returns the position for the speaker of the provided \\p channel. * @param channel The channel for which the position should be returned @returns The position for the speaker of the provided \\p channel */ - speakerPosition: (channel: integer) => Promise + speakerPosition: (channel: integer) => Promise; /** * 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 + stopAll: () => Promise; /** * 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 + stopAudio: (identifier: string) => Promise; /** * 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 @returns The volume for the track referred to by the \\p handle, which will be greater or equal to 0 */ - volume: (identifier: string) => Promise + volume: (identifier: string) => Promise; } // interface AudioLibrary export interface DashboardLibrary { /** * Adds a new dashboard item to the main dashboard */ - addDashboardItem: (dashboard: table) => Promise + addDashboardItem: (dashboard: table) => Promise; /** * Adds a new dashboard item to an existing SceenSpaceDashboard. */ - addDashboardItemToScreenSpace: (identifier: string, dashboard: table) => Promise + addDashboardItemToScreenSpace: (identifier: string, dashboard: table) => Promise; /** * Removes all dashboard items from the main dashboard. */ - clearDashboardItems: () => Promise + clearDashboardItems: () => Promise; /** * Returns all loaded dashboard-item identifiers from the main dashboard. * @returns A list of loaded dashboard-item identifiers from the main dashboard */ - dashboardItems: () => Promise + dashboardItems: () => Promise; /** * Removes the dashboard item with the specified identifier. */ - removeDashboardItem: (identifier: string | table) => Promise + removeDashboardItem: (identifier: string | table) => Promise; /** * Removes all dashboard items from an existing ScreenSpaceDashboard. */ - removeDashboardItemsFromScreenSpace: (identifier: string) => Promise + removeDashboardItemsFromScreenSpace: (identifier: string) => Promise; } // interface DashboardLibrary export interface DebuggingLibrary { @@ -786,46 +936,50 @@ export interface DebuggingLibrary { * in meters. If not specified, the size is set to 2.5 times the * bounding sphere of the selected node. */ - createCoordinateAxes: (nodeIdentifier?: string, scale?: number) => Promise + createCoordinateAxes: (nodeIdentifier?: string, scale?: number) => Promise; /** * Removes the rendered control points. */ - removePathControlPoints: () => Promise + removePathControlPoints: () => Promise; /** * Removes the currently rendered camera path if there is one. */ - removeRenderedCameraPath: () => Promise + removeRenderedCameraPath: () => Promise; /** * 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 + renderCameraPath: ( + nSteps?: integer, + renderDirections?: boolean, + directionLineLength?: number + ) => Promise; /** * 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 + renderPathControlPoints: (radius?: number) => Promise; } // interface DebuggingLibrary export interface EventLibrary { /** * Disables the event with the provided identifier. */ - disableEvent: (identifier: integer) => Promise + disableEvent: (identifier: integer) => Promise; /** * Enables the event with the provided identifier. */ - enableEvent: (identifier: integer) => Promise + enableEvent: (identifier: integer) => Promise; /** * Returns the list of registered events. */ - registeredEvents: () => Promise + registeredEvents: () => Promise; /** * Registers an action to be executed whenever an event is encountered. If the optional third parameter is provided, it describes a filter that the event is being checked against and only if it passes the filter, the action is triggered. */ - registerEventAction: (event: string, action: string, filter?: table) => Promise + registerEventAction: (event: string, action: string, filter?: table) => Promise; /** * Unregisters a specific combination of event, action, and potentially a filter. */ - unregisterEventAction: (event: string, action: string, filter?: table) => Promise + unregisterEventAction: (event: string, action: string, filter?: table) => Promise; } // interface EventLibrary export interface ExoplanetsLibrary { @@ -835,23 +989,23 @@ export interface ExoplanetsLibrary { * must match the name as given in the [NASA Exoplanet Archive](https://exoplanetarchive.ipac.caltech.edu/). * @param starName The name of the star */ - addExoplanetSystem: (starName: string) => Promise + addExoplanetSystem: (starName: string) => Promise; /** * Add multiple exoplanet systems to the scene, based on a list of names. * Note that the formatting of the name must match the one in the dataset. That is, * they must match the names as given in the [NASA Exoplanet Archive](https://exoplanetarchive.ipac.caltech.edu/). * @param listOfStarNames A list of star names for which to create the exoplanet systems */ - addExoplanetSystems: (listOfStarNames: string[]) => Promise + addExoplanetSystems: (listOfStarNames: string[]) => Promise; /** * Lists the names of the host stars of all exoplanet systems that have sufficient data for generating a visualization, and prints the list to the console. */ - listAvailableExoplanetSystems: () => Promise + listAvailableExoplanetSystems: () => Promise; /** * Returns a list with names of the host star of all the exoplanet systems that have sufficient data for generating a visualization, based on the module's loaded data file. * @returns A list of exoplanet host star names */ - listOfExoplanets: () => Promise + listOfExoplanets: () => Promise; /** * Load a set of exoplanets based on custom data, in the form of a CSV file, and add * them to the rendering. Can be used to load custom datasets, or more recent planets @@ -866,7 +1020,7 @@ export interface ExoplanetsLibrary { * rendering performance. * @param csvFile A path to a .csv file that contains the data for the exoplanets */ - loadExoplanetsFromCsv: (csvFile: string) => Promise + loadExoplanetsFromCsv: (csvFile: string) => Promise; /** * Load a set of exoplanet information based on custom data in the form of a CSV file. * The format and column names in the CSV should be the same as the ones provided by the [NASA Exoplanet Archive](https://exoplanetarchive.ipac.caltech.edu/). @@ -874,18 +1028,18 @@ export interface ExoplanetsLibrary { * @param csvFile A path to the CSV file to load the data from * @returns A list of objects of the type [ExoplanetSystemData](#exoplanets_data_exoplanetsystem), that can be used to create the scene graph nodes for the exoplanet systems */ - loadSystemDataFromCsv: (csvFile: string) => Promise + loadSystemDataFromCsv: (csvFile: string) => Promise; /** * Remove a loaded exoplanet system. * @param starName The name of the host star for the system to remove */ - removeExoplanetSystem: (starName: string) => Promise + removeExoplanetSystem: (starName: string) => Promise; /** * Return an object containing the information needed to add a specific exoplanet system. The data is retrieved from the module's prepared datafile for exoplanets. This file is in a binary format, for fast retrieval during runtime. * @param starName The name of the star to get the information for * @returns An object of the type [ExoplanetSystemData](#exoplanets_data_exoplanetsystem) that can be used to create the scene graph nodes for the exoplanet system */ - systemData: (starName: string) => Promise
+ systemData: (starName: string) => Promise
; } // interface ExoplanetsLibrary export interface GaiaLibrary { @@ -900,7 +1054,7 @@ export interface GaiaLibrary { * @param position The position of the center of the box, specified in galactic * coordinates in Kiloparsec */ - addClippingBox: (identifier: string, size: vec3, position: vec3) => Promise + addClippingBox: (identifier: string, size: vec3, position: vec3) => Promise; /** * Creates a clipping sphere for a specific Gaia dataset, that can be used to filter * out stars that are outside of the sphere. The sphere is visualized as a grid in the @@ -911,15 +1065,15 @@ export interface GaiaLibrary { * [RenderableGaiaStars](#gaia_renderable_gaiastars) to be filtered * @param radius The desired radius outside of the clipping sphere, in Kiloparsec */ - addClippingSphere: (identifier: string, radius: number) => Promise + addClippingSphere: (identifier: string, radius: number) => Promise; /** * Remove any added clipping box. */ - removeClippingBox: () => Promise + removeClippingBox: () => Promise; /** * Remove any added clipping sphere. */ - removeClippingSphere: () => Promise + removeClippingSphere: () => Promise; } // interface GaiaLibrary export interface GlobebrowsingLibrary { @@ -932,7 +1086,7 @@ export interface GlobebrowsingLibrary { * openspace.globebrowsing.addBlendingLayersFromDirectory(directory, "Earth") * ``` */ - addBlendingLayersFromDirectory: (directory: string, nodeName: string) => Promise + addBlendingLayersFromDirectory: (directory: string, nodeName: string) => Promise; /** * Creates a new SceneGraphNode that can be used as focus node for a specific point on * a globe. If no altitude is specified, an altitude of 0 will be used. @@ -943,7 +1097,13 @@ export interface GlobebrowsingLibrary { * ) * ``` */ - addFocusNodeFromLatLong: (name: string, globeIdentifier: string, latitude: number, longitude: number, altitude?: number) => Promise + addFocusNodeFromLatLong: ( + name: string, + globeIdentifier: string, + latitude: number, + longitude: number, + altitude?: number + ) => Promise; /** * Retrieves all info files recursively in the directory passed as the first argument * to this function. The name and location retrieved from these info files are then @@ -953,17 +1113,17 @@ export interface GlobebrowsingLibrary { * openspace.globebrowsing.addFocusNodesFromDirectory(directory, "Mars") * ``` */ - addFocusNodesFromDirectory: (directory: string, nodeName: string) => Promise + addFocusNodesFromDirectory: (directory: string, nodeName: string) => Promise; /** * Add a GeoJson layer specified by the given table to the specified globe. * @param globeIdentifier The identifier of the scene graph node for the globe @param table A table with information about the GeoJson layer. See [this page](#globebrowsing_geojsoncomponent) for details on what fields and settings the table may contain */ - addGeoJson: (globeIdentifier: string, table: table) => Promise + addGeoJson: (globeIdentifier: string, table: table) => Promise; /** * Add a GeoJson layer from the given file name and add it to the current anchor node, if it is a globe. Note that you might have to increase the height offset for the added feature to be visible on the globe, if using a height map. * @param filename The path to the GeoJSON file @param name An optional name that the loaded feature will get in the user interface */ - addGeoJsonFromFile: (filename: string, name?: string) => Promise + addGeoJsonFromFile: (filename: string, name?: string) => Promise; /** * Adds a new layer from NASA GIBS to the Earth globe. * For all specifications, see @@ -975,17 +1135,23 @@ export interface GlobebrowsingLibrary { * ) * ``` */ - addGibsLayer: (layer: string, resolution: string, format: string, startDate: string, endDate: string) => Promise + addGibsLayer: ( + layer: string, + resolution: string, + format: string, + startDate: string, + endDate: string + ) => Promise; /** * Adds a layer to the specified globe. The second argument is the layer group which can be any of the supported layer groups. The third argument is the dictionary defining the layer. * @param globeIdentifier The identifier of the scene graph node of which to add the layer. The renderable of the scene graph node must be a [RenderableGlobe](#globebrowsing_renderable_globe) @param layerGroup The identifier of the layer group in which to add the layer @param layer A dictionary defining the layer. See [this page](#globebrowsing_layer) for details on what fields and settings the dictionary may contain */ - addLayer: (globeIdentifier: string, layerGroup: string, layer: table) => Promise + addLayer: (globeIdentifier: string, layerGroup: string, layer: table) => Promise; /** * Returns an array of tables that describe the available layers that are supported by the WMS server identified by the provided name. The `URL` component of the returned table can be used in the `FilePath` argument for a call to the `addLayer` function to add the value to a globe. * @param name The name of the WMS server for which to get the information */ - capabilitiesWMS: (name: string) => Promise + capabilitiesWMS: (name: string) => Promise; /** * Creates an XML configuration for a GIBS dataset. * For all specifications, see @@ -1007,58 +1173,84 @@ export interface GlobebrowsingLibrary { * ) * ``` */ - createGibsGdalXml: (layerName: string, date: string, resolution: string, format: string) => Promise + createGibsGdalXml: ( + layerName: string, + date: string, + resolution: string, + format: string + ) => Promise; /** * Creates an XML configuration for a temporal GIBS dataset to be used in a * TemporalTileprovider. */ - createTemporalGibsGdalXml: (layerName: string, resolution: string, format: string) => Promise + createTemporalGibsGdalXml: ( + layerName: string, + resolution: string, + format: string + ) => Promise; /** * Remove the GeoJson layer specified by the given table or string identifier from the specified globe. * @param globeIdentifier The identifier of the scene graph node for the globe @param tableOrIdentifier Either an identifier for the GeoJson layer to be removed, or a table that includes the identifier */ - deleteGeoJson: (globeIdentifier: string, tableOrIdentifier: string | table) => Promise + deleteGeoJson: ( + globeIdentifier: string, + tableOrIdentifier: string | table + ) => Promise; /** * Removes a layer from the specified globe. * @param globeIdentifier The identifier of the scene graph node of which to remove the layer. The renderable of the scene graph node must be a [RenderableGlobe](#globebrowsing_renderable_globe) @param layerGroup The identifier of the layer group from which to remove the layer @param layerOrName Either the identifier for the layer or a dictionary with the `Identifier` key that is used instead */ - deleteLayer: (globeIdentifier: string, layerGroup: string, layerOrName: string | table) => Promise + deleteLayer: ( + globeIdentifier: string, + layerGroup: string, + layerOrName: string | table + ) => Promise; /** * Get geographic coordinates of the camera position in latitude, longitude, and altitude (degrees and meters). * @param useEyePosition If true, use the view direction of the camera instead of the camera position */ - geoPositionForCamera: (useEyePosition?: boolean) => Promise<[number, number, number]> + geoPositionForCamera: (useEyePosition?: boolean) => Promise<[number, number, number]>; /** * Returns an object containing a list of all loaded `RenderableGlobe`s sorted first by the presence of WMS server info, then alphabetically. The index `firstIndexWithoutUrl` indicates the first item in the list that does not have WMS server info. * @returns Table containing a list of `renderableGlobe` identifiers, and an index indicating the first item in the list that does not have a WMS server */ - globes: () => Promise
+ globes: () => Promise
; /** * Go to the chunk on a globe with given index x, y, level. * @param globeIdentifier The identifier of the scene graph node for the globe @param x The x value of the tile index @param y The y value of the tile index @param level The level of the tile index */ - goToChunk: (globeIdentifier: string, x: integer, y: integer, level: integer) => Promise + goToChunk: ( + globeIdentifier: string, + x: integer, + y: integer, + level: integer + ) => Promise; /** * Returns the list of layers for the specified globe, for a specific layer group. * @param globeIdentifier The identifier of the scene graph node for the globe @param layerGroup The identifier of the layer group for which to list the layers */ - layers: (globeIdentifier: string, layerGroup: string) => Promise + layers: (globeIdentifier: string, layerGroup: string) => Promise; /** * Loads and parses the WMS capabilities XML file from a remote server. * @param name The name of the capabilities that can be used to later refer to the set of capabilities @param globe The identifier of the globe for which this server is applicable @param url The URL at which the capabilities file can be found */ - loadWMSCapabilities: (name: string, globe: string, url: string) => Promise + loadWMSCapabilities: (name: string, globe: string, url: string) => Promise; /** * Loads all WMS servers from the provided file and passes them to the * 'openspace.globebrowsing.loadWMSCapabilities' file. */ - loadWMSServersFromFile: (filePath: string) => Promise + loadWMSServersFromFile: (filePath: string) => Promise; /** * Rearranges the order of a single layer on a globe. The first position in the list has index 0, and the last position is given by the number of layers minus one. * The `source` and `destination` parameters can also be the identifiers of the layers to be moved. If `destination` is a name, the source layer is moved below that destination layer. * @param globeIdentifier The identifier of the globe @param layerGroup The identifier of the layer group @param source The original position of the layer that should be moved, either as an index in the list or the identifier of the layer to be moved @param destination The new position in the list, either as an index in the list or as the identifier of the layer after which to place the moved layer */ - moveLayer: (globeIdentifier: string, layerGroup: string, source: integer | string, destination: integer | string) => Promise + moveLayer: ( + globeIdentifier: string, + layerGroup: string, + source: integer | string, + destination: integer | string + ) => Promise; /** * Parses the passed info file and return the table with the information provided in * the info file. @@ -1071,12 +1263,12 @@ export interface GlobebrowsingLibrary { * openspace.globebrowsing.addLayer("Earth", "HeightLayers", t.height) * ``` */ - parseInfoFile: (file: string) => Promise
+ parseInfoFile: (file: string) => Promise
; /** * Removes the specified WMS server from the list of available servers. The name parameter corresponds to the first argument in the `loadWMSCapabilities` call that was used to load the WMS server. * @param name The name of the WMS server to remove */ - removeWMSServer: (name: string) => Promise + removeWMSServer: (name: string) => Promise; /** * Sets the position of a scene graph node that has a * [GlobeTranslation](#base_translation_globe) and/or @@ -1096,7 +1288,13 @@ export interface GlobebrowsingLibrary { * @param altitude An optional altitude value for the new position, in meters. If * excluded, an altitude of 0 will be used */ - setNodePosition: (nodeIdentifier: string, globeIdentifier: string, latitude: number, longitude: number, altitude?: number) => Promise + setNodePosition: ( + nodeIdentifier: string, + globeIdentifier: string, + latitude: number, + longitude: number, + altitude?: number + ) => Promise; /** * Sets the position of a scene graph node that has a * [GlobeTranslation](#base_translation_globe) and/or @@ -1113,643 +1311,782 @@ export interface GlobebrowsingLibrary { * @param useAltitude If true, the camera's altitude will also be used for the new * positions. Otherwise, it will not */ - setNodePositionFromCamera: (nodeIdentifer: string, useAltitude?: boolean) => Promise + setNodePositionFromCamera: ( + nodeIdentifer: string, + useAltitude?: boolean + ) => Promise; /** * Return a list of all WMS servers associated with the `renderableGlobe` globe. * @param globe The identifier of the `renderableGlobe` to fetch WMS servers for @returns A list of WMS server info containing its name and URL */ - urlInfo: (globe: string) => Promise + urlInfo: (globe: string) => Promise; } // interface GlobebrowsingLibrary export interface IswaLibrary { /** * Adds a cdf files to choose from. */ - addCdfFiles: (path: string) => Promise + addCdfFiles: (path: string) => Promise; /** * Adds a IswaCygnet. */ - addCygnet: (id?: integer, type?: string, group?: string) => Promise + addCygnet: (id?: integer, type?: string, group?: string) => Promise; /** * Adds KameleonPlanes from cdf file. */ - addKameleonPlanes: (group: string, pos: integer) => Promise + addKameleonPlanes: (group: string, pos: integer) => Promise; /** * Adds a Screen Space Cygnets. */ - addScreenSpaceCygnet: (d: table) => Promise + addScreenSpaceCygnet: (d: table) => Promise; /** * Remove a Cygnets. */ - removeCygnet: (name: string) => Promise + removeCygnet: (name: string) => Promise; /** * Remove a group of Cygnets. */ - removeGroup: (name: string) => Promise + removeGroup: (name: string) => Promise; /** * Remove a Screen Space Cygnets. */ - removeScreenSpaceCygnet: (id: integer) => Promise + removeScreenSpaceCygnet: (id: integer) => Promise; /** * Sets the base URL. */ - setBaseUrl: (url: string) => Promise + setBaseUrl: (url: string) => Promise; } // interface IswaLibrary export interface KeyframeRecordingLibrary { /** * Adds a keyframe at the specified sequence - time. */ - addCameraKeyframe: (sequenceTime: number) => Promise + addCameraKeyframe: (sequenceTime: number) => Promise; /** * Adds a keyframe at the specified sequence - time. */ - addScriptKeyframe: (sequenceTime: number, script: string) => Promise + addScriptKeyframe: (sequenceTime: number, script: string) => Promise; /** */ - keyframes: () => Promise + keyframes: () => Promise; /** * Loads a sequence from the specified file. */ - loadSequence: (filename: path) => Promise + loadSequence: (filename: path) => Promise; /** * Move keyframe of `index` to the new specified `sequenceTime`. */ - moveKeyframe: (index: integer, sequenceTime: number) => Promise + moveKeyframe: (index: integer, sequenceTime: number) => Promise; /** * Starts a new sequence of keyframes, any previously loaded sequence is discarded. */ - newSequence: () => Promise + newSequence: () => Promise; /** * Pauses a playing sequence. */ - pause: () => Promise + pause: () => Promise; /** * Playback sequence optionally from the specified `sequenceTime` or if not specified starts playing from the current time set within the sequence. */ - play: (sequenceTime?: number) => Promise + play: (sequenceTime?: number) => Promise; /** * Removes a keyframe at the specified 0 - based index. */ - removeKeyframe: (index: integer) => Promise + removeKeyframe: (index: integer) => Promise; /** * Saves the current sequence of keyframes to disk by the optionally specified `filename`. */ - saveSequence: (filename: path) => Promise + saveSequence: (filename: path) => Promise; /** * Update the camera position at keyframe specified by the 0 - based index. */ - updateKeyframe: (index: integer) => Promise + updateKeyframe: (index: integer) => Promise; } // interface KeyframeRecordingLibrary +export interface ModelLibrary { + /** + * Prints the model tree of the given filepath model file. The node names detected during reading and the hierarchy of the nodes will be printed. This is useful for debugging and finding correct node names for applying custom transformations to internal model nodes. + * The given filepath must not be empty, must contain an extension, and must be a valid model file that can be read with the `ModelReaderAssimp` reader. The `ModelReaderAssimp` reader must have been added to the `ModelReader` before calling this function. Will throw a `ModelLoadException` if there was an error reading the file, or a `MissingReaderException` if there was no reader for the specified filepath. + * @param filepath The model file on disk whose model tree should be printed. + */ + printModelTree: (filepath: path) => Promise; +} // interface ModelLibrary + export interface ModulesLibrary { /** * Checks whether the passed OpenSpaceModule is loaded. */ - isLoaded: (moduleName: string) => Promise + isLoaded: (moduleName: string) => Promise; } // interface ModulesLibrary +export interface MoleculeLibrary { + /** + * Searches the RCSB protein data bank for the provided molecule id, for example + * '1C17', downloads the PDB file and adds it as a new scene graph node in the center + * of the solar system. + * To find an entry to add, use the search field found at https://www.rcsb.org/, the + * entry id will then be a four letter code listed in the URL when visiting an entry + * or at the top of the page of that entry. + */ + addMoleculePDB: (molecule: string) => Promise; +} // interface MoleculeLibrary + export interface NavigationLibrary { /** * 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. * @param value A positive value rolls the camera to the left and a negative value rolls the camera to the right */ - addGlobalRoll: (value: number) => Promise + addGlobalRoll: (value: number) => Promise; /** * 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. * @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) */ - addGlobalRotation: (horizontal: number, vertical: number) => Promise + addGlobalRotation: (horizontal: number, vertical: number) => Promise; /** * 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. * @param value A positive value rolls the camera to the left and a negative value rolls the camera to the right */ - addLocalRoll: (value: number) => Promise + addLocalRoll: (value: number) => Promise; /** * 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. * @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) */ - addLocalRotation: (horizontal: number, vertical: number) => Promise + addLocalRotation: (horizontal: number, vertical: number) => Promise; /** * 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. * @param value A positive value moves the camera closer to the focus node, and a negative value moves the camera further away */ - addTruckMovement: (value: number) => Promise + addTruckMovement: (value: number) => Promise; /** * Returns the deadzone for the desired axis of the provided joystick. * @param joystickName The name for the joystick or game controller which information should be returned @param axis The joystick axis for which to get the deadzone value @returns The deadzone value */ - axisDeadzone: (joystickName: string, axis: integer) => Promise + axisDeadzone: (joystickName: string, axis: integer) => Promise; /** * Bind an axis of a joystick to be used as a certain type, and optionally define detailed settings for the axis. * @param joystickName The name for the joystick or game controller that should be bound @param axis The axis of the joystick that should be bound @param axisType The type of movement that the axis should be mapped to @param shouldInvert Decides if the joystick axis movement should be inverted or not @param joystickType What type of joystick or axis this is. Decides if the joystick behaves more like a joystick or a trigger. Either `\"JoystickLike\"` or `\"TriggerLike\"`, where `\"JoystickLike\"` is default @param isSticky If true, the value is calculated relative to the previous value. If false, the value is used as is @param shouldFlip Reverses the movement of the camera that the joystick produces @param sensitivity Sensitivity for this axis, in addition to the global sensitivity */ - bindJoystickAxis: (joystickName: string, axis: integer, axisType: string, shouldInvert?: boolean, joystickType?: string, isSticky?: boolean, shouldFlip?: boolean, sensitivity?: number) => Promise + bindJoystickAxis: ( + joystickName: string, + axis: integer, + axisType: string, + shouldInvert?: boolean, + joystickType?: string, + isSticky?: boolean, + shouldFlip?: boolean, + sensitivity?: number + ) => Promise; /** * Binds an axis of a joystick to a numerical property value in OpenSpace. This means that interacting with the joystick will change the property value, within a given min-max range. * The axis value will be rescaled from [-1, 1] to the provided [min, max] range (default is [0, 1]). * @param joystickName The name for the joystick or game controller that should be bound @param axis The axis of the joystick that should be bound @param propertyUri The identifier (URI) of the property that this joystick axis should modify @param min The minimum value that this axis can set for the property @param max The maximum value that this axis can set for the property @param shouldInvert If the joystick movement should be inverted or not @param isRemote If true, the property change will also be executed on connected nodes. If false, the property change will only affect the master node */ - bindJoystickAxisProperty: (joystickName: string, axis: integer, propertyUri: string, min?: number, max?: number, shouldInvert?: boolean, isRemote?: boolean) => Promise + bindJoystickAxisProperty: ( + joystickName: string, + axis: integer, + propertyUri: string, + min?: number, + max?: number, + shouldInvert?: boolean, + isRemote?: boolean + ) => Promise; /** * Bind a Lua script to one of the buttons for a joystick. * @param joystickName The name for the joystick or game controller @param button The button to which to bind the script @param command The script that should be executed on button trigger @param documentation The documentation for the provided script/command @param action The action for when the script should be executed. This defaults to `\"Press\"`, which means that the script is run when the user presses the button. Alternatives are `\"Idle\"` (if the button is unpressed and has been unpressed since the last frame), `\"Repeat\"` (if the button has been pressed since longer than the last frame), and `\"Release\"` (if the button was released since the last frame) @param isRemote A value saying whether the command is going to be executable locally or remotely, where the latter is the default */ - bindJoystickButton: (joystickName: string, button: integer, command: string, documentation: string, action?: string, isRemote?: boolean) => Promise + bindJoystickButton: ( + joystickName: string, + button: integer, + command: string, + documentation: string, + action?: string, + isRemote?: boolean + ) => Promise; /** * Remove all commands that are currently bound to a button of a joystick or game controller. * @param joystickName The name for the joystick or game controller @param button The button for which to clear the commands */ - clearJoystickButton: (joystickName: string, button: integer) => Promise + clearJoystickButton: (joystickName: string, button: integer) => Promise; /** * Return the distance to the current focus node. * @returns The distance, in meters */ - distanceToFocus: () => Promise + distanceToFocus: () => Promise; /** * Return the distance to the current focus node's bounding sphere. * @returns The distance, in meters */ - distanceToFocusBoundingSphere: () => Promise + distanceToFocusBoundingSphere: () => Promise; /** * Return the distance to the current focus node's interaction sphere. * @returns The distance, in meters */ - distanceToFocusInteractionSphere: () => Promise + distanceToFocusInteractionSphere: () => Promise; /** * Move the camera to the node with the specified identifier. The optional double specifies the duration of the motion, in seconds. If the optional bool is set to true the target up vector for camera is set based on the target node. Either of the optional parameters can be left out. * @param nodeIdentifier The identifier of the node to which we want to fly @param useUpFromTargetOrDuration If this value is a boolean value (`true` or `false`), this value determines whether we want to end up with the camera facing along the selected node's up direction. If this value is a numerical value, refer to the documnentation of the `duration` parameter @param duration The duration (in seconds) how long the flying to the selected node should take. If this value is left out, a sensible default value is uses, which can be configured in the engine */ - flyTo: (nodeIdentifier: string, useUpFromTargetOrDuration?: boolean | number, duration?: number) => Promise + flyTo: ( + nodeIdentifier: string, + useUpFromTargetOrDuration?: boolean | number, + duration?: number + ) => Promise; /** * Fly the camera to a geographic coordinate (latitude, longitude and altitude) on a globe, using the path navigation system. If the node is a globe, the longitude and latitude is expressed in the body's native coordinate system. If it is not, the position on the surface of the interaction sphere is used instead. * @param node The identifier of a scene graph node. If an empty string is provided, the current anchor node is used @param latitude The latitude of the target coordinate, in degrees @param longitude The longitude of the target coordinate, in degrees @param altitude The altitude of the target coordinate, in meters @param duration An optional duration for the motion to take, in seconds. For example, a value of 5 means \"fly to this position over a duration of 5 seconds\" @param shouldUseUpVector If true, try to use the up-direction when computing the target position for the camera. For globes, this means that North should be up, in relation to the camera's view direction. Note that for this to take effect, rolling motions must be enabled in the Path Navigator settings */ - flyToGeo: (node: string, latitude: number, longitude: number, altitude: number, duration?: number, shouldUseUpVector?: boolean) => Promise + flyToGeo: ( + node: string, + latitude: number, + longitude: number, + altitude: number, + duration?: number, + shouldUseUpVector?: boolean + ) => Promise; /** * Fly the camera to a geographic coordinate (latitude and longitude) on a globe, using the path navigation system. If the node is a globe, the longitude and latitude is expressed in the body's native coordinate system. If it is not, the position on the surface of the interaction sphere is used instead. * The distance to fly to can either be set to be the current distance of the camera to the target object, or the default distance from the path navigation system. * @param node The identifier of a scene graph node. If an empty string is provided, the current anchor node is used @param latitude The latitude of the target coordinate, in degrees @param longitude The longitude of the target coordinate, in degrees @param useCurrentDistance If true, use the current distance of the camera to the target globe when going to the specified position. If false, or not specified, set the distance based on the bounding sphere and the distance factor setting in Path Navigator @param duration An optional duration for the motion to take, in seconds. For example, a value of 5 means \"fly to this position over a duration of 5 seconds\" @param shouldUseUpVector If true, try to use the up-direction when computing the target position for the camera. For globes, this means that North should be up, in relation to the camera's view direction. Note that for this to take effect, rolling motions must be enabled in the Path Navigator settings */ - flyToGeo2: (node: string, latitude: number, longitude: number, useCurrentDistance?: boolean, duration?: number, shouldUseUpVector?: boolean) => Promise + flyToGeo2: ( + node: string, + latitude: number, + longitude: number, + useCurrentDistance?: boolean, + duration?: number, + shouldUseUpVector?: boolean + ) => Promise; /** * Move the camera to the node with the specified identifier. The second argument is the desired target height above the target node's bounding sphere, in meters. The optional double specifies the duration of the motion, in seconds. If the optional bool is set to true, the target up vector for camera is set based on the target node. Either of the optional parameters can be left out. * @param nodeIdentifier The identifier of the node to which we want to fly @param height The height (in meters) to which we want to fly. The way the height is defined specifically determines on the type of node to which the fly-to command is pointed @param useUpFromTargetOrDuration If this value is a boolean value (`true` or `false`), this value determines whether we want to end up with the camera facing along the selected node's up direction. If this value is a numerical value, refer to the documnentation of the `duration` parameter @param duration The duration (in seconds) how long the flying to the selected node should take. If this value is left out, a sensible default value is uses, which can be configured in the engine */ - flyToHeight: (nodeIdentifier: string, height: number, useUpFromTargetOrDuration?: boolean | number, duration?: number) => Promise + flyToHeight: ( + nodeIdentifier: string, + height: number, + useUpFromTargetOrDuration?: boolean | number, + duration?: number + ) => Promise; /** * Create a path to the navigation state described by the input table. Note that roll must be included for the target up direction in the navigation state to be taken into account. * @param navigationState A [NavigationState](#core_navigationstate) to fly to @param duration An optional duration for the motion to take, in seconds. For example, a value of 5 means \"fly to this position over a duration of 5 seconds\" */ - flyToNavigationState: (navigationState: table, duration?: number) => Promise + flyToNavigationState: (navigationState: table, duration?: number) => Promise; /** * Return the current [NavigationState](#core_navigationstate) as a Lua table. * By default, the reference frame will be picked based on whether the orbital navigator is currently following the anchor node rotation. If it is, the anchor will be chosen as reference frame. If not, the reference frame will be set to the scene graph root. * @param frame The identifier of an optional scene graph node to use as reference frame for the NavigationState @returns A Lua table representing the current NavigationState of the camera */ - getNavigationState: (frame?: string) => Promise
+ getNavigationState: (frame?: string) => Promise
; /** * Returns true if a camera path is currently running, and false otherwise. * @returns Whether a camera path is currently active, or not */ - isFlying: () => Promise + isFlying: () => Promise; /** * Return all the information bound to a certain joystick axis. * @param joystickName The name for the joystick or game controller with the axis for which to find the information @param axis The joystick axis for which to find the information @returns An object with information about the joystick axis */ - joystickAxis: (joystickName: string, axis: integer) => Promise
+ joystickAxis: (joystickName: string, axis: integer) => Promise
; /** * Get the Lua script that is currently bound to be executed when the provided button is pressed/triggered. * @param joystickName The name for the joystick or game controller @param button The button for which to get the command @returns The currently bound Lua script */ - joystickButton: (joystickName: string, button: integer) => Promise + joystickButton: (joystickName: string, button: integer) => Promise; /** * Fade rendering to black, jump to the specified navigation state, and then fade in. This is done by triggering another script that handles the logic. * @param nodeIdentifier The identifier of the scene graph node to jump to @param fadeDuration An optional duration for the fading. If not included, the property in Navigation Handler will be used */ - jumpTo: (nodeIdentifier: string, fadeDuration?: number) => Promise + jumpTo: (nodeIdentifier: string, fadeDuration?: number) => Promise; /** * Immediately move the camera to a geographic coordinate on a node by first fading the rendering to black, jump to the specified coordinate, and then fade in. If the node is a globe, the longitude and latitude values are expressed in the body's native coordinate system. If it is not, the position on the surface of the interaction sphere is used instead. * This is done by triggering another script that handles the logic. * @param node The identifier of a scene graph node. If an empty string is provided, the current anchor node is used @param latitude The latitude of the target coordinate, in degrees @param longitude The longitude of the target coordinate, in degrees @param altitude An optional altitude, given in meters over the reference surface of the globe. If no altitude is provided, the altitude will be kept as the current distance to the reference surface of the specified node @param fadeDuration An optional duration for the fading. If not included, the property in Navigation Handler will be used */ - jumpToGeo: (node: string, latitude: number, longitude: number, altitude?: number, fadeDuration?: number) => Promise + jumpToGeo: ( + node: string, + latitude: number, + longitude: number, + altitude?: number, + fadeDuration?: number + ) => Promise; /** * Fade rendering to black, jump to the specified node, and then fade in. This is done by triggering another script that handles the logic. * @param navigationState A [NavigationState](#core_navigationstate) to jump to @param useTimeStamp if true, and the provided NavigationState includes a timestamp, the time will be set as well @param fadeDuration An optional duration for the fading. If not included, the property in Navigation Handler will be used */ - jumpToNavigationState: (navigationState: table, useTimeStamp?: boolean, fadeDuration?: number) => Promise + jumpToNavigationState: ( + navigationState: table, + useTimeStamp?: boolean, + fadeDuration?: number + ) => Promise; /** * Return the complete list of connected joysticks. * @returns A list of joystick names */ - listAllJoysticks: () => Promise + listAllJoysticks: () => Promise; /** * Set the camera position by loading a [NavigationState](#core_navigationstate) from file. The file should be in json format, such as the output files of `saveNavigationState`. * Deprecated in favor of `loadNavigationStateFromFile`. Use this function in combination with `jumpToNavigationState` or `setNavigationState` to load the navigation and set the camera position in two steps. * @param filePath The path to the file, including the file name (and extension, if it is anything other than `.navstate`) @param useTimeStamp If `true`, and the provided NavigationState includes a timestamp, the time will be set as well */ - loadNavigationState: (filePath: string, useTimeStamp?: boolean) => Promise + loadNavigationState: (filePath: string, useTimeStamp?: boolean) => Promise; /** * Loads [NavigationState](#core_navigationstate) from file and returns the result. The file should be in JSON format, such as the output files of `saveNavigationState`. * After loading a navigation state, the camera will not automatically be set to that state. To do that, use the returned table in combination with another function, such as `jumpToNavigationState` or `setNavigationState`. * Example: ``` openspace.navigation.jumpToNavigationState( openspace.navigation.loadNavigationStateFromFile(\"path to file\") ) ``` * @param filePath The path to the file, including the file name (and extension, if it is anything other than `.navstate`) @returns A Lua table representing the loaded navigation state */ - loadNavigationStateFromFile: (filePath: string) => Promise
+ loadNavigationStateFromFile: (filePath: string) => Promise
; /** * Returns the position in the local Cartesian coordinate system of the specified node that corresponds to the given geographic coordinates. In the local coordinate system, the position (0,0,0) corresponds to the globe's center. If the node is a globe, the longitude and latitude is expressed in the body's native coordinate system. If it is not, the position on the surface of the interaction sphere is used instead. * @param nodeIdentifier The identifier of the scene graph node @param latitude The latitude of the geograpic position, in degrees @param longitude The longitude of the geographic position, in degrees @param altitude The altitude, in meters */ - localPositionFromGeo: (nodeIdentifier: string, latitude: number, longitude: number, altitude: number) => Promise<[number, number, number]> + localPositionFromGeo: ( + nodeIdentifier: string, + latitude: number, + longitude: number, + altitude: number + ) => Promise<[number, number, number]>; /** * Reset the camera direction to point at the aim node. */ - retargetAim: () => Promise + retargetAim: () => Promise; /** * Reset the camera direction to point at the anchor node. */ - retargetAnchor: () => Promise + retargetAnchor: () => Promise; /** * Save the current [NavigationState](#core_navigationstate) to a file with the path given by the first argument. * By default, the reference frame will be picked based on whether the orbital navigator is currently following the anchor node rotation. If it is, the anchor will be chosen as reference frame. If not, the reference frame will be set to the scene graph root. * @param path The file path for where to save the NavigationState, including the file name. If no extension is added, the file is saved as a `.navstate` file @param frame The identifier of the scene graph node which coordinate system should be used as a reference frame for the NavigationState */ - saveNavigationState: (path: string, frame?: string) => Promise + saveNavigationState: (path: string, frame?: string) => Promise; /** * Set the deadzone value for a particular joystick axis, which means that any input less than this value is completely ignored. * @param joystickName The name for the joystick or game controller @param axis The joystick axis for which to set the deadzone @param deadzone The new deadzone value */ - setAxisDeadZone: (joystickName: string, axis: integer, deadzone: number) => Promise + setAxisDeadZone: ( + joystickName: string, + axis: integer, + deadzone: number + ) => Promise; /** * Set the current focus node for the navigation, or re-focus on it if it was already the focus node. * Per default, the camera will retarget to center the focus node in the view. The velocities will also be reset so that the camera stops moving after any retargeting is done. However, both of these behaviors may be skipped using the optional arguments. * @param identifier The identifier of the scene graph node to focus @param shouldRetarget If true, retarget the camera to look at the focus node @param shouldResetVelocities If true, reset the camera velocities so that the camera stops after its done retargeting (or immediately if retargeting is not done) */ - setFocus: (identifier: string, shouldRetarget?: boolean, shouldResetVelocities?: boolean) => Promise + setFocus: ( + identifier: string, + shouldRetarget?: boolean, + shouldResetVelocities?: boolean + ) => Promise; /** * Set the camera position from a provided [NavigationState](#core_navigationstate). * @param navigationState A table describing the NavigationState to set @param useTimeStamp If true, and the provided NavigationState includes a timestamp, the time will be set as well */ - setNavigationState: (navigationState: table, useTimeStamp?: boolean) => Promise + setNavigationState: (navigationState: table, useTimeStamp?: boolean) => Promise; /** * Picks the next node from the interesting nodes out of the profile and selects that. If the current anchor is not an interesting node, the first node in the list will be selected. */ - targetNextInterestingAnchor: () => Promise + targetNextInterestingAnchor: () => Promise; /** * Picks the previous node from the interesting nodes out of the profile and selects that. If the current anchor is not an interesting node, the first node in the list will be selected. */ - targetPreviousInterestingAnchor: () => Promise + targetPreviousInterestingAnchor: () => Promise; /** * Immediately start applying the chosen IdleMotion. If none is specified, use the one set to default in the OrbitalNavigator. */ - triggerIdleMotion: (choice?: string) => Promise + triggerIdleMotion: (choice?: string) => Promise; + /** + * Remove all bindings for a joystick or game controller, including both axes and buttons. + * @param joystickName The name for the joystick or game controller + */ + unbindJoystick: (joystickName: string) => Promise; /** * Fly linearly to a specific distance in relation to the focus node. * @param distance The distance to fly to, in meters above the bounding sphere @param duration An optional duration for the motion to take, in seconds */ - zoomToDistance: (distance: number, duration?: number) => Promise + zoomToDistance: (distance: number, duration?: number) => Promise; /** * Fly linearly to a specific distance in relation to the focus node, given as a relative value based on the size of the object rather than in meters. * @param distance The distance to fly to, given as a multiple of the bounding sphere of the current focus node bounding sphere. A value of 1 will result in a position at a distance of one times the size of the bounding sphere away from the object @param duration An optional duration for the motion, in seconds */ - zoomToDistanceRelative: (distance: number, duration?: number) => Promise + zoomToDistanceRelative: (distance: number, duration?: number) => Promise; /** * Zoom linearly to the current focus node, using the default distance. * @param duration An optional duration for the motion to take, in seconds. For example, a value of 5 means \"zoom in over 5 seconds\" */ - zoomToFocus: (duration?: number) => Promise + zoomToFocus: (duration?: number) => Promise; } // interface NavigationLibrary export interface OpenglCapabilitiesLibrary { /** * Returns all available extensions as a list of names. */ - extensions: () => Promise + extensions: () => Promise; /** * Returns the value of a call to `glGetString(GL_VENDOR)`. This will give detailed information about the vendor of the main graphics card. This string can be used if the automatic Vendor detection failed. */ - glslCompiler: () => Promise + glslCompiler: () => Promise; /** * Returns the vendor of the main graphics card. */ - gpuVendor: () => Promise + gpuVendor: () => Promise; /** * Tests whether the current instance supports the passed OpenGL version. The parameter has to have the form 'X.Y' or 'X.Y.Z'. */ - hasOpenGLVersion: (version: string) => Promise + hasOpenGLVersion: (version: string) => Promise; /** * Checks is a specific `extension` is supported or not. */ - isExtensionSupported: (extension: string) => Promise + isExtensionSupported: (extension: string) => Promise; /** * Returns the largest dimension for a 2D texture on this graphics card. */ - max2DTextureSize: () => Promise + max2DTextureSize: () => Promise; /** * Returns the largest dimension for a 3D texture on this graphics card. */ - max3DTextureSize: () => Promise + max3DTextureSize: () => Promise; /** * Returns the maximum number of atomic counter buffer bindings that are available on the main graphics card. */ - maxAtomicCounterBufferBindings: () => Promise + maxAtomicCounterBufferBindings: () => Promise; /** * Returns the maximum number of shader storage bindings that are available on the main graphics card. */ - maxShaderStorageBufferBindings: () => Promise + maxShaderStorageBufferBindings: () => Promise; /** * Returns the maximum number of texture units that are available on the main graphics card. */ - maxTextureUnits: () => Promise + maxTextureUnits: () => Promise; /** * Returns the maximum number of uniform buffer bindings that are available on the main graphics card. */ - maxUniformBufferBindings: () => Promise + maxUniformBufferBindings: () => Promise; /** * Returns the maximum OpenGL version that is supported on this platform. */ - openGLVersion: () => Promise + openGLVersion: () => Promise; } // interface OpenglCapabilitiesLibrary export interface OrbitalnavigationLibrary { /** * Set maximum allowed distance to a multiplier of the interaction sphere of the focus node. */ - setRelativeMaxDistance: (multiplier: number) => Promise + setRelativeMaxDistance: (multiplier: number) => Promise; /** * Set minimum allowed distance to a multiplier of the interaction sphere of the focus node. */ - setRelativeMinDistance: (multiplier: number) => Promise + setRelativeMinDistance: (multiplier: number) => Promise; } // interface OrbitalnavigationLibrary -export interface ParallelLibrary { - /** - * Connect to parallel. - */ - connect: () => Promise - /** - * Disconnect from parallel. - */ - disconnect: () => Promise - /** - */ - joinServer: (port: string, address: string, serverName: string, password: string, hostpassword?: string, name?: string) => Promise - /** - * Request to be the host for this session. - */ - requestHostship: () => Promise - /** - * Resign hostship. - */ - resignHostship: () => Promise -} // interface ParallelLibrary - export interface PathnavigationLibrary { /** * Continue playing a paused camera path. */ - continuePath: () => Promise + continuePath: () => Promise; /** * Create a camera path as described by the instruction in the input argument. * @param pathInstruction A table representing a [PathInstruction](#core_path_instruction) that describes a camera path to be created */ - createPath: (pathInstruction: table) => Promise + createPath: (pathInstruction: table) => Promise; /** * Pause a playing camera path. */ - pausePath: () => Promise + pausePath: () => Promise; /** * Immediately skips to the end of the current camera path, if one is being played. */ - skipToEnd: () => Promise + skipToEnd: () => Promise; /** * Stops a path, if one is being played. */ - stopPath: () => Promise + stopPath: () => Promise; } // interface PathnavigationLibrary export interface ScriptSchedulerLibrary { /** * Clears all scheduled scripts. */ - clear: (group?: integer) => Promise + clear: (group?: integer) => Promise; /** * Load timed scripts from a Lua script file that returns a list of scheduled scripts. */ - loadFile: (fileName: string) => Promise + loadFile: (fileName: string) => Promise; /** * Load a single scheduled script. The first argument is the time at which the scheduled script is triggered, the second argument is the script that is executed in the forward direction, the optional third argument is the script executed in the backwards direction, and the optional last argument is the universal script, executed in either direction. */ - loadScheduledScript: (time: string, forwardScript: string, backwardScript?: string, universalScript?: string, group?: integer) => Promise + loadScheduledScript: ( + time: string, + forwardScript: string, + backwardScript?: string, + universalScript?: string, + group?: integer + ) => Promise; /** * Returns the list of all scheduled scripts. */ - scheduledScripts: () => Promise + scheduledScripts: () => Promise; } // interface ScriptSchedulerLibrary export interface SessionRecordingLibrary { /** * Returns true if session recording is currently playing back a recording. */ - isPlayingBack: () => Promise + isPlayingBack: () => Promise; /** * Returns true if session recording is currently recording a recording. */ - isRecording: () => Promise + isRecording: () => Promise; /** * Pauses or resumes the playback progression through keyframes. */ - setPlaybackPause: (pause: boolean) => Promise + setPlaybackPause: (pause: boolean) => Promise; /** * Starts a playback session with keyframe times that are relative to the time since the recording was started (the same relative time applies to the playback). When playback starts, the simulation time is automatically set to what it was at recording time. The file argument is the filename to the session recording file. If a second input value of true is given, then playback will continually loop until it is manually stopped. */ - startPlayback: (file: path, loop?: boolean, shouldWaitForTiles?: boolean, screenshotFps?: integer) => Promise + startPlayback: ( + file: path, + loop?: boolean, + shouldWaitForTiles?: boolean, + screenshotFps?: integer + ) => Promise; /** * Starts a recording session. The string argument is the filename used for the file where the recorded keyframes are saved. */ - startRecording: () => Promise + startRecording: () => Promise; /** * Stops a playback session before playback of all keyframes is complete. */ - stopPlayback: () => Promise + stopPlayback: () => Promise; /** * Stops a recording session. `dataMode` has to be \"Ascii\" or \"Binary\". If `overwrite` is true, any existing session recording file will be overwritten, false by default. */ - stopRecording: (recordFilePath: path, dataMode: string, overwrite?: boolean) => Promise + stopRecording: ( + recordFilePath: path, + dataMode: string, + overwrite?: boolean + ) => Promise; /** * Toggles the pause function, i.e. temporarily setting the delta time to 0 and restoring it afterwards. */ - togglePlaybackPause: () => Promise + togglePlaybackPause: () => Promise; } // interface SessionRecordingLibrary export interface SkybrowserLibrary { /** * Takes an identifier to a sky browser and adds a rendered copy to it. The first argument is the position of the first copy. The position is in RAE or Cartesian coordinates, depending on if 'Use Radius Azimuth Elevation' is checked. The second argument is the number of copies. If RAE is used, they will be evenly spread out on the azimuth. */ - addDisplayCopy: (identifier: string, numberOfCopies?: integer, position?: vec3) => Promise + addDisplayCopy: ( + identifier: string, + numberOfCopies?: integer, + position?: vec3 + ) => Promise; /** * Takes the identifier of the sky target and a sky browser and adds them to the sky browser module. */ - addPairToSkyBrowserModule: (targetId: string, browserId: string) => Promise + addPairToSkyBrowserModule: (targetId: string, browserId: string) => Promise; /** * Takes an identifier to a sky browser or sky target. Rotates the camera so that the target is placed in the center of the view. */ - adjustCamera: (id: string) => Promise + adjustCamera: (id: string) => Promise; /** * Takes an identifier to a sky browser and animates its corresponding target to the center of the current view. */ - centerTargetOnScreen: (identifier: string) => Promise + centerTargetOnScreen: (identifier: string) => Promise; /** * Creates a sky browser and a target. */ - createTargetBrowserPair: () => Promise + createTargetBrowserPair: () => Promise; /** * Disables the hover indicator, if one is added to the sky browser module. */ - disableHoverIndicator: () => Promise + disableHoverIndicator: () => Promise; /** * Finetunes the target depending on a mouse drag. rendered copy to it. First argument is the identifier of the sky browser, second is the start position of the drag and third is the end position of the drag. */ - finetuneTargetPosition: (identifier: string, translation: vec2) => Promise + finetuneTargetPosition: (identifier: string, translation: vec2) => Promise; /** * Takes an identifier to a sky browser and starts the initialization for that browser. That means that the browser starts to try to connect to the AAS WorldWide Telescope application by sending it messages. And that the target matches its appearance to its corresponding browser. */ - initializeBrowser: (identifier: string) => Promise + initializeBrowser: (identifier: string) => Promise; /** * Returns a list of all the loaded AAS WorldWide Telescope images that have been loaded. Each image has a name, thumbnail URL, equatorial spherical coordinates RA and Dec, equatorial Cartesian coordinates, if the image has celestial coordinates, credits text, credits URL and the identifier of the image which is a unique number. */ - listOfImages: () => Promise
+ listOfImages: () => Promise
; /** * Takes an identifier to a sky browser or target and loads the WWT image collection to that browser. */ - loadImagesToWWT: (identifier: string) => Promise + loadImagesToWWT: (identifier: string) => Promise; /** * Sets the image collection as loaded in the sky browser. Takes an identifier to the sky browser. */ - loadingImageCollectionComplete: (identifier: string) => Promise + loadingImageCollectionComplete: (identifier: string) => Promise; /** * Moves the hover indicator to the coordinate specified by the image index. * @param imageUrl The url of the image to move the hover indicator to */ - moveIndicatorToHoverImage: (imageUrl: string) => Promise + moveIndicatorToHoverImage: (imageUrl: string) => Promise; /** * Reloads the sky browser display copy for the node index that is sent in. If no ID is sent in, it will reload all display copies on that node. * @param nodeIndex The index of the node to reload the display copy on @param id An optional browser ID to only reload the display copy for a specific browser. If \"all\" or no ID is provided, all display copies will be reloaded */ - reloadDisplayCopyOnNode: (nodeIndex: integer, id?: string) => Promise + reloadDisplayCopyOnNode: (nodeIndex: integer, id?: string) => Promise; /** * Takes an identifier to a sky browser and removes the latest added rendered copy to it. */ - removeDisplayCopy: (identifier: string) => Promise + removeDisplayCopy: (identifier: string) => Promise; /** * Takes an identifier to a sky browser or target and an index to an image. Removes that image from that sky browser. */ - removeSelectedImageInBrowser: (identifier: string, imageUrl: string) => Promise + removeSelectedImageInBrowser: (identifier: string, imageUrl: string) => Promise; /** * Takes in identifier to a sky browser or target and removes them. */ - removeTargetBrowserPair: (identifier: string) => Promise + removeTargetBrowserPair: (identifier: string) => Promise; /** * Takes an identifier to a sky browser or a sky target and a vertical field of view. Changes the field of view as specified by the input. */ - scrollOverBrowser: (identifier: string, scroll: number) => Promise + scrollOverBrowser: (identifier: string, scroll: number) => Promise; /** * Takes an index to an image and selects that image in the currently selected sky browser. * @param imageUrl The url of the image to select */ - selectImage: (imageUrl: string) => Promise + selectImage: (imageUrl: string) => Promise; /** * Sends all sky browsers' identifiers to their respective CEF browser. */ - sendOutIdsToBrowsers: () => Promise + sendOutIdsToBrowsers: () => Promise; /** * Takes an identifier to a sky browser or a sky target and a rgb color in the ranges [0, 255]. */ - setBorderColor: (identifier: string, red: integer, green: integer, blue: integer) => Promise + setBorderColor: ( + identifier: string, + red: integer, + green: integer, + blue: integer + ) => Promise; /** * Takes an identifier to a sky browser and a radius value between 0 and 1, where 0 is rectangular and 1 is circular. */ - setBorderRadius: (identifier: string, radius: number) => Promise + setBorderRadius: (identifier: string, radius: number) => Promise; /** * Sets the screen space size of the sky browser to the numbers specified by the input [x, y]. */ - setBrowserRatio: (identifier: string, ratio: number) => Promise + setBrowserRatio: (identifier: string, ratio: number) => Promise; /** * Takes the identifier of a sky browser or a sky target and equatorial coordinates Right Ascension and Declination. The target will animate to this coordinate and the browser will display the coordinate. */ - setEquatorialAim: (identifier: string, rightAscension: number, declination: number) => Promise + setEquatorialAim: ( + identifier: string, + rightAscension: number, + declination: number + ) => Promise; /** * Takes an identifier to a screen space renderable and adds it to the module. * @param identifier The identifier of the renderable that should be used as hover indicator */ - setHoverIndicator: (identifier: string) => Promise + setHoverIndicator: (identifier: string) => Promise; /** * Takes an identifier to a sky browser or a sky target, an image index and the order which it should have in the selected image list. The image is then changed to have this order. */ - setImageLayerOrder: (identifier: string, imageUrl: string, imageOrder: integer) => Promise + setImageLayerOrder: ( + identifier: string, + imageUrl: string, + imageOrder: integer + ) => Promise; /** * Takes an identifier to a sky browser or sky target, an index to an image and a value for the opacity. */ - setOpacityOfImageLayer: (identifier: string, imageUrl: string, opacity: number) => Promise + setOpacityOfImageLayer: ( + identifier: string, + imageUrl: string, + opacity: number + ) => Promise; /** * Takes an identifier to a sky browser or target. Sets that sky browser currently selected. */ - setSelectedBrowser: (identifier: string) => Promise + setSelectedBrowser: (identifier: string) => Promise; /** * Takes an identifier to a sky browser or a sky target and a vertical field of view. Changes the field of view as specified by the input. */ - setVerticalFov: (identifier: string, verticalFieldOfView: number) => Promise + setVerticalFov: (identifier: string, verticalFieldOfView: number) => Promise; /** * Show or hide all targets and browsers. Takes a boolean that sets it to either be shown or not. */ - showAllTargetsAndBrowsers: (show: boolean) => Promise + showAllTargetsAndBrowsers: (show: boolean) => Promise; /** * Starts the fine-tuning of the target rendered copy to it. */ - startFinetuningTarget: (identifier: string) => Promise + startFinetuningTarget: (identifier: string) => Promise; /** * Starts the setup process of the sky browers. This function calls the Lua function 'sendOutIdsToBrowsers' in all nodes in the cluster. */ - startSetup: () => Promise + startSetup: () => Promise; /** * Stop animations. Takes an identifier to a sky browser. */ - stopAnimations: (identifier: string) => Promise + stopAnimations: (identifier: string) => Promise; /** - * Returns a table of data regarding the current view and the sky browsers and targets. + * Returns a table of data regarding the current view and the sky browsers and targets. If no browser is currently selected, an empty table is returned. * @returns A table of data regarding the current targets */ - targetData: () => Promise
+ targetData: () => Promise
; /** * Takes an identifier to a sky browser or sky target and the [x, y] starting position and the [x, y] translation vector. */ - translateScreenSpaceRenderable: (identifier: string, startingPositionX: number, startingPositionY: number, translationX: number, translationY: number) => Promise + translateScreenSpaceRenderable: ( + identifier: string, + startingPositionX: number, + startingPositionY: number, + translationX: number, + translationY: number + ) => Promise; /** * Returns the AAS WorldWide Telescope image collection URL. */ - wwtImageCollectionUrl: () => Promise
+ wwtImageCollectionUrl: () => Promise
; } // interface SkybrowserLibrary export interface SonificationLibrary { /** * Adds the given list of planets to the PlanetsSonification internal list of Planets and Moons. */ - addPlanets: (planets: table) => Promise + addPlanets: (planets: table) => Promise; } // interface SonificationLibrary export interface SpaceLibrary { + /** + * Creates a new scene graph node from the small body object by querying the JPL Small + * Body Database for the provided object. If the object exists, its Keplerian elements + * are retrieved and an orbital path for that object is created. If the search returns + * no result, an error is logged. The function returns the created Trail and Position + * objects. + */ + addSmallBodyObject: (object_search_string: string) => Promise<[trail, position]>; /** * Returns the cartesian world position of a ra dec coordinate with distance. If the coordinate is given as strings the format should be ra 'XhYmZs' and dec 'XdYmZs'. If the coordinate is given as numbers the values should be in degrees. */ - convertFromRaDec: (rightAscension: number | string, declination: number | string, distance: number) => Promise + convertFromRaDec: ( + rightAscension: number | string, + declination: number | string, + distance: number + ) => Promise; /** * Returns the formatted ra, dec strings and distance for a given cartesian world coordinate. */ - convertToRaDec: (x: number, y: number, z: number) => Promise<[string, string, number]> + convertToRaDec: (x: number, y: number, z: number) => Promise<[string, string, number]>; + /** + * Takes the provided CSV file, converts it into a SPICE kernel and returns a + * SpiceTranslation instance that can be used to access the information in the CSV + * file using SPICE's superior integral solver. + * The second return value is the spice kernel that should be loaded and unloaded by + * whoever called this function. + */ + csvToSpiceTranslation: (csvPath: string) => Promise<[translation, spicekernel]>; /** */ - readKeplerFile: (p: path, type: string) => Promise + readKeplerFile: (p: path, type: string) => Promise; /** * Takes the provided TLE file, converts it into a SPICE kernel and returns a * SpiceTranslation instance that can be used to access the information in the TLE @@ -1757,133 +2094,147 @@ export interface SpaceLibrary { * The second return value is the spice kernel that should be loaded and unloaded by * whoever called this function. */ - tleToSpiceTranslation: (tlePath: string) => Promise<[ translation, spicekernel ]> + tleToSpiceTranslation: (tlePath: string) => Promise<[translation, spicekernel]>; } // interface SpaceLibrary export interface SpiceLibrary { + /** + * This function converts a CSV file into SPK format and saves it at the provided path. The last parameter is only used if there are multiple craft specified in the provided CSV file and is selecting which (0-based index) of the list to create a kernel from. + * This function returns the SPICE ID of the object for which the kernel was created. + */ + convertCSVtoSPK: (csv: path, spk: path, elementToExtract?: integer) => Promise; /** * This function converts a TLE file into SPK format and saves it at the provided path. The last parameter is only used if there are multiple craft specified in the provided TLE file and is selecting which (0-based index) of the list to create a kernel from. * This function returns the SPICE ID of the object for which the kernel was created. */ - convertTLEtoSPK: (tle: path, spk: path, elementToExtract?: integer) => Promise + convertTLEtoSPK: (tle: path, spk: path, elementToExtract?: integer) => Promise; /** * Returns a list of all loaded kernels. */ - kernels: () => Promise + kernels: () => Promise; /** * Loads the provided SPICE kernel by name. The name can contain path tokens, which are automatically resolved. */ - loadKernel: (kernel: string | string[]) => Promise + loadKernel: (kernel: string | string[]) => Promise; /** * Returns the position for a given body relative to another body, in a given frame of reference, at a specific time. * Example: openspace.spice.position('INSIGHT', 'MARS',' GALACTIC', '2018 NOV 26 19:45:34') */ - position: (target: string, observer: string, frame: string, date: string) => Promise + position: ( + target: string, + observer: string, + frame: string, + date: string + ) => Promise; /** * Returns the rotationMatrix for a given body in a frame of reference at a specific time. * Example: openspace.spice.rotationMatrix('INSIGHT_LANDER_CRUISE','MARS', '2018 NOV 26 19:45:34') */ - rotationMatrix: (body: string, frame: string, date: string) => Promise + rotationMatrix: (body: string, frame: string, date: string) => Promise; /** * Returns a list of Spice Bodies loaded into the system. Returns SPICE built in frames if builtInFrames. Returns User loaded frames if !builtInFrames. */ - spiceBodies: (includeBuiltIn: boolean) => Promise> + spiceBodies: (includeBuiltIn: boolean) => Promise>; /** * Unloads the provided SPICE kernel. The name can contain path tokens, which are automatically resolved. */ - unloadKernel: (kernel: string | string[]) => Promise + unloadKernel: (kernel: string | string[]) => Promise; } // interface SpiceLibrary export interface StatemachineLibrary { /** * Returns true if there is a defined transition between the current state and the given string name of a state, otherwise false. */ - canGoToState: (state: string) => Promise + canGoToState: (state: string) => Promise; /** * Creates a state machine from a list of states and transitions. See State and Transition documentation for details. The optional thrid argument is the identifier of the desired initial state. If left out, the first state in the list will be used. */ - createStateMachine: (states: table, transitions: table, startState?: string) => Promise + createStateMachine: ( + states: table, + transitions: table, + startState?: string + ) => Promise; /** * Returns the string name of the current state that the statemachine is in. */ - currentState: () => Promise + currentState: () => Promise; /** * Destroys the current state machine and deletes all the memory. */ - destroyStateMachine: () => Promise + destroyStateMachine: () => Promise; /** * Triggers a transition from the current state to the state with the given identifier. Requires that the specified string corresponds to an existing state, and that a transition between the two states exists. */ - goToState: (newState: string) => Promise + goToState: (newState: string) => Promise; /** * Returns a list with the identifiers of all the states that can be transitioned to from the current state. */ - possibleTransitions: () => Promise + possibleTransitions: () => Promise; /** * Prints information about the current state and possible transitions to the log. */ - printCurrentStateInfo: () => Promise + printCurrentStateInfo: () => Promise; /** * Saves the current state machine to a .dot file as a directed graph. The resulting graph can be rendered using external tools such as Graphviz. The first parameter is the name of the file, and the second is an optional directory. If no directory is given, the file is saved to the temp folder. */ - saveToDotFile: (filename: string, directory?: string) => Promise + saveToDotFile: (filename: string, directory?: string) => Promise; /** * Immediately sets the current state to the state with the given name, if it exists. This is done without doing a transition and completely ignores the previous state. */ - setInitialState: (startState: string) => Promise + setInitialState: (startState: string) => Promise; } // interface StatemachineLibrary export interface SyncLibrary { /** * Synchronizes the http resource identified by the name passed as the first parameter and the version provided as the second parameter. The application will hang while the data is being downloaded. */ - syncResource: (identifier: string, version: integer) => Promise + syncResource: (identifier: string, version: integer) => Promise; /** * Unsynchronizes the http resources identified by the name passed as the first parameter by removing all data that was downloaded as part of the original synchronization. If the second parameter is provided, is it the version of the resources that is unsynchronized, if the parameter is not provided, all versions for the specified http resource are removed. */ - unsyncResource: (identifier: string, version?: integer) => Promise + unsyncResource: (identifier: string, version?: integer) => Promise; } // interface SyncLibrary export interface SystemCapabilitiesLibrary { /** * Returns the cache line size. */ - cacheLineSize: () => Promise + cacheLineSize: () => Promise; /** * Returns the cache size. */ - cacheSize: () => Promise + cacheSize: () => Promise; /** * Returns the number of cores. */ - cores: () => Promise + cores: () => Promise; /** * Returns all supported exteions as comma - separated string. */ - extensions: () => Promise + extensions: () => Promise; /** * Returns the operating system as a string. The exact format of the returned string is implementation and operating system-dependent but it should contain the manufacturer and the version. */ - fullOperatingSystem: () => Promise + fullOperatingSystem: () => Promise; /** * Returns the amount of available, installed main memory (RAM) on the system in MB. */ - installedMainMemory: () => Promise + installedMainMemory: () => Promise; /** * Returns the L2 associativity. */ - L2Associativity: () => Promise + L2Associativity: () => Promise; /** * This function returns a string identifying the currently running operating system. For Windows, the string is 'windows', for MacOS, it is 'osx', and for Linux it is 'linux'. For any other operating system, this function returns 'other'. */ - os: () => Promise + os: () => Promise; } // interface SystemCapabilitiesLibrary export interface TelemetryLibrary { /** * Adds the given list of nodes to the NodesTelemetry's internal list. */ - addNodes: (nodes: table) => Promise + addNodes: (nodes: table) => Promise; } // interface TelemetryLibrary export interface TimeLibrary { @@ -1892,137 +2243,148 @@ export interface TimeLibrary { * The returned value will be of the same type as the first argument. That is, either a number of seconds past the J2000 epoch, or an ISO 8601 date string. * @param base The timestamp to alter, either given as an ISO 8601 date string or a number of seconds past the J2000 epoch @param change The amount of time to add to the specified timestamp. Can be given either in a number of seconds (including negative), or as a string of the form [-]XX(s,m,h,d,M,y] with (s)econds, (m)inutes, (h)ours, (d)ays, (M)onths, and (y)ears as units and an optional - sign to move backwards in time @returns The updated timestamp */ - advancedTime: (base: string | number, change: string | number) => Promise + advancedTime: ( + base: string | number, + change: string | number + ) => Promise; /** * Convert the given time from either a J2000 seconds number to an ISO 8601 timestamp, or vice versa. * If the given time is a timestamp, the function returns a double precision value representing the ephemeris version of that time; that is, the number of TDB seconds past the J2000 epoch. * If the given time is a J2000 seconds value, the function returns a ISO 8601 timestamp. * @param time The timestamp to convert, either given as an ISO 8601 date string or a number of seconds past the J2000 epoch @returns The converted timestamp */ - convertTime: (time: string | number) => Promise + convertTime: (time: string | number) => Promise; /** * Returns the current application time as the number of seconds since the OpenSpace application started. * @returns The number of seconds since OpenSpace started */ - currentApplicationTime: () => Promise + currentApplicationTime: () => Promise; /** * Returns the current time as the number of seconds since the J2000 epoch. * @returns The current time, as the number of seconds since the J2000 epoch */ - currentTime: () => Promise + currentTime: () => Promise; /** * Returns the current wall time as an ISO 8601 date string (YYYY-MM-DDTHH-MN-SS) in the UTC timezone. * @returns The current wall time, in the UTC time zone, as an ISO 8601 date string */ - currentWallTime: () => Promise + currentWallTime: () => Promise; /** * Returns the amount of simulated time that passes in one second of real time. * @returns The simulated delta time, in seconds per real time second */ - deltaTime: () => Promise + deltaTime: () => Promise; /** * Returns the number of seconds between the provided start time and end time. * If the end time is before the start time, the return value is negative. If the start time is equal to the end time, the return value is 0. * @param start The start time for the computation, given as an ISO 8601 date string @param end The end time for the computation, given as an ISO 8601 date string @returns The time between the start time and end time */ - duration: (start: string, end: string) => Promise + duration: (start: string, end: string) => Promise; /** * Set the amount of simulation time that happens in one second of real time, by smoothly interpolating to that value. * @param deltaTime The value to set the speed to, in seconds per real time second @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 delta time interpolation specified in the TimeManager */ - interpolateDeltaTime: (deltaTime: number, interpolationDuration?: number) => Promise + interpolateDeltaTime: ( + deltaTime: number, + interpolationDuration?: number + ) => Promise; /** * Interpolate the simulation speed to the first delta time step in the list that is larger than the current simulation speed, if any. * @param interpolationDuration The number of seconds that the interpolation should be done over. If excluded, the time is decided based on the default value specified in the TimeManager */ - interpolateNextDeltaTimeStep: (interpolationDuration?: number) => Promise + interpolateNextDeltaTimeStep: (interpolationDuration?: number) => Promise; /** * Same behavior as `setPause`, but with interpolation. That is, if it should be paused, the delta time will be interpolated to 0, and if unpausing, the delta time will be interpolated to whatever delta time value is set. * @param isPaused `true` if the simulation should be paused, and `false` otherwise @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 pause/unpause specified in the TimeManager */ - interpolatePause: (isPaused: boolean, interpolationDuration?: number) => Promise + interpolatePause: (isPaused: boolean, interpolationDuration?: number) => Promise; /** * Interpolate the simulation speed to the first delta time step in the list that is smaller than the current simulation speed, if any. * @param interpolationDuration The number of seconds that the interpolation should be done over. If excluded, the time is decided based on the default value specified in the TimeManager */ - interpolatePreviousDeltaTimeStep: (interpolationDuration?: number) => Promise + interpolatePreviousDeltaTimeStep: (interpolationDuration?: number) => Promise; /** * Set the current simulation time to the specified value, using interpolation. The time can be specified either a number of seconds past the J2000 epoch, or as a ISO 8601 string. * Note that providing time zone using the Z format is not supported. UTC is assumed. * @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 */ - interpolateTime: (time: string | number, interpolationDuration?: number) => Promise + interpolateTime: ( + time: string | number, + interpolationDuration?: number + ) => Promise; /** * Increment the current simulation time by the specified number of seconds, using interpolation. * @param delta The number of seconds to increase the current simulation time by @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 */ - interpolateTimeRelative: (delta: number, interpolationDuration?: number) => Promise + interpolateTimeRelative: ( + delta: number, + interpolationDuration?: number + ) => Promise; /** * Toggle the pause function, i.e. if the simulation is paused it will resume, and otherwise it will be paused. This is done by smoothly interpolating from the current delta time value to 0 (pause), or from 0 to the current delta time value (unpause). * @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 pause/unpause specified in the TimeManager */ - interpolateTogglePause: (interpolationDuration?: number) => Promise + interpolateTogglePause: (interpolationDuration?: number) => Promise; /** * Returns whether the simulation time is currently paused or is progressing. * @returns True if the simulation is paused, and false otherwise */ - isPaused: () => Promise + isPaused: () => Promise; /** * This allows for a keypress (via keybinding) to have dual functionality. In normal operational mode it will behave just like time_interpolateTogglePause, but during playback of a session recording it will pause the playback without manipulating the delta time. */ - pauseToggleViaKeyboard: () => Promise + pauseToggleViaKeyboard: () => Promise; /** * Returns the number of seconds per day, where a day in this case is exactly 24 hours. The total number of seconds is equal to 86400. * @returns The number of seconds in a day */ - secondsPerDay: () => Promise + secondsPerDay: () => Promise; /** * Returns the number of seconds in a Gregorian year, which is equal to 31556952. * @returns The number of seconds in a Gregorian year */ - secondsPerYear: () => Promise + secondsPerYear: () => Promise; /** * Set the amount of simulation time that happens in one second of real time. * @param deltaTime The value to set the speed to, in seconds per real time second */ - setDeltaTime: (deltaTime: number) => Promise + setDeltaTime: (deltaTime: number) => Promise; /** * Set the list of discrete delta time steps for the simulation speed that can be quickly jumped between. The list will be sorted to be in increasing order. A negative verison of each specified time step will be added per default as well. * @param deltaTime The list of delta times, given in seconds per real time second. Should only include positive values */ - setDeltaTimeSteps: (deltaTime: number[]) => Promise + setDeltaTimeSteps: (deltaTime: number[]) => Promise; /** * Immediately set the simulation speed to the first delta time step in the list that is larger than the current choice of simulation speed, if any. */ - setNextDeltaTimeStep: () => Promise + setNextDeltaTimeStep: () => Promise; /** * Set whether the simulation should be paused or not. Note that to pause means temporarily setting the delta time to 0, and unpausing means restoring it to whatever delta time value is set. * @param isPaused `true` if the simulation should be paused, and `false` otherwise */ - setPause: (isPaused: boolean) => Promise + setPause: (isPaused: boolean) => Promise; /** * Immediately set the simulation speed to the first delta time step in the list that is smaller than the current choice of simulation speed, if any. */ - setPreviousDeltaTimeStep: () => Promise + setPreviousDeltaTimeStep: () => Promise; /** * Set the current simulation time to the specified value. The time can be specified either a number of seconds past the J2000 epoch, or as a ISO 8601 string. * Note that providing time zone using the Z format is not supported. UTC is assumed. * @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 */ - setTime: (time: number | string) => Promise + setTime: (time: number | string) => Promise; /** * 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 * @returns The current time, in the format used by SPICE (YYYY MON DDTHR:MN:SC.### ::RND) */ - SPICE: (format?: string) => Promise + SPICE: (format?: string) => Promise; /** * 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. */ - togglePause: () => Promise + togglePause: () => Promise; /** * Returns the current time as an ISO 8601 date string (YYYY-MM-DDTHH:MN:SS). * @returns The current time, as an ISO 8601 date string */ - UTC: () => Promise + UTC: () => Promise; } // interface TimeLibrary - diff --git a/src/types/generated/profiletopic.ts b/src/types/generated/profiletopic.ts index 81e0729..f0a8966 100644 --- a/src/types/generated/profiletopic.ts +++ b/src/types/generated/profiletopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface ProfileTopic { diff --git a/src/types/generated/properties.ts b/src/types/generated/properties.ts index 34fc2b0..b9e2ffc 100644 --- a/src/types/generated/properties.ts +++ b/src/types/generated/properties.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ /** diff --git a/src/types/generated/propertytreetopic.ts b/src/types/generated/propertytreetopic.ts index 8fffef7..40444dc 100644 --- a/src/types/generated/propertytreetopic.ts +++ b/src/types/generated/propertytreetopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ import type { BoolPropertyMetaData, DMat2PropertyMetaData, DMat3PropertyMetaData, DMat4PropertyMetaData, DVec2PropertyMetaData, DVec3PropertyMetaData, DVec4PropertyMetaData, DoubleListPropertyMetaData, DoublePropertyMetaData, FloatPropertyMetaData, IVec2PropertyMetaData, IVec3PropertyMetaData, IVec4PropertyMetaData, IntListPropertyMetaData, IntPropertyMetaData, JsonValue, LongPropertyMetaData, Mat2PropertyMetaData, Mat3PropertyMetaData, Mat4PropertyMetaData, OptionPropertyMetaData, SelectionPropertyMetaData, ShortPropertyMetaData, StringListPropertyMetaData, StringPropertyMetaData, TriggerPropertyMetaData, UIntPropertyMetaData, ULongPropertyMetaData, UShortPropertyMetaData, UVec2PropertyMetaData, UVec3PropertyMetaData, UVec4PropertyMetaData, Vec2PropertyMetaData, Vec3PropertyMetaData, Vec4PropertyMetaData } from './properties'; diff --git a/src/types/generated/sessionrecordingtopic.ts b/src/types/generated/sessionrecordingtopic.ts index 43f4494..4092ed5 100644 --- a/src/types/generated/sessionrecordingtopic.ts +++ b/src/types/generated/sessionrecordingtopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface SessionRecordingTopic { diff --git a/src/types/generated/setpropertytopic.ts b/src/types/generated/setpropertytopic.ts index cd64fe8..4ca8edb 100644 --- a/src/types/generated/setpropertytopic.ts +++ b/src/types/generated/setpropertytopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ import type { JsonValue } from './properties'; diff --git a/src/types/generated/skybrowsertopic.ts b/src/types/generated/skybrowsertopic.ts index a8f39f0..f874869 100644 --- a/src/types/generated/skybrowsertopic.ts +++ b/src/types/generated/skybrowsertopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface SkyBrowserTopic { diff --git a/src/types/generated/subscriptiontopic.ts b/src/types/generated/subscriptiontopic.ts index 8513ccf..0ec8ea0 100644 --- a/src/types/generated/subscriptiontopic.ts +++ b/src/types/generated/subscriptiontopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ import type { BoolPropertyMetaData, DMat2PropertyMetaData, DMat3PropertyMetaData, DMat4PropertyMetaData, DVec2PropertyMetaData, DVec3PropertyMetaData, DVec4PropertyMetaData, DoubleListPropertyMetaData, DoublePropertyMetaData, FloatPropertyMetaData, IVec2PropertyMetaData, IVec3PropertyMetaData, IVec4PropertyMetaData, IntListPropertyMetaData, IntPropertyMetaData, JsonValue, LongPropertyMetaData, Mat2PropertyMetaData, Mat3PropertyMetaData, Mat4PropertyMetaData, OptionPropertyMetaData, SelectionPropertyMetaData, ShortPropertyMetaData, StringListPropertyMetaData, StringPropertyMetaData, TriggerPropertyMetaData, UIntPropertyMetaData, ULongPropertyMetaData, UShortPropertyMetaData, UVec2PropertyMetaData, UVec3PropertyMetaData, UVec4PropertyMetaData, Vec2PropertyMetaData, Vec3PropertyMetaData, Vec4PropertyMetaData } from './properties'; diff --git a/src/types/generated/timetopic.ts b/src/types/generated/timetopic.ts index 4564ad4..8b51e0a 100644 --- a/src/types/generated/timetopic.ts +++ b/src/types/generated/timetopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface TimeTopic { diff --git a/src/types/generated/triggerpropertytopic.ts b/src/types/generated/triggerpropertytopic.ts index 4640aea..62a1300 100644 --- a/src/types/generated/triggerpropertytopic.ts +++ b/src/types/generated/triggerpropertytopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface TriggerPropertyTopic { diff --git a/src/types/generated/versiontopic.ts b/src/types/generated/versiontopic.ts index a0ad229..22912f4 100644 --- a/src/types/generated/versiontopic.ts +++ b/src/types/generated/versiontopic.ts @@ -1,7 +1,8 @@ /** * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, - * and run json-schema-to-typescript to regenerate this file. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSON Schema file, and run + * `generate-topic-types` to regenerate this file. See the openspace-api-js repository: + * https://github.com/OpenSpace/openspace-api-js#generating-types-from-your-openspace-build */ export interface VersionTopic {