@tivio/sdk-react 4.4.1 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { ComponentType } from 'react';
2
2
  import { FunctionComponentElement } from 'react';
3
+ import { OperatingSystem } from 'detect-browser';
3
4
  import { default as React_2 } from 'react';
4
5
 
5
6
  /**
@@ -129,6 +130,15 @@ declare type AdSource_2 = SourceBase & {
129
130
  type: 'ad';
130
131
  };
131
132
 
133
+ /**
134
+ * @public
135
+ */
136
+ export declare interface Advertisement extends RowItem {
137
+ id: string;
138
+ itemType: ROW_ITEM_TYPES.ADVERTISEMENT;
139
+ type?: string | null;
140
+ }
141
+
132
142
  /**
133
143
  * @public
134
144
  */
@@ -140,6 +150,63 @@ export declare enum ALGOLIA_INDEX_NAME {
140
150
  USERS = "users"
141
151
  }
142
152
 
153
+ /**
154
+ * List of conversion types that we send to analytics.
155
+ */
156
+ export declare enum AnalyticsConversionName {
157
+ CLICK = "click",
158
+ PLAY = "play",
159
+ PURCHASE = "purchase",
160
+ VISIT = "visit"
161
+ }
162
+
163
+ /**
164
+ * Map of Tivio targets in our apps.
165
+ * Values are based on url paths and rewrites from firebase.json
166
+ */
167
+ export declare enum AnalyticsConversionPage {
168
+ Videos = "videos",
169
+ Series = "series",
170
+ Profile = "profile",
171
+ Tags = "tags",
172
+ Screens = "screens",
173
+ Registration = "registration",
174
+ Login = "login",
175
+ About = "about",
176
+ ResetPassword = "reset-password",
177
+ Player = "player",
178
+ Redeem = "redeem",
179
+ Referral = "referral",
180
+ Pair = "pair",
181
+ Search = "search"
182
+ }
183
+
184
+ /**
185
+ * For conversion purchases
186
+ */
187
+ export declare enum AnalyticsConversionStatus {
188
+ SUCCESS = "SUCCESS",
189
+ FAILED = "FAILED"
190
+ }
191
+
192
+ export declare type AnalyticsConversionTarget = AnalyticsConversionTargetBase | AnalyticsConversionPage;
193
+
194
+ export declare enum AnalyticsConversionTargetBase {
195
+ Element = "element",
196
+ Monetization = "monetization"
197
+ }
198
+
199
+ export declare interface AnalyticsInterface {
200
+ reportAdvertisementPlay: () => void;
201
+ reportAdvertisementProgress: () => void;
202
+ reportElementClick: (elementId: string) => void;
203
+ reportLocationChange: (path: string, pathParam?: string) => void;
204
+ createMonetizationPurchase: () => void;
205
+ completeMonetizationPurchase: (status: AnalyticsConversionStatus, monetizationId?: string) => void;
206
+ reportVideoPlay: (status: AnalyticsConversionStatus, videoId: string) => void;
207
+ reportVideoProgress: (videoId: string, videoDuration: number, checkpoint: number) => void;
208
+ }
209
+
143
210
  /**
144
211
  * @public
145
212
  */
@@ -201,7 +268,6 @@ export declare type BannerProps = {
201
268
  focused: boolean;
202
269
  onClick?: () => void;
203
270
  hoverable: boolean;
204
- broadcastInfo: string;
205
271
  height: number;
206
272
  cover: string;
207
273
  overlay: boolean;
@@ -209,6 +275,7 @@ export declare type BannerProps = {
209
275
  borderRadius?: string | number;
210
276
  buttonText?: string;
211
277
  onButtonClick?: () => void;
278
+ numberOfLines?: number;
212
279
  };
213
280
 
214
281
  /**
@@ -299,6 +366,107 @@ export declare type CmpConfig = 'default' | 'debug' | 'none';
299
366
  */
300
367
  export declare type Config = SdkReactConfig;
301
368
 
369
+ /**
370
+ * @public
371
+ */
372
+ export declare interface ConfirmationOverlayContextState {
373
+ isOpen: boolean;
374
+ payload: ConfirmationOverlayPayload | null;
375
+ closeOverlay: () => void;
376
+ openOverlay: (payload: ConfirmationOverlayPayload) => void;
377
+ confirmAction: () => void;
378
+ }
379
+
380
+ /**
381
+ * @public
382
+ */
383
+ export declare type ConfirmationOverlayPayload = SuccessConfirmationOverlayPayload | WarningConfirmationOverlayPayload;
384
+
385
+ /**
386
+ * @public
387
+ */
388
+ export declare interface ConfirmationOverlayPayloadBase {
389
+ title?: string;
390
+ caption?: string;
391
+ onClose?: () => void;
392
+ onConfirm?: () => void;
393
+ /**
394
+ * If configured, then overlay is automatically confirmed after this time.
395
+ */
396
+ automaticConfirmDelayMs?: number;
397
+ }
398
+
399
+ /**
400
+ * Entity aggregate conversion statistics per day
401
+ */
402
+ export declare interface ConversionAnalytic {
403
+ /**
404
+ * Unix timestamp
405
+ */
406
+ date: number;
407
+ type: AnalyticsConversionName;
408
+ statistics: ConversionsItem[];
409
+ }
410
+
411
+ export declare interface ConversionsItem {
412
+ technology: PLATFORM;
413
+ os: DeviceOs;
414
+ osVersion: string;
415
+ details: {
416
+ /**
417
+ * Count of conversion with Success state
418
+ */
419
+ successCount: number;
420
+ /**
421
+ * Count of all conversion regardless of status
422
+ */
423
+ totalCount: number;
424
+ targets: ConversionsTargetItem[];
425
+ };
426
+ }
427
+
428
+ /**
429
+ * Entity with statistics conversion for url
430
+ */
431
+ export declare interface ConversionsTargetItem {
432
+ /**
433
+ * Target id represent different values for every conversion.
434
+ * e.g. for visit conversion on video page saving videoId
435
+ * e.g. for visit conversion on profile page not saving anything
436
+ * e.g. for purchase conversion save monetizationId when user select specific monetization
437
+ * e.g. for purchase conversion not save anything when user leave monetization before select
438
+ * e.g. for click conversion save elementId
439
+ */
440
+ targetId: string;
441
+ /**
442
+ * Target type represent different values for every conversion.
443
+ * e.g. for visit conversion show current path
444
+ * e.g. for purchase conversion is every time monetization
445
+ * e.g. for click conversion is every time element
446
+ */
447
+ targetType: AnalyticsConversionTarget;
448
+ /**
449
+ * Path is page of conversion
450
+ * e.g. for visit conversion represent previews page
451
+ * e.g. for purchase conversion is page where purchase happened
452
+ * e.g. for click conversion is page where click happened
453
+ */
454
+ path: string;
455
+ /**
456
+ * Path param is param from url of conversion (e.g. video page -> videoId, profile page -> unknown)
457
+ * e.g. for visit conversion represent parameters previews page
458
+ * e.g. for purchase conversion where purchase happened
459
+ * e.g. for click conversion where click happened
460
+ */
461
+ pathParam: string | undefined;
462
+ /** Count of conversion with Success state on specific page */
463
+ successCount: number;
464
+ /**
465
+ * Count of all conversion regardless of status on specific page
466
+ */
467
+ totalCount: number;
468
+ }
469
+
302
470
  /**
303
471
  * @public
304
472
  * @TODO move somewhere else
@@ -345,14 +513,20 @@ export declare type Currency = 'CZK' | 'EUR' | 'USD';
345
513
  /**
346
514
  * @public
347
515
  */
348
- export declare enum CUSTOMER_BUILD {
516
+ export declare enum CustomerId {
349
517
  OKTAGON = "OKTAGON",
350
518
  JOJ = "JOJ",
351
519
  MALL = "MALL",
352
520
  GARAZ = "GARAZ",
353
521
  U_KULATEHO_STOLU = "U_KULATEHO_STOLU",
354
522
  INVESTOREES = "INVESTOREES",
355
- DVTV = "DVTV"
523
+ DVTV = "DVTV",
524
+ DVTV_DEV = "DVTV_DEV",
525
+ O2 = "O2",
526
+ GRAPE = "GRAPE",
527
+ TIVIO = "TIVIO",
528
+ STORYBOOK = "STORYBOOK",
529
+ NANGU_DEV = "NANGU_DEV"
356
530
  }
357
531
 
358
532
  /**
@@ -382,6 +556,11 @@ export declare type DetailedPrice = {
382
556
  */
383
557
  export declare type DeviceInfo = ArrisDeviceInfo | ReactNativeDeviceInfo;
384
558
 
559
+ /**
560
+ * @public
561
+ */
562
+ export declare type DeviceOs = OperatingSystem | 'Tizen' | 'webOS' | 'Arris' | 'Android TV' | 'tvOS';
563
+
385
564
  /**
386
565
  * @public
387
566
  */
@@ -447,6 +626,7 @@ export declare type Events = {
447
626
  */
448
627
  export declare type ExternalTvConfig = {
449
628
  logo: string;
629
+ splashScreenBackgroundColor?: string;
450
630
  };
451
631
 
452
632
  /**
@@ -462,12 +642,32 @@ export declare const fetchBundle: (secret: string, conf: InternalConfig) => Prom
462
642
  declare type FetchPackage = (url: string) => Promise<string>;
463
643
 
464
644
  /**
645
+ * Counterpart for {@link ForbiddenError} from @tivio/api.
646
+ * @public
647
+ */
648
+ export declare interface ForbiddenOnCallError extends GenericOnCallError {
649
+ code: 'permission-denied';
650
+ details?: {
651
+ reason: ForbiddenReason;
652
+ };
653
+ }
654
+
655
+ export declare enum ForbiddenReason {
656
+ MONETIZATION = "MONETIZATION",
657
+ GEO_BLOCKING = "GEO_BLOCKING"
658
+ }
659
+
660
+ /**
661
+ * On call error interface for front-end.
662
+ * Do not use it / throw it from @tivio/api.
465
663
  * @public
466
664
  */
467
- export declare interface GenericOnCallError {
468
- code: string;
469
- message?: string;
470
- details?: string[];
665
+ export declare interface GenericOnCallError extends Error {
666
+ /**
667
+ * Based on {@link FunctionsErrorCode} from firebase-functions.
668
+ */
669
+ code: 'ok' | 'cancelled' | 'unknown' | 'invalid-argument' | 'deadline-exceeded' | 'not-found' | 'already-exists' | 'permission-denied' | 'resource-exhausted' | 'failed-precondition' | 'aborted' | 'out-of-range' | 'unimplemented' | 'internal' | 'unavailable' | 'data-loss' | 'unauthenticated';
670
+ details?: Record<string, string>;
471
671
  }
472
672
 
473
673
  /**
@@ -498,6 +698,57 @@ export declare type GetPurchaseInfoResponse = {
498
698
  };
499
699
  };
500
700
 
701
+ export declare interface GetSourceUrlRequest {
702
+ /**
703
+ * Id of the document to return source for.
704
+ */
705
+ id: string;
706
+ /**
707
+ * Type of the document to return source for.
708
+ */
709
+ documentType: 'video' | 'tvChannel';
710
+ /**
711
+ * Which capabilities should the resulting source support.
712
+ */
713
+ capabilities: PlayerCapability[];
714
+ /**
715
+ * Which language the resulting source should support.
716
+ * If not present, language is not taken into consideration when picking the resulting source.
717
+ */
718
+ language?: LangCode;
719
+ /**
720
+ * Which sources did client (or cloud function) has already tried out.
721
+ */
722
+ sourceHistory?: string[];
723
+ /**
724
+ * When set to true the function will return urls with unsecured http protocol.
725
+ * We need this because some devices in certain circumstances are not able to use https.
726
+ *
727
+ * e.g. On LG it is not possible to use HTTPS certificates with root authority
728
+ * `Let's Encrypt` (for more info see https://jira.nangu.tv/browse/TIV-1047),
729
+ * which is used on cdn3.tiv.io domain.
730
+ *
731
+ * Switching this urls to http is a workaround for these cases.
732
+ */
733
+ preferHttp?: boolean;
734
+ /**
735
+ * If set to true, sources on the document will be skipped and function will try to
736
+ * construct sources based on source domains right away.
737
+ */
738
+ ignoreDocumentSources?: boolean;
739
+ }
740
+
741
+ export declare interface GetSourceUrlResponse {
742
+ /**
743
+ * The resulting source url.
744
+ */
745
+ url: string;
746
+ /**
747
+ * Which sources did client (or cloud function) has already tried out.
748
+ */
749
+ sourceHistory: string[];
750
+ }
751
+
501
752
  /**
502
753
  * @public
503
754
  */
@@ -544,9 +795,10 @@ export declare interface IndexedUser extends IndexedObject {
544
795
  * @public
545
796
  */
546
797
  export declare interface IndexedVideo extends IndexedObject {
547
- organizationPath?: string;
798
+ assets: any;
799
+ organizationPath: string;
548
800
  tagPaths?: string[];
549
- created: Date;
801
+ created: Date | string;
550
802
  isDraft: boolean;
551
803
  type: VideoType;
552
804
  contentType?: VideoContentType;
@@ -609,7 +861,7 @@ export declare type ItemComponent = RowItemComponent | BannerItemComponent;
609
861
  /**
610
862
  * @public
611
863
  */
612
- export declare type ItemsInRow = Tag | Video | TvChannel;
864
+ export declare type ItemsInRow = Tag | Video | TvChannel | Advertisement;
613
865
 
614
866
  /**
615
867
  * @public
@@ -727,6 +979,11 @@ declare interface Logger {
727
979
  */
728
980
  declare type LoggerArgs = any[];
729
981
 
982
+ export declare enum LoginRedirect {
983
+ PAYMENT = "payment",
984
+ VOUCHER = "voucher"
985
+ }
986
+
730
987
  /**
731
988
  * @public
732
989
  */
@@ -749,6 +1006,14 @@ export declare interface Marker {
749
1006
  type: 'AD' | 'AD_SEGMENT' | 'START' | 'END' | 'INTRO';
750
1007
  }
751
1008
 
1009
+ /**
1010
+ * @public
1011
+ */
1012
+ export declare type MarkersProps = {
1013
+ color?: string;
1014
+ className?: string;
1015
+ };
1016
+
752
1017
  /**
753
1018
  * External information of video migrated via our Public API.
754
1019
  * @public
@@ -780,6 +1045,14 @@ export declare enum MONETIZATION_FREQUENCY {
780
1045
  ANNUALLY = "ANNUALLY"
781
1046
  }
782
1047
 
1048
+ /**
1049
+ * @public
1050
+ */
1051
+ export declare interface MonetizationActions {
1052
+ selectMonetization: (monetization: PurchasableMonetization) => void;
1053
+ errors: string[];
1054
+ }
1055
+
783
1056
  /**
784
1057
  * @public
785
1058
  */
@@ -806,6 +1079,7 @@ export declare interface MonetizationsSelectOverlayData {
806
1079
  * Otherwise, user is making a purchase for himself.
807
1080
  */
808
1081
  voucherPurchase?: boolean;
1082
+ registrationRedirect?: boolean;
809
1083
  onPurchase?: () => void;
810
1084
  onClose?: () => void;
811
1085
  }
@@ -814,9 +1088,10 @@ export declare interface MonetizationsSelectOverlayData {
814
1088
  * @public
815
1089
  */
816
1090
  export declare type MonetizationsSelectOverlayState = {
1091
+ isOpen: boolean;
817
1092
  data: MonetizationsSelectOverlayData | null;
818
- closeMonetizationsSelectOverlay: () => void;
819
1093
  openMonetizationsSelectOverlay: (data: MonetizationsSelectOverlayData) => void;
1094
+ closeMonetizationsSelectOverlay: () => void;
820
1095
  };
821
1096
 
822
1097
  /**
@@ -878,6 +1153,7 @@ declare type OrderByDirection = 'desc' | 'asc';
878
1153
  * @public
879
1154
  */
880
1155
  export declare interface Organization {
1156
+ userProfileConfiguration: any;
881
1157
  }
882
1158
 
883
1159
  /**
@@ -906,12 +1182,16 @@ export declare type PaginationInterface<Entity> = {
906
1182
  export declare type PaginationOptions = Partial<{
907
1183
  limit: number;
908
1184
  noLimit: boolean;
1185
+ noAutoFetch: boolean;
909
1186
  }>;
910
1187
 
911
1188
  /**
912
1189
  * @public
913
1190
  */
914
1191
  export declare enum PLATFORM {
1192
+ /**
1193
+ * Includes tablets.
1194
+ */
915
1195
  MOBILE = "MOBILE",
916
1196
  WEB = "WEB",
917
1197
  TV = "TV"
@@ -1291,6 +1571,14 @@ export declare type PurchaseEndpointPayload = {
1291
1571
  * True if delayed payment is confirmed but not charged yet, undefined in all other cases.
1292
1572
  */
1293
1573
  isDelayedPayment?: boolean;
1574
+ /**
1575
+ * Purchase status before change.
1576
+ */
1577
+ previousStatus: PurchaseStatus;
1578
+ /**
1579
+ * Purchase status after change.
1580
+ */
1581
+ newStatus: PurchaseStatus;
1294
1582
  };
1295
1583
  /**
1296
1584
  * Information about the monetization which has been bought by this purchase. Monetization definition may change in time so information provided here
@@ -1504,8 +1792,13 @@ export declare type ReactNativeDeviceInfo = {
1504
1792
  os?: 'iOS' | 'Android OS';
1505
1793
  osVersion: string;
1506
1794
  platform: PLATFORM;
1795
+ isTablet?: boolean;
1507
1796
  };
1508
1797
 
1798
+ export declare enum RegistrationRedirect {
1799
+ PAYMENT = "payment"
1800
+ }
1801
+
1509
1802
  /**
1510
1803
  * @public
1511
1804
  */
@@ -1521,22 +1814,36 @@ export declare type RemoteBundleState = {
1521
1814
  export declare type RemoteProviderProps = {
1522
1815
  disableUnmounting?: boolean;
1523
1816
  language?: LangCode;
1524
- children: any;
1817
+ children: React_2.ReactNode;
1525
1818
  };
1526
1819
 
1527
1820
  /**
1528
1821
  * @public
1529
1822
  */
1530
1823
  export declare interface RouterOverrides {
1824
+ getVideoDetailPath: (videoIdOrUrlName: string) => string;
1825
+ getSeriesDetailPath: (tagId: string) => string;
1826
+ getTagPath: (tagId: string) => string;
1827
+ getLoginPath: () => string;
1828
+ getRegistrationPath: () => string;
1829
+ getLivePlayerPath: (tvChannelId: string) => string;
1830
+ getVodPlayerPath: (videoIdOrUrlName: string) => string;
1831
+ getHomePath: (screens: ScreenConfig[]) => string;
1531
1832
  goToVideoDetailPage: (videoIdOrUrlName: string) => void;
1532
1833
  goToSeriesDetailPage: (tagId: string) => void;
1533
1834
  goToTagPage: (tagId: string) => void;
1534
- goToLoginPage: () => void;
1535
- goToRegistrationPage: () => void;
1835
+ goToLoginPage: (options?: {
1836
+ manual?: boolean;
1837
+ origin?: LoginRedirect;
1838
+ }) => void;
1839
+ goToRegistrationPage: (options?: {
1840
+ origin?: RegistrationRedirect;
1841
+ }) => void;
1536
1842
  goBack: () => void;
1537
1843
  goLivePlayer: (tvChannelId: string) => void;
1538
1844
  goVodPlayer: (videoIdOrUrlName: string) => void;
1539
- goToHome: () => void;
1845
+ goToHome: (user?: any, activeUserProfileId?: string) => void;
1846
+ goToRoute: (route: string) => void;
1540
1847
  }
1541
1848
 
1542
1849
  /**
@@ -1544,6 +1851,10 @@ export declare interface RouterOverrides {
1544
1851
  */
1545
1852
  export declare interface RouterOverridesContextState {
1546
1853
  routerOverrides: RouterOverrides;
1854
+ Link: React_2.ComponentType<{
1855
+ children?: React_2.ReactNode;
1856
+ href?: string;
1857
+ }>;
1547
1858
  }
1548
1859
 
1549
1860
  /**
@@ -1557,7 +1868,8 @@ export declare type Row = RowStandard | RowBanner;
1557
1868
  export declare enum ROW_ITEM_TYPES {
1558
1869
  VIDEO = "VIDEO",
1559
1870
  TAG = "TAG",
1560
- TV_CHANNEL = "TV_CHANNEL"
1871
+ TV_CHANNEL = "TV_CHANNEL",
1872
+ ADVERTISEMENT = "ADVERTISEMENT"
1561
1873
  }
1562
1874
 
1563
1875
  /**
@@ -1579,6 +1891,7 @@ declare interface RowBase {
1579
1891
  assets: Assets;
1580
1892
  type: ScreenRowType;
1581
1893
  isLiveRow: boolean;
1894
+ numberOfLines?: number;
1582
1895
  }
1583
1896
 
1584
1897
  /**
@@ -1617,7 +1930,8 @@ export declare interface RowItemAssets {
1617
1930
  export declare enum RowItemComponent {
1618
1931
  ROW_ITEM_PORTRAIT = "ROW_ITEM_PORTRAIT",
1619
1932
  ROW_ITEM_LANDSCAPE = "ROW_ITEM_LANDSCAPE",
1620
- ROW_ITEM_CIRCLED = "ROW_ITEM_CIRCLED"
1933
+ ROW_ITEM_CIRCLED = "ROW_ITEM_CIRCLED",
1934
+ ROW_ITEM_BANNER = "ROW_ITEM_BANNER"
1621
1935
  }
1622
1936
 
1623
1937
  /**
@@ -1674,6 +1988,11 @@ export { Screen_2 as Screen }
1674
1988
  export declare type ScreenConfig = {
1675
1989
  id: string;
1676
1990
  name: string;
1991
+ route?: string;
1992
+ showForUserProfileType?: {
1993
+ kids: boolean;
1994
+ adults: boolean;
1995
+ };
1677
1996
  };
1678
1997
 
1679
1998
  /**
@@ -1687,7 +2006,7 @@ export declare type ScreenOptions = Partial<{
1687
2006
  /**
1688
2007
  * @public
1689
2008
  */
1690
- export declare type ScreenRowType = 'filter' | 'custom' | 'continueToWatch' | 'favourites';
2009
+ export declare type ScreenRowType = 'filter' | 'custom' | 'continueToWatch' | 'favourites' | 'topWatched';
1691
2010
 
1692
2011
  /**
1693
2012
  * Listen to screen data
@@ -1753,7 +2072,7 @@ export declare interface SettingsItem {
1753
2072
  * Sign out - setUser(null)
1754
2073
  * @public
1755
2074
  */
1756
- export declare const setUser: (userId: string | null, payload?: UserPayload | undefined) => Promise<void>;
2075
+ export declare const setUser: (userId: string | null, payload?: UserPayload) => Promise<void>;
1757
2076
 
1758
2077
  /**
1759
2078
  * @public
@@ -1861,11 +2180,20 @@ declare type SubscriptionInfo = {
1861
2180
  frequency: string;
1862
2181
  };
1863
2182
 
2183
+ /**
2184
+ * @public
2185
+ */
2186
+ export declare interface SuccessConfirmationOverlayPayload extends ConfirmationOverlayPayloadBase {
2187
+ type: 'success';
2188
+ confirmButtonText?: string;
2189
+ }
2190
+
1864
2191
  /**
1865
2192
  * @public
1866
2193
  */
1867
2194
  export declare interface Tag extends RowItem {
1868
2195
  id: string;
2196
+ itemType: ROW_ITEM_TYPES.TAG;
1869
2197
  tagId: string;
1870
2198
  type?: string | null;
1871
2199
  metadata?: any[];
@@ -1887,10 +2215,10 @@ export declare type TaggedVideosOrderByField = 'seasonNumber' | 'episodeNumber'
1887
2215
  * @public
1888
2216
  */
1889
2217
  export declare type TileProps = {
2218
+ children?: React_2.ReactNode;
1890
2219
  cover: string;
1891
2220
  bottomLabel: string;
1892
2221
  bottomLabelAreaHeight: number;
1893
- bottomLabelTextLinesCount: number;
1894
2222
  innerLabel: string;
1895
2223
  duration: string;
1896
2224
  price: string | null;
@@ -1910,6 +2238,7 @@ export declare type TileProps = {
1910
2238
  */
1911
2239
  containerMargin?: number | string;
1912
2240
  created?: Date;
2241
+ numberOfLines?: number;
1913
2242
  };
1914
2243
 
1915
2244
  /**
@@ -1917,6 +2246,13 @@ export declare type TileProps = {
1917
2246
  */
1918
2247
  export declare type TilePropsPartial = Partial<TileProps>;
1919
2248
 
2249
+ /**
2250
+ * @public
2251
+ */
2252
+ export declare type TivioAnalytics = {
2253
+ analytics: AnalyticsInterface;
2254
+ };
2255
+
1920
2256
  /**
1921
2257
  * @public
1922
2258
  */
@@ -1956,8 +2292,10 @@ export declare type TivioBundleFile = {
1956
2292
  * @public
1957
2293
  */
1958
2294
  export declare type TivioComponents = {
1959
- Markers: React_2.ReactNode;
1960
- PlayerDataContext: React_2.ReactNode;
2295
+ Markers: React_2.ComponentType<MarkersProps>;
2296
+ PlayerDataContext: React_2.Context<{
2297
+ player: any | null;
2298
+ }>;
1961
2299
  Provider: React_2.ComponentType<RemoteProviderProps>;
1962
2300
  WebPlayer: React_2.ComponentType<WebPlayerProps>;
1963
2301
  Widget: React_2.ComponentType<TivioWidgetProps>;
@@ -2013,7 +2351,8 @@ export declare interface TivioConfig {
2013
2351
  language: LangCode;
2014
2352
  debug?: boolean;
2015
2353
  verbose?: boolean;
2016
- firebaseApp?: any;
2354
+ firebaseApp?: any | null;
2355
+ firestore?: any | null;
2017
2356
  currency: Currency;
2018
2357
  /**
2019
2358
  * Configuration for GDPR consent collection (CMP)
@@ -2025,6 +2364,13 @@ export declare interface TivioConfig {
2025
2364
  */
2026
2365
  deviceInfo?: DeviceInfo;
2027
2366
  player?: PlayerConfig;
2367
+ /**
2368
+ * Used for purposes where we need to differentiate organizations before it is known based on secret and data from DB.
2369
+ *
2370
+ * At this time it is necessary only for LG builds because on LG TVs it is needed to separate apps indexedDB storages
2371
+ * (otherwise organizations would share login token).
2372
+ */
2373
+ customerId?: CustomerId;
2028
2374
  }
2029
2375
 
2030
2376
  /**
@@ -2104,6 +2450,7 @@ export declare type TivioHooks = {
2104
2450
  applyInviteCode: (code: string) => void;
2105
2451
  inviteCodeReset: () => void;
2106
2452
  };
2453
+ useChannelSource: UseChannelSource;
2107
2454
  };
2108
2455
 
2109
2456
  /**
@@ -2127,6 +2474,10 @@ export declare type TivioInternalComponents = {
2127
2474
  videoIdOrUrlName: string;
2128
2475
  }>;
2129
2476
  WebSeriesDetailScreen: React_2.ComponentType<WebSeriesDetailScreenProps>;
2477
+ WebConfirmationOverlay: React_2.ComponentType;
2478
+ UserProfilesOverlay: React_2.ComponentType<{
2479
+ onClose: (selectedProfileId: string) => void;
2480
+ }>;
2130
2481
  };
2131
2482
 
2132
2483
  /**
@@ -2135,6 +2486,9 @@ export declare type TivioInternalComponents = {
2135
2486
  export declare type TivioInternalHooks = {
2136
2487
  useMonetizationsSelectOverlay: () => MonetizationsSelectOverlayState;
2137
2488
  useQerkoOverlay: () => QerkoOverlayState;
2489
+ useConfirmationOverlay: () => ConfirmationOverlayContextState;
2490
+ useMonetizationActions: () => MonetizationActions;
2491
+ useCancelSubscriptions: () => UseCancelSubscriptionsResult;
2138
2492
  usePurchasesWithVideos: () => {
2139
2493
  purchases: Purchase[];
2140
2494
  };
@@ -2151,18 +2505,18 @@ export declare type TivioInternalHooks = {
2151
2505
  promotionId?: string;
2152
2506
  referralId: string;
2153
2507
  promotion?: any;
2154
- };
2508
+ } | null;
2155
2509
  error: Error | null;
2156
2510
  loading: boolean;
2157
2511
  });
2158
2512
  useTvChannel: UseTvChannel;
2159
- useChannelSource: UseChannelSource;
2160
2513
  useUser: () => {
2161
2514
  user: User | null;
2162
2515
  error: string | null;
2163
2516
  isInitialized: boolean;
2164
2517
  isSignedIn: boolean;
2165
2518
  };
2519
+ useOrganization: () => Organization | null;
2166
2520
  };
2167
2521
 
2168
2522
  /**
@@ -2171,20 +2525,27 @@ export declare type TivioInternalHooks = {
2171
2525
  export declare type TivioInternalProviders = {
2172
2526
  AppThemeProvider: React_2.ComponentType;
2173
2527
  CustomerProvider: React_2.ComponentType<{
2174
- customer: CUSTOMER_BUILD;
2528
+ customer: CustomerId;
2175
2529
  platform: PLATFORM;
2176
- children: any;
2530
+ children?: React_2.ReactNode;
2531
+ }>;
2532
+ ConfigProvider: React_2.ComponentType<React_2.PropsWithChildren>;
2533
+ UserContextProvider: React_2.ComponentType<{
2534
+ children?: React_2.ReactNode;
2177
2535
  }>;
2178
- ConfigProvider: React_2.ComponentType;
2179
- UserContextProvider: React_2.ComponentType;
2180
2536
  MonetizationsSelectOverlayContextProvider: React_2.ComponentType;
2181
2537
  QerkoOverlayContextProvider: React_2.ComponentType;
2182
- PurchasesWithVideosContextProvider: React_2.ComponentType;
2538
+ PurchasesWithVideosContextProvider: React_2.ComponentType<{
2539
+ children?: React_2.ReactNode;
2540
+ }>;
2183
2541
  /**
2184
2542
  * @deprecated not used in our app, can be removed when no sdk in production uses it
2185
2543
  */
2186
2544
  OrganizationSubscriptionsContextProvider: React_2.ComponentType;
2187
- RouterOverridesContextProvider: React_2.ComponentType<RouterOverridesContextState>;
2545
+ RouterOverridesContextProvider: React_2.ComponentType<{
2546
+ state: RouterOverridesContextState;
2547
+ }>;
2548
+ ConfirmationOverlayContextProvider: React_2.ComponentType;
2188
2549
  };
2189
2550
 
2190
2551
  /**
@@ -2273,6 +2634,7 @@ export declare type TivioReactBundle = {
2273
2634
  * TODO should not be the part of public API
2274
2635
  */
2275
2636
  internal: TivioInternalBundle;
2637
+ analytics: TivioAnalytics;
2276
2638
  destroy: () => Promise<void>;
2277
2639
  } & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
2278
2640
 
@@ -2334,7 +2696,7 @@ export declare type TivioVodSource = SourceBase & StartAndContinuePosition & {
2334
2696
  /**
2335
2697
  * @public
2336
2698
  */
2337
- export declare const TivioWidget: React_2.ForwardRefExoticComponent<Pick<TivioWidgetProps, "id" | "onEnabled" | "onBlur"> & React_2.RefAttributes<TivioWidgetRef>>;
2699
+ export declare const TivioWidget: React_2.ForwardRefExoticComponent<Omit<TivioWidgetProps, "ref"> & React_2.RefAttributes<TivioWidgetRef>>;
2338
2700
 
2339
2701
  /**
2340
2702
  * @public
@@ -2400,17 +2762,17 @@ export declare type Translation = {
2400
2762
  * @public
2401
2763
  */
2402
2764
  export declare type TvAppProps = {
2403
- customer: CUSTOMER_BUILD;
2765
+ customer: CustomerId;
2404
2766
  };
2405
2767
 
2406
2768
  /**
2407
2769
  * @public
2408
2770
  */
2409
2771
  export declare interface TvChannel extends RowItem {
2410
- name: string;
2411
2772
  id: string;
2773
+ itemType: ROW_ITEM_TYPES.TV_CHANNEL;
2774
+ name: string;
2412
2775
  path: string;
2413
- itemType: ROW_ITEM_TYPES;
2414
2776
  country?: string;
2415
2777
  filters: string[];
2416
2778
  logo?: string;
@@ -2421,9 +2783,12 @@ export declare interface TvChannel extends RowItem {
2421
2783
  * Transactions before subscriptions, sorted by price ascending.
2422
2784
  */
2423
2785
  getPurchasableMonetizations(options?: GetPurchasableMonetizationsOptions): PurchasableMonetization[];
2786
+ getSourceUrl(fallbackUrl?: string): Promise<GetSourceUrlResponse>;
2424
2787
  purchasableMonetization: any | null;
2425
2788
  price: number;
2426
2789
  cover: string;
2790
+ isPlayable: boolean;
2791
+ uri: string;
2427
2792
  }
2428
2793
 
2429
2794
  /**
@@ -2517,6 +2882,15 @@ export declare type UseCancelSubscription = (subscriptionId: string) => {
2517
2882
  */
2518
2883
  export declare const useCancelSubscription: UseCancelSubscription;
2519
2884
 
2885
+ /**
2886
+ * @public
2887
+ */
2888
+ export declare interface UseCancelSubscriptionsResult {
2889
+ cancelSubscriptions: (subscriptionIds: string[]) => Promise<void>;
2890
+ cancellationInfos: QerkoCancellationInfo[];
2891
+ errors: string[];
2892
+ }
2893
+
2520
2894
  /**
2521
2895
  * @public
2522
2896
  */
@@ -2568,7 +2942,7 @@ export declare const useMarkers: () => Marker[] | null;
2568
2942
  /**
2569
2943
  * @public
2570
2944
  */
2571
- export declare const useOrganizationSubscriptions: (onlyPurchasableSubscriptions?: boolean | undefined) => {
2945
+ export declare const useOrganizationSubscriptions: (onlyPurchasableSubscriptions?: boolean) => {
2572
2946
  subscriptions: PurchasableMonetization[];
2573
2947
  };
2574
2948
 
@@ -2601,7 +2975,7 @@ export declare function usePurchaseRecovery(): {
2601
2975
  /**
2602
2976
  * @public
2603
2977
  */
2604
- export declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher | undefined) => QerkoTransaction;
2978
+ export declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
2605
2979
 
2606
2980
  /**
2607
2981
  * Return purchases with initialized video (purchases[i].video not null)
@@ -2639,6 +3013,7 @@ export declare type User = {
2639
3013
  extendableSubscription?: Purchase;
2640
3014
  isPurchasesInitialized: boolean;
2641
3015
  isSignedIn: boolean;
3016
+ isReady: boolean;
2642
3017
  email?: string;
2643
3018
  type?: UserType;
2644
3019
  photoURL: string | null;
@@ -2646,6 +3021,11 @@ export declare type User = {
2646
3021
  authUserId?: string;
2647
3022
  favorites: any[];
2648
3023
  watchedPositions: any[];
3024
+ profiles: any[];
3025
+ activeUserProfileId: string | null;
3026
+ createUserProfile: (request: any) => Promise<void>;
3027
+ deleteUserProfile: (profileId: string) => Promise<void>;
3028
+ setActiveUserProfileId: (id: string) => void;
2649
3029
  };
2650
3030
 
2651
3031
  /**
@@ -2693,12 +3073,12 @@ export declare const useSearch: UseSearch;
2693
3073
  */
2694
3074
  export declare type UseSearchOptions<T extends ALGOLIA_INDEX_NAME = any> = PaginationOptions & {
2695
3075
  minQueryLength?: number;
2696
- } & (T extends ALGOLIA_INDEX_NAME.VIDEOS ? UseSearchVideoOptions : {});
3076
+ } & (T extends ALGOLIA_INDEX_NAME.VIDEOS | ALGOLIA_INDEX_NAME.VIDEOSDESC ? UseSearchVideoOptions : {});
2697
3077
 
2698
3078
  /**
2699
3079
  * @public
2700
3080
  */
2701
- export declare type UseSearchResult<T extends ALGOLIA_INDEX_NAME> = T extends ALGOLIA_INDEX_NAME.VIDEOS ? Video : T extends ALGOLIA_INDEX_NAME.TAGS ? Tag : T extends ALGOLIA_INDEX_NAME.TV_CHANNELS ? TvChannel : unknown;
3081
+ export declare type UseSearchResult<T extends ALGOLIA_INDEX_NAME> = T extends ALGOLIA_INDEX_NAME.VIDEOS | ALGOLIA_INDEX_NAME.VIDEOSDESC ? Video : T extends ALGOLIA_INDEX_NAME.TAGS ? Tag : T extends ALGOLIA_INDEX_NAME.TV_CHANNELS ? TvChannel : unknown;
2702
3082
 
2703
3083
  /**
2704
3084
  * @public
@@ -2740,7 +3120,7 @@ export declare const useTivioReadyData: () => RemoteBundleState | null;
2740
3120
  /**
2741
3121
  * @public
2742
3122
  */
2743
- export declare const useTransactionPayment: (videoId: string, monetizationId: string, voucher?: NewVoucher | undefined) => QerkoTransaction;
3123
+ export declare const useTransactionPayment: (videoId: string, monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
2744
3124
 
2745
3125
  /**
2746
3126
  * @public
@@ -2766,7 +3146,7 @@ export declare const useUser: () => {
2766
3146
  * @param videoIdOrUrlName - video id or video nice url (e.g. some-interesting-video)
2767
3147
  * @public
2768
3148
  */
2769
- export declare const useVideo: (videoIdOrUrlName?: string | undefined) => {
3149
+ export declare const useVideo: (videoIdOrUrlName?: string) => {
2770
3150
  data: Video | null;
2771
3151
  error: string | null;
2772
3152
  };
@@ -2799,15 +3179,7 @@ export declare const useWatchWithoutAdsOffer: () => {
2799
3179
  /**
2800
3180
  * @public
2801
3181
  */
2802
- export declare const VAST_PROVIDERS: ({
2803
- id: VastProvider;
2804
- name: string;
2805
- development?: undefined;
2806
- } | {
2807
- id: VastProvider;
2808
- name: string;
2809
- development: boolean;
2810
- })[];
3182
+ export declare const VAST_PROVIDERS: VastProvidersItem[];
2811
3183
 
2812
3184
  /**
2813
3185
  * @public
@@ -2829,16 +3201,24 @@ export declare enum VastProvider {
2829
3201
  PRIMA = "prima",
2830
3202
  TEST = "test",
2831
3203
  TEST_VPAID = "test-vpaid",
3204
+ TIVIO_ADS = "tivio-ads",
2832
3205
  JOJ_TEST_AD_FORM_PROGRAMMATIC = "joj-test-ad-form-programmatic",
2833
3206
  JOJ_TEST_TESTER_VASTERIX = "joj-test-tester-vasterix",
2834
3207
  JOJ_TEST_TESTER_ADFORM_30 = "joj-test-tester-adform-30"
2835
3208
  }
2836
3209
 
3210
+ declare type VastProvidersItem = {
3211
+ id: VastProvider;
3212
+ name: string;
3213
+ development?: boolean;
3214
+ };
3215
+
2837
3216
  /**
2838
3217
  * @public
2839
3218
  */
2840
3219
  export declare interface Video extends RowItem {
2841
3220
  id: string;
3221
+ itemType: ROW_ITEM_TYPES.VIDEO;
2842
3222
  /**
2843
3223
  * @deprecated use assets instead
2844
3224
  */
@@ -2859,6 +3239,7 @@ export declare interface Video extends RowItem {
2859
3239
  * Transactions before subscriptions, sorted by price ascending.
2860
3240
  */
2861
3241
  getPurchasableMonetizations(options?: GetPurchasableMonetizationsOptions): PurchasableMonetization[];
3242
+ getSourceUrl(fallbackUrl?: string): Promise<GetSourceUrlResponse>;
2862
3243
  purchasableMonetization: any | null;
2863
3244
  transaction: PurchasableMonetization | undefined;
2864
3245
  subscriptions: PurchasableMonetization[];
@@ -2890,6 +3271,8 @@ export declare interface Video extends RowItem {
2890
3271
  addToFavorites: () => void;
2891
3272
  removeFromFavorites: () => void;
2892
3273
  availability: VideoAvailability | null;
3274
+ sourceLanguages: LangCode[];
3275
+ uriByLanguage: (lang: LangCode) => string | undefined;
2893
3276
  }
2894
3277
 
2895
3278
  /**
@@ -2999,6 +3382,15 @@ declare type Voucher = {
2999
3382
  voucherInfo: SubscriptionInfo | TransactionInfo;
3000
3383
  };
3001
3384
 
3385
+ /**
3386
+ * @public
3387
+ */
3388
+ export declare interface WarningConfirmationOverlayPayload extends ConfirmationOverlayPayloadBase {
3389
+ type: 'warning';
3390
+ confirmButtonText?: string;
3391
+ closeButtonText?: string;
3392
+ }
3393
+
3002
3394
  /**
3003
3395
  * @public
3004
3396
  */
@@ -3061,7 +3453,7 @@ export declare type WebRowProps = {
3061
3453
  variant?: RowItemComponent;
3062
3454
  rowName?: string | any;
3063
3455
  fetchMore?: () => void;
3064
- onTileClick?: (item: ItemsInRow) => void;
3456
+ onTileClick?: (item?: ItemsInRow | null) => void;
3065
3457
  };
3066
3458
 
3067
3459
  /**
@@ -3105,6 +3497,6 @@ export declare type Widget = {
3105
3497
  /**
3106
3498
  * @public
3107
3499
  */
3108
- export declare function withPlayerContext(id: string): <P>(WrappedComponent: React_2.ComponentType<P>) => (props: P) => JSX.Element;
3500
+ export declare function withPlayerContext(id: string): <P extends JSX.IntrinsicAttributes>(WrappedComponent: React_2.ComponentType<P>) => (props: P) => JSX.Element;
3109
3501
 
3110
3502
  export { }