From 0f5b5a9dc15b1d2e613e16b038abded46b87aa26 Mon Sep 17 00:00:00 2001 From: Mees van der Wijk Date: Sat, 9 Aug 2025 16:33:38 +0200 Subject: [PATCH] Started on new specs --- ModuleClientAPI.md | 89 ++++++++++++++++++++++------------------ ModuleServerAPIClient.md | 8 ++-- 2 files changed, 53 insertions(+), 44 deletions(-) diff --git a/ModuleClientAPI.md b/ModuleClientAPI.md index 43e2301..c0cdb76 100644 --- a/ModuleClientAPI.md +++ b/ModuleClientAPI.md @@ -2,36 +2,7 @@ Class representing the ModuleClientAPI. - - -## Functions +## Communication ### send @@ -71,6 +42,8 @@ api.finishClientCondition(conditionId); | ----------- | ------ | ------------------------ | | conditionId | string | The id of the condition. | +## Events + ### onPropertyUpdate Register a listener for when a property updates in a scene change. @@ -108,6 +81,8 @@ api.onResize(callback); | -------- | -------- | -------------------------------------------------------- | | callback | function | Function that will be called when the module is resized. | +## Getters + ### dom Get the HTMLDivElement that contains the module HTML. It is important that all your query's to the document are based of this. So you need to use `api.dom().querySeletor(p)` instead of `document.querySeletor(p)` to prevent querying element from another module. @@ -118,6 +93,18 @@ api.dom(); **Returns** HTMLDivElement _The module container_ +### getUser + +Get the current user object. + +```javascript +api.getUser(); +``` + +**Return** [User](./ModuleClientAPIUser) _The user object_ + +### getModuleID **(TODO)** + ### getResolution Get the scene resolution. @@ -128,6 +115,38 @@ api.getResolution(); **Returns** { width:number, height:number } _Resolution of scene_ +### getTime **(TODO)** + +### isInEditor **(TODO)** + +## Snapshots + +### onSnapshotRestore **(TODO)** + +### onSnapshotCreate **(TODO)** + +### getRuntimeStorage **(TODO)** + +## Playback + +### onPlayStateChange **(TODO)** + +### onVolumeChange **(TODO)** + +### onAudioAllowed **(TODO)** + +### getVolume **(TODO)** + +### getPlayState **(TODO)** + +## Neighbors + +### getNeighbors **(TODO)** + +### onNeighborMessage **(TODO)** + +## Utils + ### redirect Redirect user to another url. If the url is a channel on the same server and target is `self` it will redirect internally. @@ -141,16 +160,6 @@ api.redirect(address target) | address | string | The new address to redirect to | | target | 'self' | 'blank' | 'parent' | The target to open the page in. | -### getUser - -Get the current user object. - -```javascript -api.getUser(); -``` - -**Return** [User](./ModuleClientAPIUser) _The user object_ - ## Globals ### Feedback (notifications, dialogs, confirms, alerts) diff --git a/ModuleServerAPIClient.md b/ModuleServerAPIClient.md index 213e8d1..03dad73 100644 --- a/ModuleServerAPIClient.md +++ b/ModuleServerAPIClient.md @@ -57,12 +57,12 @@ client.getDisplayID(); \*_Returns_ string _Display ID_ -### getUserID +### getClientID -Get the user id. +Get the client id. ```javascript -client.getUserID(); +client.getClientID(); ``` -\*_Returns_ string _User ID_ +\*_Returns_ string _Client ID_