@reveldigital/player-client 1.0.15 → 2.0.2

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 (58) hide show
  1. package/README.md +236 -236
  2. package/esm2022/lib/app-init.service.mjs +113 -0
  3. package/esm2022/lib/interfaces/client.interface.mjs +2 -0
  4. package/esm2022/lib/interfaces/command.interface.mjs +2 -0
  5. package/esm2022/lib/interfaces/config.interface.mjs +50 -0
  6. package/esm2022/lib/interfaces/device.interface.mjs +2 -0
  7. package/esm2022/lib/interfaces/event-properties.interface.mjs +2 -0
  8. package/esm2022/lib/interfaces/location.interface.mjs +2 -0
  9. package/esm2022/lib/player-client.module.mjs +71 -0
  10. package/esm2022/lib/player-client.service.mjs +928 -0
  11. package/esm2022/lib/safe-style.pipe.mjs +41 -0
  12. package/{esm2020 → esm2022}/lib/version.mjs +3 -3
  13. package/{esm2020 → esm2022}/public-api.mjs +6 -6
  14. package/{esm2020 → esm2022}/reveldigital-player-client.mjs +4 -4
  15. package/{fesm2020 → fesm2022}/reveldigital-player-client.mjs +1132 -1134
  16. package/fesm2022/reveldigital-player-client.mjs.map +1 -0
  17. package/{reveldigital-player-client.d.ts → index.d.ts} +5 -5
  18. package/lib/app-init.service.d.ts +18 -18
  19. package/lib/app-init.service.d.ts.map +1 -1
  20. package/lib/interfaces/client.interface.d.ts +406 -406
  21. package/lib/interfaces/command.interface.d.ts +78 -78
  22. package/lib/interfaces/config.interface.d.ts +151 -151
  23. package/lib/interfaces/device.interface.d.ts +139 -139
  24. package/lib/interfaces/event-properties.interface.d.ts +134 -134
  25. package/lib/interfaces/location.interface.d.ts +187 -187
  26. package/lib/player-client.module.d.ts +9 -9
  27. package/lib/player-client.service.d.ts +640 -640
  28. package/lib/safe-style.pipe.d.ts +23 -23
  29. package/lib/safe-style.pipe.d.ts.map +1 -1
  30. package/lib/version.d.ts +1 -1
  31. package/lib/version.d.ts.map +1 -1
  32. package/package.json +12 -18
  33. package/public-api.d.ts +3 -3
  34. package/schematics/collection.json +15 -15
  35. package/schematics/ng-add/assets/gadget.yaml +54 -54
  36. package/schematics/ng-add/index.d.ts +18 -4
  37. package/schematics/ng-add/index.js +391 -287
  38. package/schematics/ng-add/index.js.map +1 -1
  39. package/schematics/ng-add/schema.d.ts +4 -4
  40. package/schematics/ng-add/schema.js +2 -2
  41. package/schematics/ng-add/schema.json +23 -23
  42. package/schematics/ng-add/templates/index.html +30 -30
  43. package/schematics/ng-add/templates/polyfills.ts +72 -72
  44. package/schematics/ng-add/utils/changeBasePath.js +19 -19
  45. package/schematics/ng-add/utils/yml2xml.js +132 -132
  46. package/esm2020/lib/app-init.service.mjs +0 -110
  47. package/esm2020/lib/interfaces/client.interface.mjs +0 -2
  48. package/esm2020/lib/interfaces/command.interface.mjs +0 -2
  49. package/esm2020/lib/interfaces/config.interface.mjs +0 -50
  50. package/esm2020/lib/interfaces/device.interface.mjs +0 -2
  51. package/esm2020/lib/interfaces/event-properties.interface.mjs +0 -2
  52. package/esm2020/lib/interfaces/location.interface.mjs +0 -2
  53. package/esm2020/lib/player-client.module.mjs +0 -73
  54. package/esm2020/lib/player-client.service.mjs +0 -928
  55. package/esm2020/lib/safe-style.pipe.mjs +0 -40
  56. package/fesm2015/reveldigital-player-client.mjs +0 -1219
  57. package/fesm2015/reveldigital-player-client.mjs.map +0 -1
  58. package/fesm2020/reveldigital-player-client.mjs.map +0 -1
@@ -1,407 +1,407 @@
1
- import { IDictionary } from "./config.interface";
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
- */
35
- export interface IClient {
36
- /**
37
- * Sends a callback to the player with optional arguments.
38
- *
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
- * ```
55
- */
56
- callback(...args: any[]): void;
57
- /**
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
66
- *
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
- * ```
75
- */
76
- getDeviceTime(date?: Date): Promise<string | null>;
77
- /**
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")
84
- *
85
- * ```typescript
86
- * const timezoneName = await client.getDeviceTimeZoneName();
87
- * console.log(`Device timezone: ${timezoneName}`);
88
- * ```
89
- */
90
- getDeviceTimeZoneName(): Promise<string | null>;
91
- /**
92
- * Gets the timezone identifier currently assigned to the device.
93
- *
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
- * ```
103
- */
104
- getDeviceTimeZoneID(): Promise<string | null>;
105
- /**
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.
111
- *
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
- * ```
118
- */
119
- getDeviceTimeZoneOffset(): Promise<number | null>;
120
- /**
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")
127
- *
128
- * ```typescript
129
- * const langCode = await client.getLanguageCode();
130
- * if (langCode === 'fr-FR') {
131
- * this.loadFrenchContent();
132
- * }
133
- * ```
134
- */
135
- getLanguageCode(): Promise<string | null>;
136
- /**
137
- * Gets the unique device key (registration key) for this player device.
138
- *
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
- * ```
150
- */
151
- getDeviceKey(): Promise<string | null>;
152
- /**
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.
157
- *
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
- * ```
169
- */
170
- sendCommand(name: string, arg: string): void;
171
- /**
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.
177
- *
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
- * ```
190
- */
191
- sendRemoteCommand(deviceKeys: string[], name: string, arg: string): void;
192
- /**
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.
198
- *
199
- * @param eventName - Unique identifier for the event
200
- * @param properties - Optional JSON string containing event properties and metadata
201
- *
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
- * ```
214
- */
215
- track(eventName: string, properties?: string): void;
216
- /**
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
224
- *
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
- * ```
232
- */
233
- timeEvent(eventName: string): void;
234
- /**
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', '');
247
- *
248
- * // Start session with custom ID
249
- * client.newEventSession('user-123-workflow');
250
- * client.track('workflow_begin', '');
251
- * ```
252
- */
253
- newEventSession(id?: string): void;
254
- /**
255
- * Gets the root directory path where the Revel Digital system stores files.
256
- *
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
- * ```
267
- */
268
- getRevelRoot(): Promise<string | null>;
269
- /**
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.
274
- *
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
- * ```
284
- */
285
- getCommandMap(): Promise<string | null>;
286
- /**
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
- * ```
305
- */
306
- finish(): void;
307
- /**
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
314
- *
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
- * ```
321
- */
322
- getDevice(): Promise<string | null>;
323
- /**
324
- * Gets the width of the available visualization area in pixels.
325
- *
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
- * ```
337
- */
338
- getWidth(): Promise<number | null>;
339
- /**
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.
344
- *
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
- * ```
353
- */
354
- getHeight(): Promise<number | null>;
355
- /**
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
363
- *
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
- * ```
371
- */
372
- getDuration(): Promise<number | null>;
373
- /**
374
- * Gets the version of the Revel Digital SDK.
375
- *
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
- * ```
384
- */
385
- getSdkVersion(): Promise<string | null>;
386
- /**
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.
393
- *
394
- * @param prefs - Dictionary of preference key-value pairs to apply
395
- *
396
- * ```typescript
397
- * // Apply configuration changes in design mode
398
- * client.applyConfig({
399
- * 'title': 'Updated Title',
400
- * 'backgroundColor': '#ff0000',
401
- * 'autoRefresh': true
402
- * });
403
- * ```
404
- */
405
- applyConfig(prefs: IDictionary<any>): void;
406
- }
1
+ import { IDictionary } from "./config.interface";
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
+ */
35
+ export interface IClient {
36
+ /**
37
+ * Sends a callback to the player with optional arguments.
38
+ *
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
+ * ```
55
+ */
56
+ callback(...args: any[]): void;
57
+ /**
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
66
+ *
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
+ * ```
75
+ */
76
+ getDeviceTime(date?: Date): Promise<string | null>;
77
+ /**
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")
84
+ *
85
+ * ```typescript
86
+ * const timezoneName = await client.getDeviceTimeZoneName();
87
+ * console.log(`Device timezone: ${timezoneName}`);
88
+ * ```
89
+ */
90
+ getDeviceTimeZoneName(): Promise<string | null>;
91
+ /**
92
+ * Gets the timezone identifier currently assigned to the device.
93
+ *
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
+ * ```
103
+ */
104
+ getDeviceTimeZoneID(): Promise<string | null>;
105
+ /**
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.
111
+ *
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
+ * ```
118
+ */
119
+ getDeviceTimeZoneOffset(): Promise<number | null>;
120
+ /**
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")
127
+ *
128
+ * ```typescript
129
+ * const langCode = await client.getLanguageCode();
130
+ * if (langCode === 'fr-FR') {
131
+ * this.loadFrenchContent();
132
+ * }
133
+ * ```
134
+ */
135
+ getLanguageCode(): Promise<string | null>;
136
+ /**
137
+ * Gets the unique device key (registration key) for this player device.
138
+ *
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
+ * ```
150
+ */
151
+ getDeviceKey(): Promise<string | null>;
152
+ /**
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.
157
+ *
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
+ * ```
169
+ */
170
+ sendCommand(name: string, arg: string): void;
171
+ /**
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.
177
+ *
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
+ * ```
190
+ */
191
+ sendRemoteCommand(deviceKeys: string[], name: string, arg: string): void;
192
+ /**
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.
198
+ *
199
+ * @param eventName - Unique identifier for the event
200
+ * @param properties - Optional JSON string containing event properties and metadata
201
+ *
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
+ * ```
214
+ */
215
+ track(eventName: string, properties?: string): void;
216
+ /**
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
224
+ *
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
+ * ```
232
+ */
233
+ timeEvent(eventName: string): void;
234
+ /**
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', '');
247
+ *
248
+ * // Start session with custom ID
249
+ * client.newEventSession('user-123-workflow');
250
+ * client.track('workflow_begin', '');
251
+ * ```
252
+ */
253
+ newEventSession(id?: string): void;
254
+ /**
255
+ * Gets the root directory path where the Revel Digital system stores files.
256
+ *
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
+ * ```
267
+ */
268
+ getRevelRoot(): Promise<string | null>;
269
+ /**
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.
274
+ *
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
+ * ```
284
+ */
285
+ getCommandMap(): Promise<string | null>;
286
+ /**
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
+ * ```
305
+ */
306
+ finish(): void;
307
+ /**
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
314
+ *
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
+ * ```
321
+ */
322
+ getDevice(): Promise<string | null>;
323
+ /**
324
+ * Gets the width of the available visualization area in pixels.
325
+ *
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
+ * ```
337
+ */
338
+ getWidth(): Promise<number | null>;
339
+ /**
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.
344
+ *
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
+ * ```
353
+ */
354
+ getHeight(): Promise<number | null>;
355
+ /**
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
363
+ *
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
+ * ```
371
+ */
372
+ getDuration(): Promise<number | null>;
373
+ /**
374
+ * Gets the version of the Revel Digital SDK.
375
+ *
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
+ * ```
384
+ */
385
+ getSdkVersion(): Promise<string | null>;
386
+ /**
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.
393
+ *
394
+ * @param prefs - Dictionary of preference key-value pairs to apply
395
+ *
396
+ * ```typescript
397
+ * // Apply configuration changes in design mode
398
+ * client.applyConfig({
399
+ * 'title': 'Updated Title',
400
+ * 'backgroundColor': '#ff0000',
401
+ * 'autoRefresh': true
402
+ * });
403
+ * ```
404
+ */
405
+ applyConfig(prefs: IDictionary<any>): void;
406
+ }
407
407
  //# sourceMappingURL=client.interface.d.ts.map