Browse Source

Up device_manager jsdoc

data-source-schema
Artur Arseniev 3 months ago
parent
commit
77a8a96d68
  1. 33
      docs/api/device_manager.md
  2. 7
      packages/core/src/device_manager/index.ts

33
docs/api/device_manager.md

@ -19,12 +19,35 @@ const deviceManager = editor.Devices;
```
## Available Events
* `device:add` New device added to the collection. The `Device` is passed as an argument.
* `device:add` - Added new device. The [Device] is passed as an argument to the callback
* `device:remove` - Device removed. The [Device] is passed as an argument to the callback
* `device:select` - New device selected. The newly selected [Device] and the previous one, are passed as arguments to the callback
* `device:update` - Device updated. The updated [Device] and the object containing changes are passed as arguments to the callback
* `device` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback
```javascript
editor.on('device:add', (device) => { ... });
```
* `device:remove` Device removed from the collection. The `Device` is passed as an argument.
```javascript
editor.on('device:remove', (device) => { ... });
```
* `device:select` A new device is selected. The `Device` is passed as an argument.
```javascript
editor.on('device:select', (device) => { ... });
```
* `device:update` Device updated. The `Device` and the object containing changes are passed as arguments.
```javascript
editor.on('device:update', (device) => { ... });
```
* `device` Catch-all event for all the events mentioned above.
```javascript
editor.on('device', ({ event, model, ... }) => { ... });
```
## Methods

7
packages/core/src/device_manager/index.ts

@ -13,12 +13,7 @@
* ```js
* const deviceManager = editor.Devices;
* ```
* ## Available Events
* * `device:add` - Added new device. The [Device] is passed as an argument to the callback
* * `device:remove` - Device removed. The [Device] is passed as an argument to the callback
* * `device:select` - New device selected. The newly selected [Device] and the previous one, are passed as arguments to the callback
* * `device:update` - Device updated. The updated [Device] and the object containing changes are passed as arguments to the callback
* * `device` - Catch-all event for all the events mentioned above. An object containing all the available data about the triggered event is passed as an argument to the callback
* {REPLACE_EVENTS}
*
* ## Methods
* * [add](#add)

Loading…
Cancel
Save