@vizbeetv/sdk 7.8.46 → 7.8.52

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.
package/types/index.d.ts CHANGED
@@ -1,28 +1,46 @@
1
1
  // ---------------------------------------------------------------------------
2
- // Vizbee TV SDK — TypeScript type declarations
2
+ // Vizbee TV SDK — shared type building blocks
3
3
  // ---------------------------------------------------------------------------
4
4
  //
5
- // Hybrid surface:
6
- // • The session / presence / messaging MODEL types below are RE-EXPORTED from
7
- // declarations auto-generated off the TypeScript source (tsconfig.npm-types.json),
8
- // so they never drift from the implementation.
9
- // • The rest — the default-export `VizbeeSDK` API and its `continuity` tree
10
- // (adapters, messages, context, UI, analytics, interceptors) — is plain JS
11
- // in the SDK, has no TS source, and is therefore hand-maintained here.
5
+ // Consumer usage:
6
+ // import type { VideoInfo, VideoStatus, AdStatus } from '@vizbeetv/sdk'; // shared types
7
+ // import type { PlayerAdapter, AdAdapter } from '@vizbeetv/sdk'; // extendable adapters
8
+ // import { AdEventType, PlayerState, PlayerType } from '@vizbeetv/sdk'; // runtime constants
12
9
  //
13
- // Named exports are intended for type annotations. Runtime values are reached
14
- // through the default export / `window.VizbeeSDK` (e.g.
15
- // `vizbee.continuity.adapters.PlayerAdapter`), not via value imports.
10
+ // import vizbee from '@vizbeetv/sdk/lg'; // platform SDK + full types
11
+ // import type { AVPlayerAdapter } from '@vizbeetv/sdk/samsung'; // platform-specific type only
12
+ //
13
+ // This file is the types entry for the root '@vizbeetv/sdk' subpath. All
14
+ // platform-specific files (samsung.d.ts, lg.d.ts, xbox.d.ts, vizio.d.ts,
15
+ // chromecast-v2.d.ts) re-export everything from here and add the
16
+ // platform-correct VizbeeSDK shape + default export.
17
+ //
18
+ // Type design:
19
+ // • Constructable types (VideoInfo, PlayerAdapter, etc.) are declared as
20
+ // interfaces. Interfaces are erased at compile time — they carry no
21
+ // runtime value, so `import { VideoInfo }` is always a type-only import
22
+ // and `new VideoInfo()` is a compile error. Constructors are only
23
+ // accessible via the framework maps (vizbee.continuity.messages.VideoInfo).
24
+ //
25
+ // • ContinuityContext is declared as an abstract class because it exposes
26
+ // a static getInstance() method — interfaces cannot have static members.
27
+ // `abstract` prevents `new ContinuityContext()` while still allowing
28
+ // static access via `typeof ContinuityContext`.
29
+ //
30
+ // • Static-only enum classes (PlayerState, PlayerType, etc.) are declared
31
+ // as concrete classes with readonly static properties. Consumers only
32
+ // ever access e.g. PlayerState.PLAYING — they never construct them.
33
+ //
34
+ // Session / presence / messaging model types are RE-EXPORTED from
35
+ // declarations auto-generated off the TypeScript source
36
+ // (tsconfig.npm-types.json) so they never drift from the implementation.
16
37
  // ---------------------------------------------------------------------------
17
38
 
18
39
  // ========================
19
- // Models & Enums (auto-generated from TS source — do not redeclare here)
40
+ // Models & Enums (auto-generated — do not redeclare here)
20
41
  // ========================
21
42
 
22
- import {
23
- SessionState,
24
- SessionStateUtils,
25
- } from './vtvsdk/src/core/session/SessionState.js';
43
+ import { SessionState, SessionStateUtils } from './vtvsdk/src/core/session/SessionState.js';
26
44
  import { SessionStateListener } from './vtvsdk/src/core/session/SessionStateListener.js';
27
45
  import { MemberInfo } from './vtvsdk/src/core/session/models/MemberInfo.js';
28
46
  import { MemberType, MemberTypeInfo } from './vtvsdk/src/core/session/models/MemberType.js';
@@ -56,11 +74,63 @@ export {
56
74
  VizbeePresenceManager,
57
75
  };
58
76
 
77
+ // ========================
78
+ // Enum value union types
79
+ //
80
+ // Use these in your own function signatures for compile-time narrowing
81
+ // (e.g. switch statements) instead of raw `string`.
82
+ // ========================
83
+
84
+ export type PlayerType =
85
+ | 'unknown'
86
+ | 'html'
87
+ | 'avplayer'
88
+ | 'bitmovin'
89
+ | 'videojs'
90
+ | 'theo'
91
+ | 'shaka';
92
+
93
+ export type AdType = 'unknown' | 'ssai' | 'csai';
94
+
95
+ export type VideoStopReason =
96
+ | 'stop_reason_unknown'
97
+ | 'stop_by_user'
98
+ | 'stop_implicit'
99
+ | 'stop_reason_before_next_video';
100
+
101
+ export type PlayerState =
102
+ | 'idle'
103
+ | 'preparing'
104
+ | 'loading'
105
+ | 'started'
106
+ | 'playing'
107
+ | 'paused'
108
+ | 'buffering'
109
+ | 'interrupted'
110
+ | 'ended'
111
+ | 'error';
112
+
113
+ export type AdEventType =
114
+ | 'awaiting-ad-pod'
115
+ | 'ad-pod-start'
116
+ | 'ad-preparing'
117
+ | 'ad-start'
118
+ | 'ad-playing'
119
+ | 'ad-paused'
120
+ | 'ad-end'
121
+ | 'ad-pod-end'
122
+ | 'ad-error';
123
+
124
+ export type AdProgressEventType = 'first-quartile' | 'mid-point' | 'third-quartile' | 'complete';
125
+
59
126
  // ========================
60
127
  // Messages
128
+ //
129
+ // Declared as interfaces — compile-time types only.
130
+ // Construct instances via: vizbee.continuity.messages.VideoInfo (etc.)
61
131
  // ========================
62
132
 
63
- export declare class Track {
133
+ export interface Track {
64
134
  type: string;
65
135
  id: number;
66
136
 
@@ -68,7 +138,7 @@ export declare class Track {
68
138
  fromJSON(trackInfo: Record<string, unknown>): void;
69
139
  }
70
140
 
71
- export declare class SubtitleTrack extends Track {
141
+ export interface SubtitleTrack extends Track {
72
142
  lang: string;
73
143
  subtype: string;
74
144
 
@@ -76,189 +146,203 @@ export declare class SubtitleTrack extends Track {
76
146
  fromJSON(trackInfo: Record<string, unknown>): void;
77
147
  }
78
148
 
79
- export declare class VideoInfo {
149
+ export interface VideoInfo {
80
150
  guid: string;
81
- isLive: boolean;
82
- startTime: number;
83
- videoUrl: string;
84
- deeplink: string;
85
- imgUrl: string;
86
- title: string;
87
- subtitle: string;
88
- desc: string;
89
- tracks: Track[];
90
- cuepoints: number[];
91
- customStreamInfo: unknown;
92
- customMetadata: unknown;
93
-
94
- toJson(): Record<string, unknown>;
95
- fromJson(syncVideoInfo: Record<string, unknown>): void;
96
- }
97
-
98
- export declare class VideoStatus {
151
+ isLive?: boolean;
152
+ isDvrSupported?: boolean;
153
+ startTime?: number;
154
+ videoUrl?: string;
155
+ deeplink?: string;
156
+ imgUrl?: string;
157
+ title?: string;
158
+ subtitle?: string;
159
+ desc?: string;
160
+ tracks?: Track[];
161
+ customStreamInfo?: Record<string, unknown>;
162
+ customMetadata?: Record<string, unknown>;
163
+ }
164
+
165
+ export interface VideoStatus {
99
166
  guid: string;
100
- state: string;
167
+ state: PlayerState;
101
168
  currentPosition: number;
102
169
  duration: number;
103
170
  isLive: boolean;
104
- isDvrSupported: boolean;
105
- title: string;
106
- subtitle: string;
107
- videoUrl: string;
108
- imgUrl: string;
171
+ isDvrSupported?: boolean;
172
+ title?: string;
173
+ subtitle?: string;
174
+ videoUrl?: string;
175
+ imgUrl?: string;
176
+ availableTracks?: Track[];
177
+ enabledTracks?: Track[];
109
178
  }
110
179
 
111
- export declare class VizbeeEvent {
112
- type: string;
113
- data: unknown;
180
+ export interface AdPodWaitingStatus {
181
+ eventType: 'awaiting-ad-pod';
114
182
  }
115
-
116
- export declare class AdStatus {
117
- eventType: string;
118
- eventData: Record<string, unknown>;
119
-
120
- constructor(eventType: string, eventData: Record<string, unknown>);
183
+ export interface AdPodStartStatus {
184
+ eventType: 'ad-pod-start';
121
185
  }
122
-
123
- export declare class PlayerState {
124
- static readonly IDLE: string;
125
- static readonly PREPARING: string;
126
- static readonly LOADING: string;
127
- static readonly STARTED: string;
128
- static readonly PLAYING: string;
129
- static readonly PAUSED: string;
130
- static readonly BUFFERING: string;
131
- static readonly INTERRUPTED: string;
132
- static readonly ENDED: string;
133
- static readonly ERROR: string;
186
+ export interface AdPreparingStatus {
187
+ eventType: 'ad-preparing';
188
+ adId?: string;
134
189
  }
135
-
136
- export declare class AdEventType {
137
- static readonly AD_POD_WAITING: string;
138
- static readonly AD_POD_START: string;
139
- static readonly AD_PREPARING: string;
140
- static readonly AD_START: string;
141
- static readonly AD_PLAYING: string;
142
- static readonly AD_PAUSED: string;
143
- static readonly AD_END: string;
144
- static readonly AD_POD_END: string;
145
- static readonly AD_ERROR: string;
190
+ export interface AdStartStatus {
191
+ eventType: 'ad-start';
192
+ adId?: string;
193
+ duration: number;
194
+ }
195
+ export interface AdPlayingStatus {
196
+ eventType: 'ad-playing';
197
+ adId?: string;
198
+ position: number;
199
+ duration: number;
200
+ adProgressEventType?: AdProgressEventType;
201
+ }
202
+ export interface AdPausedStatus {
203
+ eventType: 'ad-paused';
204
+ adId?: string;
205
+ position: number;
206
+ duration: number;
207
+ }
208
+ export interface AdEndStatus {
209
+ eventType: 'ad-end';
210
+ adId?: string;
211
+ }
212
+ export interface AdPodEndStatus {
213
+ eventType: 'ad-pod-end';
214
+ }
215
+ export interface AdErrorStatus {
216
+ eventType: 'ad-error';
217
+ error?: unknown;
218
+ }
219
+
220
+ export type AdStatus =
221
+ | AdPodWaitingStatus
222
+ | AdPodStartStatus
223
+ | AdPreparingStatus
224
+ | AdStartStatus
225
+ | AdPlayingStatus
226
+ | AdPausedStatus
227
+ | AdEndStatus
228
+ | AdPodEndStatus
229
+ | AdErrorStatus;
230
+
231
+ // Namespaces merged with the string union types above — consumers access e.g. PlayerState.PLAYING.
232
+
233
+ export declare namespace PlayerState {
234
+ const IDLE: 'idle';
235
+ const PREPARING: 'preparing';
236
+ const LOADING: 'loading';
237
+ const STARTED: 'started';
238
+ const PLAYING: 'playing';
239
+ const PAUSED: 'paused';
240
+ const BUFFERING: 'buffering';
241
+ const INTERRUPTED: 'interrupted';
242
+ const ENDED: 'ended';
243
+ const ERROR: 'error';
244
+ }
245
+
246
+ export declare namespace AdEventType {
247
+ const AD_POD_WAITING: 'awaiting-ad-pod';
248
+ const AD_POD_START: 'ad-pod-start';
249
+ const AD_PREPARING: 'ad-preparing';
250
+ const AD_START: 'ad-start';
251
+ const AD_PLAYING: 'ad-playing';
252
+ const AD_PAUSED: 'ad-paused';
253
+ const AD_END: 'ad-end';
254
+ const AD_POD_END: 'ad-pod-end';
255
+ const AD_ERROR: 'ad-error';
146
256
  }
147
257
 
148
258
  // ========================
149
259
  // Adapters
260
+ //
261
+ // Declared as interfaces — compile-time types only.
262
+ // Construct instances via: vizbee.continuity.adapters.PlayerAdapter (etc.)
263
+ //
264
+ // Hierarchy:
265
+ // AdAdapter — base contract; host app calls updateAdStatus() to push ad events
266
+ // HTMLAdAdapter — extends AdAdapter; adds playerElement for HTML-based ad overlays
267
+ //
268
+ // NOTE: AVPlayerAdapter is Samsung Tizen-specific — see samsung.d.ts.
150
269
  // ========================
151
270
 
152
- export declare class AppAdapter {
153
- deeplinkHandler?: (videoInfo: VideoInfo) => void;
154
- vizbeeEventHandler?: (event: VizbeeEvent) => void;
155
- vizbeeSigninEventHandler?: (event: VizbeeEvent) => void;
156
-
271
+ export interface AppAdapter {
157
272
  setDeeplinkHandler(handler: (videoInfo: VideoInfo) => void): void;
158
- setVizbeeEventHandler(handler: (event: VizbeeEvent) => void): void;
159
- /** @deprecated since 7.5 — use setVizbeeEventHandler instead */
160
- setSignInHandler(handler: (event: VizbeeEvent) => void): void;
161
- /** @deprecated since 7.5 — use setVizbeeEventHandler instead */
162
- setVizbeeSigninEventHandler(handler: (event: VizbeeEvent) => void): void;
163
- }
164
-
165
- export declare class BasePlayerAdapter {
166
- playHandler?: () => void;
167
- pauseHandler?: () => void;
168
- seekHandler?: (timeInMs: number) => void;
169
- stopHandler?: (stopReason?: string) => void;
170
- videoInfoGetter?: () => VideoStatus | undefined;
171
- availableTracksGetter?: () => Track[];
172
- enabledTracksGetter?: () => Track[];
173
- enableTracksHandler?: (trackIds: number[]) => void;
174
- disableTracksHandler?: (trackIds: number[]) => void;
175
- vizbeeEventHandler?: (event: VizbeeEvent) => void;
273
+ }
176
274
 
275
+ export declare class PlayerAdapter {
177
276
  updateVideoInfo(videoInfo: VideoInfo): void;
178
- setVideoInfoGetter(getter: () => VideoStatus | undefined): void;
179
- getVideoInfo(): VideoStatus | undefined;
180
277
  updateVideoStatus(videoStatus: VideoStatus): void;
278
+ getVideoInfo(): VideoStatus | undefined;
279
+ setVideoInfoGetter(videoStatusGetter: () => VideoStatus | undefined): void;
181
280
  setPlayHandler(handler: () => void): void;
182
281
  setPauseHandler(handler: () => void): void;
183
282
  setSeekHandler(handler: (timeInMs: number) => void): void;
184
- setStopHandler(handler: (stopReason?: string) => void): void;
185
- setAvailableTracksGetter(getter: () => Track[]): void;
186
- setEnabledTracksGetter(getter: () => Track[]): void;
283
+ setStopHandler(handler: (stopReason?: VideoStopReason) => void): void;
187
284
  setEnableTracksHandler(handler: (trackIds: number[]) => void): void;
188
285
  setDisableTracksHandler(handler: (trackIds: number[]) => void): void;
189
- setVizbeeEventHandler(handler: (event: VizbeeEvent) => void): void;
190
286
  }
191
287
 
192
- export declare class PlayerAdapter extends BasePlayerAdapter {
193
- playerType: string;
288
+ export interface HTMLPlayerAdapter extends PlayerAdapter {
289
+ playerType: 'html';
194
290
  playerElement: HTMLElement;
195
-
196
- constructor(playerType: string, playerElement: HTMLElement);
197
-
198
- /** @deprecated since 7.5 — pass playerType in constructor */
199
- setPlayerType(playerType: string): void;
200
- /** @deprecated since 7.5 — pass playerElement in constructor */
201
- setPlayerElement(playerElement: HTMLElement): void;
202
- /** @deprecated since 7.5 — use setAvailableTracksGetter */
203
- getTracksHandler(handler: () => Track[]): void;
204
- /** @deprecated since 7.5 — use setEnabledTracksGetter */
205
- getEnabledTracksHandler(handler: () => Track[]): void;
206
- setCustomAttributesForMetrics(attributes: Record<string, unknown>): void;
207
291
  }
208
292
 
209
- export declare class AVPlayerAdapter extends PlayerAdapter {
210
- constructor();
211
-
212
- wrapListener(listener: Record<string, Function>): Record<string, Function>;
213
- getListener(): Record<string, Function> | undefined;
293
+ /** Base contract — host app calls updateAdStatus() to push ad events to the SDK. */
294
+ export declare class AdAdapter {
295
+ updateAdStatus(adStatus: AdStatus): void;
214
296
  }
215
297
 
216
- export declare class AdAdapter {
217
- adType: string;
298
+ /** HTML-specific implementation — knows its ad type and owns a DOM element for the ad overlay. */
299
+ export interface HTMLAdAdapter extends AdAdapter {
300
+ adType: AdType;
218
301
  playerElement: HTMLElement;
219
-
220
- constructor(adType: string, playerElement: HTMLElement);
221
-
222
- updateAdStatus(adStatus: AdStatus): void;
223
302
  }
224
303
 
225
- export declare class PlayerType {
226
- static readonly UNKNOWN: string;
227
- static readonly HTML: string;
228
- static readonly AVPLAYER: string;
229
- static readonly BITMOVIN: string;
230
- static readonly VIDEOJS: string;
231
- static readonly THEO: string;
232
- static readonly SHAKA: string;
304
+ export declare namespace PlayerType {
305
+ const UNKNOWN: 'unknown';
306
+ const HTML: 'html';
307
+ const AVPLAYER: 'avplayer';
308
+ const BITMOVIN: 'bitmovin';
309
+ const VIDEOJS: 'videojs';
310
+ const THEO: 'theo';
311
+ const SHAKA: 'shaka';
233
312
  }
234
313
 
235
- export declare class AdType {
236
- static readonly UNKNOWN: string;
237
- static readonly SSAI: string;
238
- static readonly CSAI: string;
314
+ export declare namespace AdType {
315
+ const UNKNOWN: 'unknown';
316
+ const SSAI: 'ssai';
317
+ const CSAI: 'csai';
239
318
  }
240
319
 
241
- export declare class VideoStopReason {
242
- static readonly STOP_REASON_UNKNOWN: string;
243
- static readonly STOP_BY_USER: string;
244
- static readonly STOP_IMPLICIT: string;
245
- static readonly STOP_REASON_BEFORE_NEXT_VIDEO: string;
320
+ export declare namespace VideoStopReason {
321
+ const STOP_REASON_UNKNOWN: 'stop_reason_unknown';
322
+ const STOP_BY_USER: 'stop_by_user';
323
+ const STOP_IMPLICIT: 'stop_implicit';
324
+ const STOP_REASON_BEFORE_NEXT_VIDEO: 'stop_reason_before_next_video';
246
325
  }
247
326
 
248
327
  // ========================
249
328
  // Options
250
329
  // ========================
251
330
 
252
- export declare class ContinuityOptions {
331
+ export interface ContinuityOptions {
253
332
  configServiceProxyHost: string | undefined;
254
333
  customAttributesForMetrics: Record<string, unknown> | undefined;
255
334
  }
256
335
 
257
336
  // ========================
258
337
  // Context
338
+ //
339
+ // Declared as abstract class so that `typeof ContinuityContext` exposes the
340
+ // static getInstance() method via the framework map, while preventing
341
+ // `new ContinuityContext()` from a named import (consumers must call
342
+ // vizbee.continuity.ContinuityContext.getInstance()).
259
343
  // ========================
260
344
 
261
- export declare class ContinuityContext {
345
+ export declare abstract class ContinuityContext {
262
346
  static getInstance(): ContinuityContext;
263
347
 
264
348
  start(appId: string): void;
@@ -270,28 +354,32 @@ export declare class ContinuityContext {
270
354
  getPlayerAdapter(): PlayerAdapter | undefined;
271
355
  setPlayerAdapter(playerAdapter: PlayerAdapter): boolean;
272
356
  removePlayerAdapter(playerAdapter: PlayerAdapter): boolean;
357
+ /** Shorthand for setPlayerAdapter() + setVideoInfo() in one call. */
273
358
  setPlayerAdapterWithVideoInfo(playerAdapter: PlayerAdapter, videoInfo: VideoInfo): boolean;
274
359
 
275
- setVideoInfo(videoInfo: VideoInfo): boolean;
276
- getVideoInfo(): VideoStatus | undefined;
277
-
278
360
  getAdAdapter(adAdapterType?: string): AdAdapter | undefined;
279
- setAdAdapter(adAdapter: AdAdapter): void | false;
361
+ setAdAdapter(adAdapter: AdAdapter): boolean;
280
362
  removeAdAdapter(adAdapter: AdAdapter): void;
281
- setAdType(adType: string): void;
282
363
 
283
- stopVideo(): void;
364
+ /** Element-less mode only. Push a player state change immediately — must be called for every state transition; the SDK does not poll state. */
365
+ notifyPlayerState(playerState: string): void;
284
366
  }
285
367
 
286
368
  // ========================
287
369
  // Analytics
288
370
  // ========================
289
371
 
290
- export declare class AnalyticsProvider {
372
+ export interface AttributesProvider {
373
+ getAttributes(): Promise<Record<string, unknown>>;
374
+ }
375
+
376
+ export interface AnalyticsProvider {
291
377
  wasAppLaunchedByVizbee(): boolean;
292
378
  wasVideoStartedByVizbee(): boolean;
293
- addProvider(attributesProvider: unknown, filterRegEx?: RegExp): void;
294
- removeProvider(attributesProvider: unknown): void;
379
+
380
+ addProvider(attributesProvider: AttributesProvider, filterRegEx?: RegExp): void;
381
+ removeProvider(attributesProvider: AttributesProvider): void;
382
+
295
383
  logMetrics(eventName: string, properties?: Record<string, unknown>): void;
296
384
  setCustomAttributes(customAttributes: Record<string, unknown>): void;
297
385
  }
@@ -301,10 +389,10 @@ export declare class AnalyticsProvider {
301
389
  // ========================
302
390
 
303
391
  export interface LayoutPositionMap {
304
- TOP_LEFT: string;
305
- TOP_RIGHT: string;
306
- BOTTOM_LEFT: string;
307
- BOTTOM_RIGHT: string;
392
+ TOP_LEFT: 'top-left';
393
+ TOP_RIGHT: 'top-right';
394
+ BOTTOM_LEFT: 'bottom-left';
395
+ BOTTOM_RIGHT: 'bottom-right';
308
396
  }
309
397
 
310
398
  export interface SnackbarTheme {
@@ -323,7 +411,8 @@ export interface SnackbarBorder {
323
411
  export interface SnackbarFont {
324
412
  uri?: string;
325
413
  family?: string;
326
- size?: string;
414
+ /** Font size — the SDK initialises this as a number (pixels) but accepts a string override. */
415
+ size?: string | number;
327
416
  weight?: string;
328
417
  }
329
418
 
@@ -331,7 +420,7 @@ export interface SnackbarIcon {
331
420
  uri?: string;
332
421
  }
333
422
 
334
- export declare class SnackbarUIConfig {
423
+ export interface SnackbarUIConfig {
335
424
  message: string;
336
425
  theme: SnackbarTheme;
337
426
  layout: SnackbarLayout;
@@ -343,56 +432,85 @@ export declare class SnackbarUIConfig {
343
432
  toJSON(): Record<string, unknown>;
344
433
  }
345
434
 
346
- export declare class Snackbar {
347
- constructor(uiConfig: SnackbarUIConfig);
348
-
435
+ export interface Snackbar {
436
+ /**
437
+ * Show the snackbar for `ttlInSec` seconds (default 8).
438
+ * Pass -1 to keep it visible until hide() is called.
439
+ */
349
440
  show(ttlInSec?: number): void;
350
441
  hide(): void;
351
442
  }
352
443
 
353
444
  // ========================
354
- // Interceptors (Chromecast CAF)
445
+ // Interceptors (Chromecast CAF only)
355
446
  // ========================
356
447
 
357
- export declare class LoadRequestInterceptor {
358
- constructor(adaptLoadRequest: (loadRequest: unknown) => unknown);
359
-
448
+ export interface LoadRequestInterceptor {
360
449
  update(loadRequest: unknown): unknown;
361
450
  }
362
451
 
363
452
  // ========================
364
- // ContinuityFramework
453
+ // Framework maps
454
+ //
455
+ // Constructor signatures use `{ new(...): T }` so TypeScript allows
456
+ // `new vizbee.continuity.messages.VideoInfo()` while the named export
457
+ // `VideoInfo` (an interface) cannot be constructed directly.
365
458
  // ========================
366
459
 
460
+ /**
461
+ * Base adapters map — available on all platforms.
462
+ * Samsung Tizen adds AVPlayerAdapter via SamsungAdaptersMap in samsung.d.ts.
463
+ */
367
464
  export interface AdaptersMap {
368
- AppAdapter: typeof AppAdapter;
465
+ AppAdapter: { new (): AppAdapter };
466
+
369
467
  PlayerAdapter: typeof PlayerAdapter;
370
- BasePlayerAdapter: typeof BasePlayerAdapter;
371
- AVPlayerAdapter: typeof AVPlayerAdapter;
468
+ HTMLPlayerAdapter: {
469
+ new (playerElement: HTMLElement): HTMLPlayerAdapter;
470
+ };
372
471
  PlayerType: typeof PlayerType;
472
+
373
473
  AdAdapter: typeof AdAdapter;
474
+ HTMLAdAdapter: { new (adType: AdType, playerElement: HTMLElement): HTMLAdAdapter };
374
475
  AdType: typeof AdType;
476
+
375
477
  VideoStopReason: typeof VideoStopReason;
376
478
  }
377
479
 
378
480
  export interface MessagesMap {
379
- VizbeeEvent: typeof VizbeeEvent;
380
- VideoInfo: typeof VideoInfo;
381
- VideoStatus: typeof VideoStatus;
481
+ VideoInfo: { new (): VideoInfo };
482
+
483
+ VideoStatus: { new (): VideoStatus };
484
+
382
485
  AdEventType: typeof AdEventType;
383
- AdStatus: typeof AdStatus;
486
+ AdStatus: {
487
+ new (eventType: 'awaiting-ad-pod'): AdPodWaitingStatus;
488
+ new (eventType: 'ad-pod-start'): AdPodStartStatus;
489
+ new (
490
+ eventType: 'ad-preparing',
491
+ eventData?: Omit<AdPreparingStatus, 'eventType'>,
492
+ ): AdPreparingStatus;
493
+ new (eventType: 'ad-start', eventData: Omit<AdStartStatus, 'eventType'>): AdStartStatus;
494
+ new (eventType: 'ad-playing', eventData: Omit<AdPlayingStatus, 'eventType'>): AdPlayingStatus;
495
+ new (eventType: 'ad-paused', eventData: Omit<AdPausedStatus, 'eventType'>): AdPausedStatus;
496
+ new (eventType: 'ad-end', eventData?: Omit<AdEndStatus, 'eventType'>): AdEndStatus;
497
+ new (eventType: 'ad-pod-end'): AdPodEndStatus;
498
+ new (eventType: 'ad-error', eventData?: Omit<AdErrorStatus, 'eventType'>): AdErrorStatus;
499
+ };
500
+
384
501
  PlayerState: typeof PlayerState;
385
- SubtitleTrack: typeof SubtitleTrack;
502
+
503
+ SubtitleTrack: { new (): SubtitleTrack };
386
504
  }
387
505
 
388
506
  export interface AnalyticsMap {
389
- AnalyticsProvider: typeof AnalyticsProvider;
507
+ AnalyticsProvider: { new (): AnalyticsProvider };
390
508
  }
391
509
 
392
510
  export interface UIMap {
393
511
  LayoutPosition: LayoutPositionMap;
394
- Snackbar: typeof Snackbar;
395
- SnackbarUIConfig: typeof SnackbarUIConfig;
512
+ Snackbar: { new (uiConfig: SnackbarUIConfig): Snackbar };
513
+ SnackbarUIConfig: { new (): SnackbarUIConfig };
396
514
  }
397
515
 
398
516
  export interface XMessagesMap {
@@ -403,47 +521,69 @@ export interface XMessagesMap {
403
521
  }
404
522
 
405
523
  export interface InterceptorsMap {
406
- LoadRequestInterceptor: typeof LoadRequestInterceptor;
524
+ LoadRequestInterceptor: {
525
+ new (adaptLoadRequest: (loadRequest: unknown) => unknown): LoadRequestInterceptor;
526
+ };
407
527
  }
408
528
 
529
+ /**
530
+ * Continuity framework shape for LG, Xbox, Vizio, and Chromecast v2.
531
+ * Samsung extends this with AVPlayerAdapter — see SamsungContinuityFramework.
532
+ */
409
533
  export interface ContinuityFramework {
534
+ /** Abstract class — access via getInstance(), not `new`. */
410
535
  ContinuityContext: typeof ContinuityContext;
411
- ContinuityOptions: typeof ContinuityOptions;
412
-
413
- /** Available on Samsung, LG, Vizio, Xbox platforms */
536
+ ContinuityOptions: { new (): ContinuityOptions };
414
537
  adapters: AdaptersMap;
415
- /** Available on Samsung, LG, Vizio, Xbox platforms */
416
538
  messages: MessagesMap;
417
- /** Available on Samsung, LG, Vizio, Xbox platforms */
418
539
  analytics: AnalyticsMap;
419
- /** Available on Samsung, LG, Vizio, Xbox platforms */
420
540
  ui: UIMap;
421
-
422
- /** Available on all platforms */
423
541
  xmessages: XMessagesMap;
424
-
425
- /** Available on Chromecast only */
426
- interceptors?: InterceptorsMap;
427
- /** @deprecated — use interceptors.LoadRequestInterceptor */
428
- LoadRequestInterceptor?: typeof LoadRequestInterceptor;
429
542
  }
430
543
 
431
544
  // ========================
432
545
  // Logger
433
546
  // ========================
434
547
 
548
+ export interface VizbeeLogLevel {
549
+ readonly CRITICAL: 0;
550
+ readonly ERROR: 1;
551
+ readonly WARN: 2;
552
+ readonly INFO: 3;
553
+ readonly DEBUG: 4;
554
+ readonly VERBOSE: 5;
555
+ }
556
+
435
557
  export interface VizbeeLogger {
558
+ /** Log level constants — pass a value to setLevel() to control verbosity. */
559
+ readonly LEVEL: VizbeeLogLevel;
560
+
436
561
  setPrefix(prefix: string): void;
562
+ /** Set the minimum log level. Accepts a numeric value from LEVEL. */
563
+ setLevel(level: number): void;
564
+ enable(): void;
565
+ disable(): void;
566
+
567
+ critical(...args: unknown[]): void;
437
568
  error(...args: unknown[]): void;
438
569
  warn(...args: unknown[]): void;
439
570
  info(...args: unknown[]): void;
440
571
  debug(...args: unknown[]): void;
441
- d(...args: unknown[]): void;
442
- w(...args: unknown[]): void;
572
+ verbose(...args: unknown[]): void;
573
+
574
+ /** Alias for critical() */ c(...args: unknown[]): void;
575
+ /** Alias for error() */ e(...args: unknown[]): void;
576
+ /** Alias for warn() */ w(...args: unknown[]): void;
577
+ /** Alias for info() */ i(...args: unknown[]): void;
578
+ /** Alias for debug() */ d(...args: unknown[]): void;
579
+ /** Alias for verbose() */ v(...args: unknown[]): void;
443
580
  }
444
581
 
445
582
  // ========================
446
- // VizbeeSDK (default export)
583
+ // VizbeeSDK
584
+ //
585
+ // Base SDK interface used by LG, Xbox, Vizio, and Chromecast v2.
586
+ // Samsung narrows `continuity` via SamsungVizbeeSDK in samsung.d.ts.
447
587
  // ========================
448
588
 
449
589
  export interface VizbeeSDK {
@@ -481,6 +621,3 @@ export interface VizbeeSDK {
481
621
  setAdAdapterType(adAdapterType: string): boolean | undefined;
482
622
  wrapAVPlayerListener(listeners: Record<string, Function>): unknown;
483
623
  }
484
-
485
- declare const vizbee: VizbeeSDK;
486
- export default vizbee;