@reveldigital/player-client 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +236 -3
  2. package/esm2020/lib/interfaces/client.interface.mjs +1 -1
  3. package/esm2020/lib/interfaces/command.interface.mjs +1 -1
  4. package/esm2020/lib/interfaces/config.interface.mjs +45 -1
  5. package/esm2020/lib/interfaces/device.interface.mjs +1 -1
  6. package/esm2020/lib/interfaces/event-properties.interface.mjs +1 -1
  7. package/esm2020/lib/interfaces/location.interface.mjs +1 -1
  8. package/esm2020/lib/player-client.service.mjs +506 -76
  9. package/esm2020/lib/safe-style.pipe.mjs +3 -2
  10. package/esm2020/lib/version.mjs +2 -2
  11. package/fesm2015/reveldigital-player-client.mjs +509 -80
  12. package/fesm2015/reveldigital-player-client.mjs.map +1 -1
  13. package/fesm2020/reveldigital-player-client.mjs +509 -79
  14. package/fesm2020/reveldigital-player-client.mjs.map +1 -1
  15. package/lib/interfaces/client.interface.d.ts +318 -76
  16. package/lib/interfaces/client.interface.d.ts.map +1 -1
  17. package/lib/interfaces/command.interface.d.ts +66 -6
  18. package/lib/interfaces/command.interface.d.ts.map +1 -1
  19. package/lib/interfaces/config.interface.d.ts +127 -9
  20. package/lib/interfaces/config.interface.d.ts.map +1 -1
  21. package/lib/interfaces/device.interface.d.ts +104 -16
  22. package/lib/interfaces/device.interface.d.ts.map +1 -1
  23. package/lib/interfaces/event-properties.interface.d.ts +127 -3
  24. package/lib/interfaces/event-properties.interface.d.ts.map +1 -1
  25. package/lib/interfaces/location.interface.d.ts +150 -21
  26. package/lib/interfaces/location.interface.d.ts.map +1 -1
  27. package/lib/player-client.service.d.ts +491 -71
  28. package/lib/player-client.service.d.ts.map +1 -1
  29. package/lib/safe-style.pipe.d.ts +2 -1
  30. package/lib/safe-style.pipe.d.ts.map +1 -1
  31. package/lib/version.d.ts +1 -1
  32. package/package.json +3 -2
  33. package/schematics/ng-add/utils/yml2xml.js +2 -1
@@ -1,164 +1,406 @@
1
1
  import { IDictionary } from "./config.interface";
2
- /** @ignore */
2
+ /**
3
+ * Core interface defining the contract for Revel Digital player client implementations.
4
+ *
5
+ * This interface represents the complete API available for gadgets and web applications
6
+ * to interact with the Revel Digital player environment. It provides methods for:
7
+ *
8
+ * - **Device Information**: Access device details, timezone, language, and hardware specs
9
+ * - **Communication**: Send commands locally and to remote devices
10
+ * - **Analytics**: Track events, measure performance, and manage user sessions
11
+ * - **Player Control**: Manage gadget lifecycle and player transitions
12
+ * - **Configuration**: Apply and manage gadget preferences and settings
13
+ *
14
+ * Implementations of this interface handle the actual communication with the player
15
+ * environment, while providing a consistent API for client code regardless of the
16
+ * underlying platform or deployment scenario.
17
+ *
18
+ * ```typescript
19
+ * // Typical usage through PlayerClientService
20
+ * class MyGadget {
21
+ * constructor(private client: PlayerClientService) {}
22
+ *
23
+ * async initialize() {
24
+ * const device = await this.client.getDevice();
25
+ * const time = await this.client.getDeviceTime();
26
+ * this.client.track('gadget_initialized', { deviceType: device.deviceType });
27
+ * }
28
+ * }
29
+ * ```
30
+ *
31
+ * @export
32
+ * @interface IClient
33
+ * @since 1.0.0
34
+ */
3
35
  export interface IClient {
4
36
  /**
5
- * Callback to the player.
6
- * This is the primary method of communication between the client and the player.
37
+ * Sends a callback to the player with optional arguments.
7
38
  *
8
- * @param {...any[]} args
9
- * @returns {void}
10
- * @memberof IClient
39
+ * This is the primary method for bi-directional communication between the gadget
40
+ * and player scripting. When called, it triggers any callback handlers that have
41
+ * been configured in the player template scripting.
42
+ *
43
+ * @param args - Variable number of arguments to pass to the player callback handler
44
+ *
45
+ * ```typescript
46
+ * // Simple callback without arguments
47
+ * client.callback();
48
+ *
49
+ * // Callback with data
50
+ * client.callback('user_action', { buttonId: 'start', timestamp: Date.now() });
51
+ *
52
+ * // Multiple arguments
53
+ * client.callback('event_name', 'event_data', { additional: 'context' });
54
+ * ```
11
55
  */
12
56
  callback(...args: any[]): void;
13
57
  /**
14
- * Get device name
58
+ * Gets the current device time in the device's configured timezone.
59
+ *
60
+ * Returns the current time adjusted to the timezone assigned to the device
61
+ * in the Revel Digital CMS. If a date is provided, it will be converted
62
+ * to the device's timezone.
63
+ *
64
+ * @param date - Optional date to convert to device time. If omitted, returns current device time
65
+ * @returns Promise resolving to ISO8601 formatted date string in device timezone
15
66
  *
16
- * @returns {Promise<string | null>}
17
- * @memberof IClient
67
+ * ```typescript
68
+ * // Get current device time
69
+ * const now = await client.getDeviceTime();
70
+ *
71
+ * // Convert specific time to device timezone
72
+ * const utcTime = new Date('2023-12-25T12:00:00Z');
73
+ * const localTime = await client.getDeviceTime(utcTime);
74
+ * ```
18
75
  */
19
76
  getDeviceTime(date?: Date): Promise<string | null>;
20
77
  /**
21
- * Get device time zone name
78
+ * Gets the timezone name currently assigned to the device.
79
+ *
80
+ * Returns the human-readable timezone name as configured in the device
81
+ * settings within the Revel Digital CMS.
82
+ *
83
+ * @returns Promise resolving to timezone name (e.g., "America/New_York", "Europe/London")
22
84
  *
23
- * @returns {Promise<string | null>}
24
- * @memberof IClient
85
+ * ```typescript
86
+ * const timezoneName = await client.getDeviceTimeZoneName();
87
+ * console.log(`Device timezone: ${timezoneName}`);
88
+ * ```
25
89
  */
26
90
  getDeviceTimeZoneName(): Promise<string | null>;
27
91
  /**
28
- * Get device time zone ID
92
+ * Gets the timezone identifier currently assigned to the device.
29
93
  *
30
- * @returns {Promise<string | null>}
31
- * @memberof IClient
94
+ * Returns the timezone ID/identifier as configured for this device.
95
+ * This may be different from the timezone name depending on the system configuration.
96
+ *
97
+ * @returns Promise resolving to timezone identifier
98
+ *
99
+ * ```typescript
100
+ * const timezoneId = await client.getDeviceTimeZoneID();
101
+ * // Use for timezone-specific operations
102
+ * ```
32
103
  */
33
104
  getDeviceTimeZoneID(): Promise<string | null>;
34
105
  /**
35
- * Get device time zone offset
106
+ * Gets the numerical offset from GMT for the device's configured timezone.
107
+ *
108
+ * Returns the number of hours the device's timezone is offset from GMT.
109
+ * Positive values indicate timezones east of GMT, negative values indicate
110
+ * timezones west of GMT.
36
111
  *
37
- * @returns {Promise<number | null>}
38
- * @memberof IClient
112
+ * @returns Promise resolving to timezone offset in hours (e.g., -5 for EST, +1 for CET)
113
+ *
114
+ * ```typescript
115
+ * const offset = await client.getDeviceTimeZoneOffset();
116
+ * console.log(`Device is ${offset} hours from GMT`);
117
+ * ```
39
118
  */
40
119
  getDeviceTimeZoneOffset(): Promise<number | null>;
41
120
  /**
42
- * Get device language code
121
+ * Gets the language code currently assigned to the device.
122
+ *
123
+ * Returns the language/locale code configured for this device in the CMS.
124
+ * This can be used for localization and internationalization purposes.
125
+ *
126
+ * @returns Promise resolving to language code (e.g., "en-US", "fr-FR", "de-DE")
43
127
  *
44
- * @returns {Promise<string | null>}
45
- * @memberof IClient
128
+ * ```typescript
129
+ * const langCode = await client.getLanguageCode();
130
+ * if (langCode === 'fr-FR') {
131
+ * this.loadFrenchContent();
132
+ * }
133
+ * ```
46
134
  */
47
135
  getLanguageCode(): Promise<string | null>;
48
136
  /**
49
- * Get device key
137
+ * Gets the unique device key (registration key) for this player device.
50
138
  *
51
- * @returns {Promise<string | null>}
52
- * @memberof IClient
139
+ * The device key is a unique identifier assigned to each device when it's
140
+ * registered with the Revel Digital system. This key can be used for
141
+ * device-specific operations and remote command targeting.
142
+ *
143
+ * @returns Promise resolving to the device's unique registration key
144
+ *
145
+ * ```typescript
146
+ * const deviceKey = await client.getDeviceKey();
147
+ * console.log(`This device key: ${deviceKey}`);
148
+ * // Use for analytics or device-specific configuration
149
+ * ```
53
150
  */
54
151
  getDeviceKey(): Promise<string | null>;
55
152
  /**
56
- * Send command to device
153
+ * Sends a command to the local player device.
154
+ *
155
+ * Commands are used to trigger specific behaviors or actions on the player.
156
+ * The command is processed immediately by the local player only.
57
157
  *
58
- * @param name
59
- * @param arg
60
- * @returns {void}
61
- * @memberof IClient
158
+ * @param name - The command identifier/name
159
+ * @param arg - Command argument or payload data
160
+ *
161
+ * ```typescript
162
+ * // Simple command
163
+ * client.sendCommand('restart', '');
164
+ *
165
+ * // Command with parameters
166
+ * client.sendCommand('setVolume', '75');
167
+ * client.sendCommand('loadContent', JSON.stringify({ url: 'http://example.com' }));
168
+ * ```
62
169
  */
63
170
  sendCommand(name: string, arg: string): void;
64
171
  /**
65
- * Send remote command to device
172
+ * Sends a command to one or more remote player devices.
173
+ *
174
+ * Enables cross-device communication by sending commands to other devices
175
+ * within the same Revel Digital account. Useful for synchronized displays,
176
+ * coordinated actions, or remote device control.
66
177
  *
67
- * @param deviceKeys
68
- * @param name
69
- * @param arg
70
- * @returns {void}
71
- * @memberof IClient
178
+ * @param deviceKeys - Array of target device keys to receive the command
179
+ * @param name - The command identifier/name
180
+ * @param arg - Command argument or payload data
181
+ *
182
+ * ```typescript
183
+ * // Send to multiple devices
184
+ * const targets = ['lobby-display', 'kiosk-001', 'kiosk-002'];
185
+ * client.sendRemoteCommand(targets, 'updateContent', 'new-content-id');
186
+ *
187
+ * // Broadcast synchronization command
188
+ * client.sendRemoteCommand(['device1', 'device2'], 'sync', Date.now().toString());
189
+ * ```
72
190
  */
73
191
  sendRemoteCommand(deviceKeys: string[], name: string, arg: string): void;
74
192
  /**
75
- * Track event
193
+ * Tracks an analytics event with optional properties.
194
+ *
195
+ * Events are logged for analytics and reporting purposes, providing insights
196
+ * into gadget usage, performance, and user interactions. For timed events,
197
+ * the duration is automatically calculated from the timeEvent() call to this track() call.
76
198
  *
77
- * In the case of a timed event, the duration is calculated from the timeEvent call to the track call.
199
+ * @param eventName - Unique identifier for the event
200
+ * @param properties - Optional JSON string containing event properties and metadata
78
201
  *
79
- * @param eventName
80
- * @param properties
81
- * @returns {void}
82
- * @memberof IClient
202
+ * ```typescript
203
+ * // Simple event
204
+ * client.track('gadget_loaded', '');
205
+ *
206
+ * // Event with properties
207
+ * const props = JSON.stringify({
208
+ * action: 'button_click',
209
+ * button_id: 'submit',
210
+ * timestamp: Date.now()
211
+ * });
212
+ * client.track('user_interaction', props);
213
+ * ```
83
214
  */
84
215
  track(eventName: string, properties?: string): void;
85
216
  /**
86
- * Start tracking of event with duration
217
+ * Begins timing measurement for a named event.
218
+ *
219
+ * This starts a timer for performance measurement. The timer is stopped
220
+ * and duration calculated when track() is called with the same event name.
221
+ * Multiple concurrent timers can be active for different event names.
222
+ *
223
+ * @param eventName - Unique identifier for the timed event
87
224
  *
88
- * @param eventName
89
- * @returns {void}
90
- * @memberof IClient
225
+ * ```typescript
226
+ * // Start timing a video playback
227
+ * client.timeEvent('video_playback');
228
+ * // ... video plays for some duration ...
229
+ * client.track('video_playback', JSON.stringify({ videoId: 'abc123' }));
230
+ * // Duration is automatically included in the tracked event
231
+ * ```
91
232
  */
92
233
  timeEvent(eventName: string): void;
93
234
  /**
94
- * Start a new session
235
+ * Creates a new analytics event session for grouping related events.
236
+ *
237
+ * Sessions provide a way to group related events together for analysis.
238
+ * Each subsequent event tracked will be associated with this session
239
+ * until a new session is started.
240
+ *
241
+ * @param id - Optional custom session identifier. If not provided, a random ID is generated
242
+ *
243
+ * ```typescript
244
+ * // Start new session with auto-generated ID
245
+ * client.newEventSession();
246
+ * client.track('session_start', '');
95
247
  *
96
- * @param id optional session ID
97
- * @returns {void}
98
- * @memberof IClient
248
+ * // Start session with custom ID
249
+ * client.newEventSession('user-123-workflow');
250
+ * client.track('workflow_begin', '');
251
+ * ```
99
252
  */
100
253
  newEventSession(id?: string): void;
101
254
  /**
102
- * Get the root directory of the Revel system
255
+ * Gets the root directory path where the Revel Digital system stores files.
103
256
  *
104
- * @returns {Promise<string | null>}
105
- * @memberof IClient
257
+ * Returns the base file system path used by the player for storing
258
+ * content, cache, and other system files on the local device.
259
+ *
260
+ * @returns Promise resolving to the root directory path
261
+ *
262
+ * ```typescript
263
+ * const rootPath = await client.getRevelRoot();
264
+ * console.log(`System root: ${rootPath}`);
265
+ * // Use for file operations or path construction
266
+ * ```
106
267
  */
107
268
  getRevelRoot(): Promise<string | null>;
108
269
  /**
109
- * Get the command map
270
+ * Gets the current command map configuration for this device.
271
+ *
272
+ * Returns a JSON string containing the mapping of command names to their
273
+ * configurations as defined in the device's current template or playlist.
110
274
  *
111
- * @returns {Promise<string | null>}
112
- * @memberof IClient
275
+ * @returns Promise resolving to JSON string of command mappings
276
+ *
277
+ * ```typescript
278
+ * const commandMapJson = await client.getCommandMap();
279
+ * const commandMap = JSON.parse(commandMapJson);
280
+ * if (commandMap['customCommand']) {
281
+ * console.log('Custom command is available');
282
+ * }
283
+ * ```
113
284
  */
114
285
  getCommandMap(): Promise<string | null>;
115
286
  /**
116
- * Signals to the player that the client is finished and the player can transition to the next source
287
+ * Signals that the gadget has completed its visualization and the player can proceed.
288
+ *
289
+ * This notifies the player that the current content has finished displaying
290
+ * and it's safe to transition to the next item in a playlist or perform
291
+ * other scheduled actions.
292
+ *
293
+ * ```typescript
294
+ * // After animation completes
295
+ * setTimeout(() => {
296
+ * client.finish();
297
+ * }, 5000);
298
+ *
299
+ * // After user interaction
300
+ * button.onclick = () => {
301
+ * this.processAction();
302
+ * client.finish();
303
+ * };
304
+ * ```
117
305
  */
118
306
  finish(): void;
119
307
  /**
120
- * Get device information
308
+ * Gets comprehensive information about the current device.
309
+ *
310
+ * Returns detailed device information including registration details,
311
+ * hardware type, location, and configuration as a JSON string.
312
+ *
313
+ * @returns Promise resolving to JSON string containing device information
121
314
  *
122
- * @returns {Promise<string | null>}
123
- * @memberof IClient
315
+ * ```typescript
316
+ * const deviceJson = await client.getDevice();
317
+ * const device = JSON.parse(deviceJson);
318
+ * console.log(`Device: ${device.name} (${device.devicetype})`);
319
+ * console.log(`Location: ${device.location?.city}, ${device.location?.state}`);
320
+ * ```
124
321
  */
125
322
  getDevice(): Promise<string | null>;
126
323
  /**
127
- * Get width of the visualization area
324
+ * Gets the width of the available visualization area in pixels.
128
325
  *
129
- * @returns {Promise<number | null>}
130
- * @memberof IClient
326
+ * Returns the display width available for gadget content, which may
327
+ * differ from screen resolution based on template layout and player configuration.
328
+ *
329
+ * @returns Promise resolving to width in pixels
330
+ *
331
+ * ```typescript
332
+ * const width = await client.getWidth();
333
+ * if (width < 800) {
334
+ * this.enableMobileLayout();
335
+ * }
336
+ * ```
131
337
  */
132
338
  getWidth(): Promise<number | null>;
133
339
  /**
134
- * Get height of the visualization area
340
+ * Gets the height of the available visualization area in pixels.
341
+ *
342
+ * Returns the display height available for gadget content, which may
343
+ * differ from screen resolution based on template layout and player configuration.
135
344
  *
136
- * @returns {Promise<number | null>}
137
- * @memberof IClient
345
+ * @returns Promise resolving to height in pixels
346
+ *
347
+ * ```typescript
348
+ * const height = await client.getHeight();
349
+ * const width = await client.getWidth();
350
+ * const aspectRatio = width / height;
351
+ * this.adjustLayout(aspectRatio);
352
+ * ```
138
353
  */
139
354
  getHeight(): Promise<number | null>;
140
355
  /**
141
- * Get the duration of the currently playing source
142
- * (only applicable when associated with a playlist)
356
+ * Gets the duration assigned to the current playlist item.
357
+ *
358
+ * Returns the time duration (in milliseconds) that this content should
359
+ * be displayed when running as part of a playlist. Only applicable
360
+ * when the gadget is associated with a playlist.
361
+ *
362
+ * @returns Promise resolving to duration in milliseconds
143
363
  *
144
- * @returns {Promise<number | null>}
145
- * @memberof IClient
364
+ * ```typescript
365
+ * const duration = await client.getDuration();
366
+ * if (duration) {
367
+ * // Auto-finish after the assigned duration
368
+ * setTimeout(() => client.finish(), duration);
369
+ * }
370
+ * ```
146
371
  */
147
372
  getDuration(): Promise<number | null>;
148
373
  /**
149
- * Get the SDK version
374
+ * Gets the version of the Revel Digital SDK.
150
375
  *
151
- * @returns {Promise<string | null>}
152
- * @memberof IClient
376
+ * Returns the current version string of the SDK/client library.
377
+ *
378
+ * @returns Promise resolving to version string
379
+ *
380
+ * ```typescript
381
+ * const version = await client.getSdkVersion();
382
+ * console.log(`SDK Version: ${version}`);
383
+ * ```
153
384
  */
154
385
  getSdkVersion(): Promise<string | null>;
155
386
  /**
156
- * Sends the preference values to the CMS for assignement to the gadget configuration.
387
+ * Applies configuration preferences to the gadget (design-time only).
388
+ *
389
+ * This method is used during gadget design/configuration to apply
390
+ * preference changes. It sends the updated preferences to the CMS
391
+ * for assignment to the gadget configuration. Only available during
392
+ * design-time operations.
157
393
  *
158
- * Provides the ability to have the gadget present a UI for setting preferences.
159
- * Only available during design time.
394
+ * @param prefs - Dictionary of preference key-value pairs to apply
160
395
  *
161
- * @param prefs key/value pairs of preferences to apply
396
+ * ```typescript
397
+ * // Apply configuration changes in design mode
398
+ * client.applyConfig({
399
+ * 'title': 'Updated Title',
400
+ * 'backgroundColor': '#ff0000',
401
+ * 'autoRefresh': true
402
+ * });
403
+ * ```
162
404
  */
163
405
  applyConfig(prefs: IDictionary<any>): void;
164
406
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.interface.d.ts","sourceRoot":"","sources":["../../../../../projects/reveldigital/player-client/src/lib/interfaces/client.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,cAAc;AACd,MAAM,WAAW,OAAO;IAEpB;;;;;;;OAOG;IACH,QAAQ,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAE/B;;;;;OAKG;IACH,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEnD;;;;;OAKG;IACH,qBAAqB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEhD;;;;;OAKG;IACH,mBAAmB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAE9C;;;;;OAKG;IACH,uBAAuB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAElD;;;;;OAKG;IACH,eAAe,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAE1C;;;;;OAKG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEvC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IACH,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;;;;;;;;;;;;;;;;;OAkBG;IACH,eAAe,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;;;;;;;;;;;;OAaG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEvC;;;;;;;;;;;;;;;OAeG;IACH,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAExC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,IAAI,IAAI,CAAC;IAEf;;;;;;;;;;;;;;OAcG;IACH,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEpC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEnC;;;;;;;;;;;;;;OAcG;IACH,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEpC;;;;;;;;;;;;;;;;OAgBG;IACH,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAEtC;;;;;;;;;;;OAWG;IACH,aAAa,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAExC;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CAC9C"}
@@ -1,18 +1,78 @@
1
+ /**
2
+ * Interface representing a command sent to or from the Revel Digital player.
3
+ *
4
+ * Commands are the primary mechanism for triggering actions and behaviors
5
+ * in the player environment. They consist of a name identifier and an
6
+ * optional argument payload that provides additional context or parameters.
7
+ *
8
+ * Commands can originate from:
9
+ * - Remote devices via sendRemoteCommand()
10
+ * - Template scripting via player callbacks
11
+ * - Playlist actions and transitions
12
+ * - Manual triggers from the CMS interface
13
+ *
14
+ * ```typescript
15
+ * // Subscribe to incoming commands
16
+ * this.client.onCommand$.subscribe((command: ICommand) => {
17
+ * switch (command.name) {
18
+ * case 'refresh':
19
+ * this.refreshContent();
20
+ * break;
21
+ * case 'updateConfig':
22
+ * this.applyNewConfig(JSON.parse(command.arg));
23
+ * break;
24
+ * case 'customAction':
25
+ * this.handleCustomAction(command.arg);
26
+ * break;
27
+ * }
28
+ * });
29
+ * ```
30
+ *
31
+ * @export
32
+ * @interface ICommand
33
+ * @since 1.0.0
34
+ */
1
35
  export interface ICommand {
2
36
  /**
3
- * Command name
37
+ * The command identifier or action name.
4
38
  *
5
- * @type {string}
39
+ * This is a string that uniquely identifies the type of command or action
40
+ * to be performed. Command names should be descriptive and consistent
41
+ * across the application.
6
42
  *
7
- * @memberof Command
43
+ * Common command names:
44
+ * - "refresh" - Reload content or data
45
+ * - "restart" - Restart the application or component
46
+ * - "updateConfig" - Apply new configuration settings
47
+ * - "setVolume" - Adjust audio volume
48
+ * - "loadContent" - Load specific content by ID
49
+ * - "sync" - Synchronize with other devices
8
50
  */
9
51
  name: string;
10
52
  /**
11
- * Command arguments
53
+ * Optional command argument or payload data.
12
54
  *
13
- * @type {Array<string>}
55
+ * This string contains any additional data required by the command.
56
+ * For complex data structures, this is typically a JSON-encoded string
57
+ * that can be parsed by the command handler.
14
58
  *
15
- * @memberof ICommand
59
+ * ```typescript
60
+ * // Simple string argument
61
+ * { name: "setVolume", arg: "75" }
62
+ *
63
+ * // JSON payload for complex data
64
+ * {
65
+ * name: "loadContent",
66
+ * arg: JSON.stringify({
67
+ * contentId: "abc123",
68
+ * transition: "fade",
69
+ * duration: 5000
70
+ * })
71
+ * }
72
+ *
73
+ * // Empty argument for parameterless commands
74
+ * { name: "refresh", arg: "" }
75
+ * ```
16
76
  */
17
77
  arg: string;
18
78
  }
@@ -1 +1 @@
1
- {"version":3,"file":"command.interface.d.ts","sourceRoot":"","sources":["../../../../../projects/reveldigital/player-client/src/lib/interfaces/command.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACrB;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;OAMG;IACH,GAAG,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"command.interface.d.ts","sourceRoot":"","sources":["../../../../../projects/reveldigital/player-client/src/lib/interfaces/command.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,WAAW,QAAQ;IACrB;;;;;;;;;;;;;;OAcG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,GAAG,EAAE,MAAM,CAAC;CACf"}