@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
@@ -11,26 +11,118 @@ import * as i0 from "@angular/core";
11
11
  declare global {
12
12
  var Client: IClient;
13
13
  }
14
+ /**
15
+ * Service for interacting with the Revel Digital player client.
16
+ *
17
+ * This service provides a comprehensive interface for gadgets and web applications
18
+ * to communicate with the Revel Digital player environment. It handles device
19
+ * information, commands, events, analytics tracking, and configuration management.
20
+ *
21
+ * The service supports both direct API calls and event-based communication patterns,
22
+ * allowing gadgets to respond to player lifecycle events (start, stop, commands) and
23
+ * send data back to the player or remote devices.
24
+ *
25
+ * ```typescript
26
+ * constructor(private client: PlayerClientService) {
27
+ * // Subscribe to player events
28
+ * this.client.onStart$.subscribe(() => {
29
+ * console.log('Gadget started');
30
+ * });
31
+ *
32
+ * this.client.onCommand$.subscribe(command => {
33
+ * console.log('Received command:', command);
34
+ * });
35
+ * }
36
+ *
37
+ * async ngOnInit() {
38
+ * // Get device information
39
+ * const device = await this.client.getDevice();
40
+ * const deviceTime = await this.client.getDeviceTime();
41
+ *
42
+ * // Track analytics
43
+ * this.client.track('gadget_loaded', { version: '1.0' });
44
+ * }
45
+ * ```
46
+ *
47
+ * @since 1.0.0
48
+ */
14
49
  export declare class PlayerClientService implements OnDestroy {
15
50
  /** @ignore */
16
51
  private clientPromise;
17
52
  /**
18
- * Commands sent to this player.
53
+ * Observable stream of commands sent to this player from the Revel Digital platform.
54
+ * Subscribe to this to handle custom commands sent from templates, playlists, or remote devices.
55
+ *
56
+ * ```typescript
57
+ * this.client.onCommand$.subscribe(command => {
58
+ * if (command.name === 'customAction') {
59
+ * this.handleCustomAction(command.arg);
60
+ * }
61
+ * });
62
+ * ```
19
63
  */
20
64
  onCommand$: Subject<ICommand>;
21
65
  /**
22
- * Signals the gadget has been loaded and is ready to start.
66
+ * Observable that signals when the gadget has been loaded and is ready to start.
67
+ * Emits `true` when ready, `false` when destroyed.
68
+ *
69
+ * ```typescript
70
+ * this.client.onReady$.subscribe(isReady => {
71
+ * if (isReady) {
72
+ * console.log('Client is ready');
73
+ * this.initializeGadget();
74
+ * }
75
+ * });
76
+ * ```
23
77
  */
24
78
  onReady$: BehaviorSubject<boolean>;
25
79
  /**
26
- * Signals the gadget has been started by the player.
80
+ * Observable that signals when the gadget has been started by the player.
81
+ * This event occurs when the player begins execution of the gadget content.
82
+ *
83
+ * ```typescript
84
+ * this.client.onStart$.subscribe(() => {
85
+ * console.log('Gadget started');
86
+ * this.startAnimation();
87
+ * });
88
+ * ```
27
89
  */
28
90
  onStart$: Subject<unknown>;
29
91
  /**
30
- * Signals the gadgets has been stopped by the player.
92
+ * Observable that signals when the gadget has been stopped by the player.
93
+ * This event occurs when the player stops execution, typically when moving
94
+ * to the next item in a playlist or when the content duration expires.
95
+ *
96
+ * ```typescript
97
+ * this.client.onStop$.subscribe(() => {
98
+ * console.log('Gadget stopped');
99
+ * this.cleanup();
100
+ * });
101
+ * ```
31
102
  */
32
103
  onStop$: Subject<unknown>;
104
+ /**
105
+ * Observable that signals when the gadget should open the configuration window.
106
+ * This allows gadgets to respond to configuration requests from the player.
107
+ *
108
+ * ```typescript
109
+ * this.client.onConfig$.subscribe(() => {
110
+ * this.openConfigurationDialog();
111
+ * });
112
+ * ```
113
+ */
33
114
  onConfig$: Subject<unknown>;
115
+ /**
116
+ * Observable that signals when the gadget has received a postMessage event from the player.
117
+ * This handles communication between the gadget and player via the postMessage API.
118
+ *
119
+ * ```typescript
120
+ * this.client.onPostMessage$.subscribe(message => {
121
+ * console.log('Received message:', message);
122
+ * this.handlePlayerMessage(message);
123
+ * });
124
+ * ```
125
+ */
34
126
  onPostMessage$: Subject<unknown>;
35
127
  /** @ignore */
36
128
  private onStartSub;
@@ -54,164 +146,492 @@ export declare class PlayerClientService implements OnDestroy {
54
146
  /** @ignore */
55
147
  static init(data: any): void;
56
148
  /**
149
+ * Sends a callback to player scripting with variable arguments.
150
+ *
57
151
  * This method allows the gadget to communicate with player scripting.
58
- * If the appropriate scripting is in place in the currently running template, calling this method
59
- * will initiate a callback which can be acted upon in player script.
152
+ * If the appropriate scripting is in place in the currently running template,
153
+ * calling this method will initiate a callback which can be acted upon in player script.
154
+ *
155
+ * @param args - Variable number of arguments to pass to the callback (max 5 arguments)
60
156
  *
61
- * @example
62
- * client.callback('test', 'this');
157
+ * ```typescript
158
+ * // Send a simple callback
159
+ * this.client.callback('test', 'data');
63
160
  *
64
- * @param args variable number of arguments
161
+ * // Send multiple parameters
162
+ * this.client.callback('action', 'value1', 'value2', { data: 'object' });
163
+ * ```
65
164
  */
66
165
  callback(...args: any[]): void;
67
166
  /**
68
- * Accessor method for the user preferences interface exposed by the Gadgets API.
167
+ * Gets the user preferences interface exposed by the Google Gadgets API.
69
168
  *
70
- * See {@link https://developers.google.com/gadgets/docs/basic} for more details on the Gadgets API.
169
+ * This method provides access to gadget preferences which can be configured
170
+ * in the Revel Digital CMS. Use this to retrieve user-configurable settings
171
+ * for your gadget.
71
172
  *
72
- * @example
173
+ * @returns The Gadgets API Prefs object for accessing preference values
174
+ *
175
+ * ```typescript
73
176
  * constructor(public client: PlayerClientService) {
74
- * let prefs = client.getPrefs();
75
- * let myString = prefs.getString('myStringPref');
177
+ * const prefs = client.getPrefs();
178
+ * const myString = prefs.getString('myStringPref');
179
+ * const myNumber = prefs.getInt('myNumberPref');
180
+ * const myBool = prefs.getBool('myBoolPref');
76
181
  * }
77
- * @returns {gadgets.Prefs} Gadget API Prefs object
182
+ * ```
183
+ *
184
+ * @see {@link https://developers.google.com/gadgets/docs/basic} Google Gadgets API documentation
78
185
  */
79
186
  getPrefs(): gadgets.Prefs;
80
187
  /**
81
- * Returns the current device time in ISO8601 format.
188
+ * Gets the current device time in ISO8601 format.
189
+ *
82
190
  * Current device time is determined by the device timezone assigned to the device in the CMS.
191
+ * This is useful for displaying time-sensitive content or scheduling operations based on
192
+ * the device's local time rather than browser time.
83
193
  *
84
- * @param date Optional. If supplied will translate the supplied date/time to device time based on respective timezones.
85
- * @returns Date/time in ISO8601 format
194
+ * @param date - Optional. If supplied, will translate the supplied date/time to device time based on respective timezones
195
+ * @returns Promise resolving to date/time in ISO8601 format
196
+ *
197
+ * ```typescript
198
+ * // Get current device time
199
+ * const currentTime = await this.client.getDeviceTime();
200
+ * console.log('Device time:', currentTime);
201
+ *
202
+ * // Convert a specific date to device time
203
+ * const specificDate = new Date('2023-01-01T12:00:00Z');
204
+ * const deviceTime = await this.client.getDeviceTime(specificDate);
205
+ * ```
86
206
  */
87
207
  getDeviceTime(date?: Date): Promise<string>;
88
208
  /**
89
- * Returns the timezone name currently assigned to the device.
209
+ * Gets the timezone name currently assigned to the device.
210
+ *
211
+ * @returns Promise resolving to the timezone name (e.g., "America/New_York")
90
212
  *
91
- * @returns Timezone Name
213
+ * ```typescript
214
+ * const timezoneName = await this.client.getDeviceTimeZoneName();
215
+ * console.log('Device timezone:', timezoneName);
216
+ * ```
92
217
  */
93
218
  getDeviceTimeZoneName(): Promise<string>;
94
219
  /**
95
- * Returns the timezone ID currently assigned to the device.
220
+ * Gets the timezone ID currently assigned to the device.
96
221
  *
97
- * @returns Timezone ID
222
+ * @returns Promise resolving to the timezone ID
223
+ *
224
+ * ```typescript
225
+ * const timezoneId = await this.client.getDeviceTimeZoneID();
226
+ * console.log('Device timezone ID:', timezoneId);
227
+ * ```
98
228
  */
99
229
  getDeviceTimeZoneID(): Promise<string>;
100
230
  /**
101
- * Returns the numerical offset from GMT of the timezone currently assigned to the device.
231
+ * Gets the numerical offset from GMT of the timezone currently assigned to the device.
232
+ *
233
+ * @returns Promise resolving to the timezone offset in hours (e.g., -5 for EST)
102
234
  *
103
- * @returns Timezone offset
235
+ * ```typescript
236
+ * const offset = await this.client.getDeviceTimeZoneOffset();
237
+ * console.log('Device timezone offset:', offset, 'hours from GMT');
238
+ * ```
104
239
  */
105
240
  getDeviceTimeZoneOffset(): Promise<number>;
106
241
  /**
107
- * Returns the language code of the language currently assigned to the device.
242
+ * Gets the language code of the language currently assigned to the device.
243
+ *
244
+ * @returns Promise resolving to the language code (e.g., "en-US", "fr-FR")
108
245
  *
109
- * @returns Language code
246
+ * ```typescript
247
+ * const languageCode = await this.client.getLanguageCode();
248
+ * console.log('Device language:', languageCode);
249
+ * // Use for localization
250
+ * this.loadLanguageResources(languageCode);
251
+ * ```
110
252
  */
111
253
  getLanguageCode(): Promise<string>;
112
254
  /**
113
- * Returns the unique Revel Digital device key associated with the device.
255
+ * Gets the unique Revel Digital device key associated with the device.
114
256
  *
115
- * @returns Device key
257
+ * The device key is a unique identifier for this specific player device
258
+ * and can be used for device-specific operations or remote commands.
259
+ *
260
+ * @returns Promise resolving to the device key string
261
+ *
262
+ * ```typescript
263
+ * const deviceKey = await this.client.getDeviceKey();
264
+ * console.log('Device key:', deviceKey);
265
+ * ```
116
266
  */
117
267
  getDeviceKey(): Promise<string>;
118
268
  /**
119
- * Send a command to the player device.
269
+ * Sends a command to the local player device.
270
+ *
271
+ * Commands can be used to control various aspects of the player or trigger
272
+ * specific behaviors. The command is processed by the local player only.
120
273
  *
121
- * @param name Command name
122
- * @param arg Command argument
274
+ * @param name - The command name/identifier
275
+ * @param arg - The command argument/payload
276
+ *
277
+ * ```typescript
278
+ * // Send a simple command
279
+ * this.client.sendCommand('refresh', '');
280
+ *
281
+ * // Send a command with data
282
+ * this.client.sendCommand('setVolume', '50');
283
+ *
284
+ * // Send a command with JSON data
285
+ * this.client.sendCommand('configure', JSON.stringify({ setting: 'value' }));
286
+ * ```
123
287
  */
124
288
  sendCommand(name: string, arg: string): void;
125
289
  /**
126
- * Send a command to any remote player with the supplied device key(s).
290
+ * Sends a command to remote player devices with the specified device keys.
291
+ *
292
+ * Remote commands allow cross-device communication within the same Revel Digital account.
293
+ * This is useful for synchronized displays, device coordination, or remote control scenarios.
294
+ *
127
295
  * Note: Remote commands can only be delivered to devices within the same account as the sender device.
128
296
  *
129
- * @param deviceKeys Array of remote device keys
130
- * @param name Command name
131
- * @param arg Command arg
297
+ * @param deviceKeys - Array of target device keys to send the command to
298
+ * @param name - The command name/identifier
299
+ * @param arg - The command argument/payload
300
+ *
301
+ * ```typescript
302
+ * // Send command to specific devices
303
+ * const targetDevices = ['device-key-1', 'device-key-2'];
304
+ * this.client.sendRemoteCommand(targetDevices, 'syncAction', 'start');
305
+ *
306
+ * // Broadcast to multiple devices
307
+ * this.client.sendRemoteCommand(
308
+ * ['lobby-display', 'kiosk-1', 'kiosk-2'],
309
+ * 'updateContent',
310
+ * JSON.stringify({ contentId: '12345' })
311
+ * );
312
+ * ```
132
313
  */
133
314
  sendRemoteCommand(deviceKeys: string[], name: string, arg: string): void;
134
315
  /**
135
- * Log an event for use with AdHawk analytics.
136
- * Events are used for tracking various metrics including usage statistics, player condition, state changes, etc.
316
+ * Logs an analytics event for use with AdHawk analytics and reporting.
317
+ *
318
+ * Events are used for tracking various metrics including usage statistics,
319
+ * player condition, state changes, user interactions, and custom business metrics.
320
+ * These events can be viewed in the Revel Digital analytics dashboard.
321
+ *
322
+ * @param eventName - Unique name for this event (should be descriptive and consistent)
323
+ * @param properties - Optional map of user-defined properties to associate with this event
137
324
  *
138
- * @param eventName Unique name for this event
139
- * @param properties A map of user defined properties to associate with this event
325
+ * ```typescript
326
+ * // Simple event tracking
327
+ * this.client.track('gadget_loaded');
328
+ *
329
+ * // Event with properties
330
+ * this.client.track('user_interaction', {
331
+ * action: 'button_click',
332
+ * button_id: 'start_button',
333
+ * timestamp: new Date().toISOString()
334
+ * });
335
+ *
336
+ * // Performance tracking
337
+ * this.client.track('content_displayed', {
338
+ * content_type: 'video',
339
+ * duration: 30,
340
+ * quality: 'HD'
341
+ * });
342
+ * ```
140
343
  */
141
344
  track(eventName: string, properties?: IEventProperties): void;
142
345
  /**
143
- * Method for initiating a timed event.
144
- * Timed events are useful for tracking the duration of an event and must be proceeded with a call to track().
346
+ * Initiates a timed event for duration tracking.
347
+ *
348
+ * Timed events are useful for tracking the duration of operations or user interactions.
349
+ * This method must be followed by a call to track() with the same event name to complete
350
+ * the timing measurement. The duration will be automatically calculated and included
351
+ * in the event properties.
145
352
  *
146
- * @example
147
- * client.timeEvent('testEvent');
148
- * client.track("test", { "a": "b" });
149
- * @param eventName Unique name for this event
353
+ * @param eventName - Unique name for this timed event (must match the subsequent track() call)
354
+ *
355
+ * ```typescript
356
+ * // Start timing an event
357
+ * this.client.timeEvent('video_playback');
358
+ *
359
+ * // ... video plays for some duration ...
360
+ *
361
+ * // End timing and log the event with duration
362
+ * this.client.track('video_playback', {
363
+ * video_id: 'abc123',
364
+ * quality: 'HD'
365
+ * }); // Duration will be automatically added
366
+ *
367
+ * // Example for user interaction timing
368
+ * this.client.timeEvent('form_completion');
369
+ * // ... user fills out form ...
370
+ * this.client.track('form_completion', { form_type: 'contact' });
371
+ * ```
150
372
  */
151
373
  timeEvent(eventName: string): void;
152
374
  /**
153
- * A session is a way of grouping events together. Each event has an associated session ID.
154
- * Session ID's are randomly generated and reset by subsequent calls to newEventSession().
375
+ * Creates a new analytics event session for grouping related events.
376
+ *
377
+ * A session is a way of grouping events together for analysis. Each event tracked
378
+ * after calling this method will have the same session ID until a new session is created.
379
+ * Session IDs are randomly generated unless explicitly provided.
380
+ *
381
+ * This is useful for tracking user journeys, workflow completion, or grouping
382
+ * related interactions within a specific time period.
155
383
  *
156
- * Each call to track() will utilize the same session ID, until another call to newEventSession().
157
- * @param id Optional. User supplied session ID. If not supplied a random session ID will be generated.
384
+ * @param id - Optional user-supplied session ID. If not provided, a random session ID will be generated
385
+ *
386
+ * ```typescript
387
+ * // Start a new session with auto-generated ID
388
+ * this.client.newEventSession();
389
+ * this.client.track('session_start');
390
+ * this.client.track('user_action_1');
391
+ * this.client.track('user_action_2');
392
+ *
393
+ * // Start a session with custom ID
394
+ * this.client.newEventSession('user-workflow-12345');
395
+ * this.client.track('workflow_start');
396
+ * this.client.track('step_completed', { step: 1 });
397
+ *
398
+ * // Start a new session for different workflow
399
+ * this.client.newEventSession();
400
+ * this.client.track('different_workflow_start');
401
+ * ```
158
402
  */
159
403
  newEventSession(id?: string): void;
160
404
  /**
161
- * Returns the root folder utilized by this player device.
405
+ * Gets the root folder path utilized by this player device.
162
406
  *
163
- * @returns Path to the root folder
407
+ * This returns the base directory path where the Revel Digital player
408
+ * stores its files and resources on the local device.
409
+ *
410
+ * @returns Promise resolving to the path of the root folder
411
+ *
412
+ * ```typescript
413
+ * const rootPath = await this.client.getRevelRoot();
414
+ * console.log('Player root directory:', rootPath);
415
+ * // Use for constructing file paths or understanding storage structure
416
+ * ```
164
417
  */
165
418
  getRevelRoot(): Promise<string>;
166
419
  /**
167
- * Returns a map of commands currently active for this device.
420
+ * Gets a map of commands currently active for this device.
421
+ *
422
+ * This returns the current command configuration that defines how the device
423
+ * responds to various command triggers and remote commands.
168
424
  *
169
- * @returns Map of commands currently active for this device.
425
+ * @returns Promise resolving to a map of currently active commands
426
+ *
427
+ * ```typescript
428
+ * const commandMap = await this.client.getCommandMap();
429
+ * console.log('Active commands:', commandMap);
430
+ *
431
+ * // Check if specific command is available
432
+ * if (commandMap['customCommand']) {
433
+ * console.log('Custom command is available');
434
+ * }
435
+ * ```
170
436
  */
171
437
  getCommandMap(): Promise<any>;
172
438
  /**
173
- * Indicate to the player that this gadget has finished it's visualization.
174
- * This allows the player to proceed with the next item in a playlist if applicable.
439
+ * Signals to the player that this gadget has completed its visualization.
440
+ *
441
+ * This method notifies the player that the current gadget has finished its
442
+ * content display or interaction cycle. The player can then proceed with
443
+ * the next item in a playlist if applicable, or handle the completion
444
+ * according to its configuration.
445
+ *
446
+ * Call this method when your gadget has completed its intended function,
447
+ * such as finishing an animation, completing a form, or reaching a natural
448
+ * stopping point.
449
+ *
450
+ * ```typescript
451
+ * // After completing an animation
452
+ * private onAnimationComplete(): void {
453
+ * this.client.finish();
454
+ * }
455
+ *
456
+ * // After user interaction is complete
457
+ * private onFormSubmitted(): void {
458
+ * this.saveFormData();
459
+ * this.client.finish();
460
+ * }
461
+ *
462
+ * // After a timed display period
463
+ * setTimeout(() => {
464
+ * this.client.finish();
465
+ * }, 30000); // 30 seconds
466
+ * ```
175
467
  */
176
468
  finish(): void;
177
469
  /**
178
- * Check is the gadget is running in preview mode. Preview mode is enabled when the gadget is
179
- * being edited in the CMS, or otherwise not running in a normal player environment.
470
+ * Checks if the gadget is running in preview mode.
471
+ *
472
+ * Preview mode is enabled when the gadget is being edited in the Revel Digital CMS,
473
+ * tested in the gadget editor, or otherwise not running in a normal player environment.
474
+ * This is useful for providing different behavior during development/testing versus
475
+ * production deployment.
476
+ *
477
+ * @returns Promise resolving to true if running in preview mode, false if running on actual player
180
478
  *
181
- * @returns True if the gadget is running in preview mode, false otherwise.
479
+ * ```typescript
480
+ * const isPreview = await this.client.isPreviewMode();
481
+ *
482
+ * if (isPreview) {
483
+ * console.log('Running in preview mode - using mock data');
484
+ * this.loadMockData();
485
+ * } else {
486
+ * console.log('Running on player device - using live data');
487
+ * this.loadLiveData();
488
+ * }
489
+ *
490
+ * // Show different UI in preview
491
+ * this.showPreviewIndicator = isPreview;
492
+ * ```
182
493
  */
183
494
  isPreviewMode(): Promise<boolean>;
184
495
  /**
185
- * Returns the device details associated with the player running the gadget or web app.
186
- *
187
- * @returns Device details.
188
- */
496
+ * Gets detailed information about the device running the player.
497
+ *
498
+ * Returns comprehensive device details including name, registration key, type,
499
+ * service date, language, timezone, tags, and location information. This data
500
+ * is configured in the Revel Digital CMS for each device.
501
+ *
502
+ * @returns Promise resolving to device details object, or null if not available
503
+ *
504
+ * ```typescript
505
+ * const device = await this.client.getDevice();
506
+ *
507
+ * if (device) {
508
+ * console.log('Device name:', device.name);
509
+ * console.log('Device type:', device.deviceType);
510
+ * console.log('Location:', device.location.city, device.location.state);
511
+ * console.log('Tags:', device.tags);
512
+ *
513
+ * // Use device info for customization
514
+ * if (device.location.country === 'US') {
515
+ * this.loadUSContent();
516
+ * }
517
+ *
518
+ * // Check device capabilities based on type
519
+ * if (device.deviceType === 'android') {
520
+ * this.enableTouchFeatures();
521
+ * }
522
+ * }
523
+ * ```
524
+ */
189
525
  getDevice(): Promise<IDevice | null>;
190
526
  /**
191
- * Returns the width of the visualization area.
527
+ * Gets the width of the visualization area in pixels.
528
+ *
529
+ * This returns the available width for content display, which may be
530
+ * different from the full screen width depending on player configuration
531
+ * and template layout.
192
532
  *
193
- * @returns Width of the visualization area
533
+ * @returns Promise resolving to width in pixels, or null if not available
534
+ *
535
+ * ```typescript
536
+ * const width = await this.client.getWidth();
537
+ *
538
+ * if (width) {
539
+ * console.log('Available width:', width, 'pixels');
540
+ *
541
+ * // Adapt content layout based on width
542
+ * if (width < 800) {
543
+ * this.enableMobileLayout();
544
+ * } else {
545
+ * this.enableDesktopLayout();
546
+ * }
547
+ * }
548
+ * ```
194
549
  */
195
550
  getWidth(): Promise<number | null>;
196
551
  /**
197
- * Returns the height of the visualization area.
552
+ * Gets the height of the visualization area in pixels.
553
+ *
554
+ * This returns the available height for content display, which may be
555
+ * different from the full screen height depending on player configuration
556
+ * and template layout.
557
+ *
558
+ * @returns Promise resolving to height in pixels, or null if not available
198
559
  *
199
- * @returns Height of the visualization area
560
+ * ```typescript
561
+ * const height = await this.client.getHeight();
562
+ *
563
+ * if (height) {
564
+ * console.log('Available height:', height, 'pixels');
565
+ *
566
+ * // Calculate aspect ratio for responsive design
567
+ * const width = await this.client.getWidth();
568
+ * const aspectRatio = width / height;
569
+ * this.adjustContentForAspectRatio(aspectRatio);
570
+ * }
571
+ * ```
200
572
  */
201
573
  getHeight(): Promise<number | null>;
202
574
  /**
203
- * Returns the duration of the currently playing source.
204
- * (only applicable when associated with a playlist)
575
+ * Gets the duration of the currently playing content item.
576
+ *
577
+ * This method is only applicable when the gadget is associated with a playlist
578
+ * and returns the duration assigned to the current playlist item. The duration
579
+ * determines how long the content should be displayed before moving to the next item.
580
+ *
581
+ * @returns Promise resolving to duration in milliseconds, or null if not applicable/available
582
+ *
583
+ * ```typescript
584
+ * const duration = await this.client.getDuration();
205
585
  *
206
- * @returns Duration of the current item in milliseconds
586
+ * if (duration) {
587
+ * console.log('Content duration:', duration, 'milliseconds');
588
+ *
589
+ * // Set up auto-finish timer
590
+ * setTimeout(() => {
591
+ * this.client.finish();
592
+ * }, duration);
593
+ *
594
+ * // Show progress indicator
595
+ * this.startProgressIndicator(duration);
596
+ * }
597
+ * ```
207
598
  */
208
599
  getDuration(): Promise<number | null>;
209
600
  /**
210
- * Returns the current SDK version.
601
+ * Gets the current version of the Revel Digital SDK.
211
602
  *
212
- * @returns SDK version
603
+ * @returns Promise resolving to the SDK version string
604
+ *
605
+ * ```typescript
606
+ * const version = await this.client.getSdkVersion();
607
+ * console.log('SDK Version:', version);
608
+ *
609
+ * // Use for compatibility checks or logging
610
+ * this.client.track('gadget_loaded', { sdkVersion: version });
611
+ * ```
213
612
  */
214
613
  getSdkVersion(): Promise<string>;
614
+ /**
615
+ * Applies configuration preferences to the gadget (preview mode only).
616
+ *
617
+ * This method is only available when running in preview mode (typically during
618
+ * gadget development or testing in the CMS). It allows applying configuration
619
+ * changes that would normally come from the gadget's preference settings.
620
+ *
621
+ * @param prefs - Dictionary of preference key-value pairs to apply
622
+ *
623
+ * ```typescript
624
+ * if (await this.client.isPreviewMode()) {
625
+ * // Apply test configuration in preview
626
+ * await this.client.applyConfig({
627
+ * 'title': 'Test Title',
628
+ * 'backgroundColor': '#ff0000',
629
+ * 'showBorder': true,
630
+ * 'refreshInterval': 30
631
+ * });
632
+ * }
633
+ * ```
634
+ */
215
635
  applyConfig(prefs: IDictionary<any>): Promise<void>;
216
636
  /** @ignore */
217
637
  private getClient;