@tivio/sdk-react 2.3.4-beta.1 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/README.md +39 -0
  2. package/dist/components/ContextProvider.d.ts +3 -0
  3. package/dist/components/PlayerProvider.d.ts +19 -0
  4. package/dist/components/TivioProvider.d.ts +17 -0
  5. package/dist/components/TivioWidget.d.ts +7 -0
  6. package/dist/components/TivioWidgetError.d.ts +10 -0
  7. package/dist/components/TivioWidgetLoader.d.ts +6 -0
  8. package/dist/components/TvTivioProvider.d.ts +7 -0
  9. package/dist/components/context/ChannelsContext.d.ts +6 -0
  10. package/dist/components/context/OrganizationSubscriptionsContext.d.ts +9 -0
  11. package/dist/components/context/PurchasesWithVideosContext.d.ts +9 -0
  12. package/dist/components/context/RowItemsContext.d.ts +7 -0
  13. package/dist/components/context/ScreensContext.d.ts +6 -0
  14. package/dist/components/context/SectionsContext.d.ts +6 -0
  15. package/dist/components/context/UserContext.d.ts +9 -0
  16. package/dist/components/context/VideosContext.d.ts +6 -0
  17. package/dist/components/context/index.d.ts +8 -0
  18. package/dist/components/context/types.d.ts +27 -0
  19. package/dist/components/hooks/contentHooks.d.ts +68 -0
  20. package/dist/components/hooks/index.d.ts +18 -0
  21. package/dist/components/hooks/playerHooks.d.ts +23 -0
  22. package/dist/components/hooks/useCancelSubscription.d.ts +2 -0
  23. package/dist/components/hooks/useError.d.ts +9 -0
  24. package/dist/components/hooks/useFreePurchase.d.ts +4 -0
  25. package/dist/components/hooks/useItemsInRow.d.ts +11 -0
  26. package/dist/components/hooks/useOrganizationSubscriptions.d.ts +4 -0
  27. package/dist/components/hooks/useOverlay.d.ts +13 -0
  28. package/dist/components/hooks/usePurchaseSubscription.d.ts +3 -0
  29. package/dist/components/hooks/usePurchasesWithVideos.d.ts +7 -0
  30. package/dist/components/hooks/useRowsInScreen.d.ts +6 -0
  31. package/dist/components/hooks/useScreen.d.ts +12 -0
  32. package/dist/components/hooks/useScreens.d.ts +5 -0
  33. package/dist/components/hooks/useSearch.d.ts +8 -0
  34. package/dist/components/hooks/useTaggedVideos.d.ts +11 -0
  35. package/dist/components/hooks/useTivio.d.ts +3 -0
  36. package/dist/components/hooks/useTransactionPayment.d.ts +3 -0
  37. package/dist/components/hooks/useUser.d.ts +5 -0
  38. package/dist/components/hooks/useWatchWithoutAds.d.ts +5 -0
  39. package/dist/config.d.ts +17 -0
  40. package/dist/index.d.ts +23 -0
  41. package/dist/index.js +1 -0
  42. package/dist/services/bundleLoader.d.ts +16 -0
  43. package/dist/services/bundlePromise.d.ts +4 -0
  44. package/dist/services/dependencyResolver.d.ts +23 -0
  45. package/dist/services/localFetch/coreReactDomDist.d.ts +1 -0
  46. package/dist/services/localFetch/none.d.ts +1 -0
  47. package/dist/services/logger.d.ts +26 -0
  48. package/dist/services/packageLoader.d.ts +6 -0
  49. package/dist/services/pubSub.d.ts +13 -0
  50. package/dist/services/sentry.d.ts +4 -0
  51. package/dist/services/settings.d.ts +13 -0
  52. package/dist/types/bundle.types.d.ts +220 -0
  53. package/dist/types/common.d.ts +6 -0
  54. package/dist/types/config.types.d.ts +0 -0
  55. package/dist/types/customPlayer.types.d.ts +171 -0
  56. package/dist/types/types.d.ts +176 -0
  57. package/package.json +8 -6
package/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Changelog
4
4
  * Unreleased
5
+ * v2.4.0
6
+ * patch: improved Player wrapper types
7
+ * minor: added Tivio DOM events `tivio_key_input_handling_change`, `tivio_context_switch` and `tivio_request_goto`
8
+ * patch: added support for remote code on browsers that do not implement [indexedDB API](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)
5
9
  * patch: added support for browsers that do not implement [indexedDB API](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)
6
10
  * v2.3.4
7
11
  * patch: fix of usePurchaseSubscription not reactive
@@ -179,6 +183,41 @@ function CustomPlayer() {
179
183
  }
180
184
  ```
181
185
 
186
+ ## Tivio DOM events
187
+
188
+ `TivioWidget` triggers these events on `window.document`.
189
+
190
+ 1. To instruct the parent app to navigate to and focus a specific TivioWidget (e.g. after going back from a Tivio screen)
191
+
192
+ ```typescript
193
+ document.addEventListener("tivio_request_goto", e => {
194
+ e.detail.widgetId; // string - Tivio widget ID to go navigate to in UI
195
+ });
196
+ ```
197
+ 2. To notify the parent app about context switch, i.e. where is the user located or what is he focusing
198
+
199
+ ```typescript
200
+ document.addEventListener("tivio_context_switch", e => {
201
+ e.detail.context; // 'tivio' | 'parent' - where is the user located? - in Tivio or in parent app
202
+
203
+ // For context Tivio there are additional fields
204
+ e.detail.context; // 'tivio'
205
+ e.detail.contextLocation; // 'route' | 'overlay' | 'widget' - where in Tivio is the user located?
206
+ // - on a Tivio route, in parent app but looking at a full screen Tivio overlay,
207
+ // or in parent app and focus is on a Tivio widget
208
+
209
+ // For context Tivio contextLocation 'widget' there is an additional field of widget ID
210
+ e.detail.widgetId; // string - which Tivio widget is focused right now
211
+ });
212
+ ```
213
+ 3. To notify the parent app about whether it should be handling key input from RC (TV remote) or not. When inputHandler is 'tivio', the parent app should stop reacting to key input, when inputHandler is 'parent' the parent app should start reacting again.
214
+
215
+ ```typescript
216
+ document.addEventListener("tivio_key_input_handling_change", e => {
217
+ e.detail.inputHandler; // 'tivio' | 'parent' - who should be handling RC input? - Tivio or parent app
218
+ });
219
+ ```
220
+
182
221
  ## Data hooks
183
222
 
184
223
  If you don't want to use TivioWidget, you can implement your own UI using React data hooks.
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const ContextProvider: React.FC;
3
+ export { ContextProvider, };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import React, { FunctionComponentElement } from 'react';
6
+ import type { PlayerWrapper } from '../types/customPlayer.types';
7
+ export declare type PlayerProviderProps = {
8
+ children: React.ReactNode;
9
+ playerWrapperId?: string;
10
+ };
11
+ /**
12
+ * value
13
+ * - undefined - you are trying to access this context but are not inside <PlayerContext /> that is a bug
14
+ * - null - we are waiting for remote code
15
+ * - Player - player is ready
16
+ */
17
+ export declare const PlayerContext: React.Context<PlayerWrapper | null | undefined>;
18
+ export declare const PlayerProvider: ({ children, playerWrapperId, }: PlayerProviderProps) => FunctionComponentElement<PlayerProviderProps>;
19
+ export declare function withPlayerContext(id: string): <P>(WrappedComponent: React.ComponentType<P>) => (props: P) => JSX.Element;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import React from 'react';
6
+ import { RemoteBundleState } from '../services/bundleLoader';
7
+ import { Config } from '../types/bundle.types';
8
+ export declare type TivioProviderProps = {
9
+ /**
10
+ * This prop must be set only once and not change value afterwards
11
+ */
12
+ conf?: Config;
13
+ children: React.ReactNode;
14
+ };
15
+ declare const TivioContext: React.Context<RemoteBundleState | null>;
16
+ export declare const TivioProvider: React.FC<TivioProviderProps>;
17
+ export { TivioContext, };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import React from 'react';
6
+ import type { TivioWidgetProps, TivioWidgetRef } from '../types/types';
7
+ export declare const TivioWidget: React.ForwardRefExoticComponent<Pick<TivioWidgetProps, "id" | "onEnabled" | "onBlur"> & React.RefAttributes<TivioWidgetRef>>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import React from 'react';
6
+ declare type TivioWidgetErrorProps = {
7
+ error: string | null;
8
+ };
9
+ export declare const TivioWidgetError: React.FC<TivioWidgetErrorProps>;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import React from 'react';
6
+ export declare const TivioWidgetLoader: React.FC;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import React from 'react';
6
+ import { TivioProviderProps } from './TivioProvider';
7
+ export declare const TvTivioProvider: React.FC<TivioProviderProps>;
@@ -0,0 +1,6 @@
1
+ import { Channel } from '@tivio/common';
2
+ import React from 'react';
3
+ import type { DataState } from './types';
4
+ declare const ChannelsContext: React.Context<DataState<Channel>>;
5
+ declare const ChannelsContextProvider: React.FC;
6
+ export { ChannelsContext, ChannelsContextProvider, };
@@ -0,0 +1,9 @@
1
+ import { Monetization } from '@tivio/common';
2
+ import React from 'react';
3
+ interface OrganizationSubscriptionsContextState {
4
+ subscriptions: Monetization[];
5
+ setSubscriptions: (subscriptions: Monetization[]) => void;
6
+ }
7
+ declare const OrganizationSubscriptionsContext: React.Context<OrganizationSubscriptionsContextState>;
8
+ declare const OrganizationSubscriptionsContextProvider: React.FC;
9
+ export { OrganizationSubscriptionsContextProvider, OrganizationSubscriptionsContext, };
@@ -0,0 +1,9 @@
1
+ import { Purchase } from '@tivio/common';
2
+ import React from 'react';
3
+ interface PurchasesWithVideosContextState {
4
+ purchases: Purchase[];
5
+ setPurchases: (purchases: Purchase[]) => void;
6
+ }
7
+ declare const PurchasesWithVideosContext: React.Context<PurchasesWithVideosContextState>;
8
+ declare const PurchasesWithVideosContextProvider: React.FC;
9
+ export { PurchasesWithVideosContext, PurchasesWithVideosContextProvider, };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { DataState } from './types';
3
+ import type { Tag, Video } from '@tivio/common';
4
+ declare type Item = Video | Tag;
5
+ declare const RowItemsContext: React.Context<DataState<Item> | null>;
6
+ declare const RowItemsContextProvider: React.FC;
7
+ export { RowItemsContext, RowItemsContextProvider, };
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { SingleDataState } from './types';
3
+ import type { Screen } from '@tivio/common';
4
+ declare const ScreensContext: React.Context<SingleDataState<Screen> | null>;
5
+ declare const ScreensContextProvider: React.FC;
6
+ export { ScreensContext, ScreensContextProvider, };
@@ -0,0 +1,6 @@
1
+ import { Section } from '@tivio/common';
2
+ import React from 'react';
3
+ import { DataState } from './types';
4
+ declare const SectionsContext: React.Context<DataState<Section>>;
5
+ declare const SectionsContextProvider: React.FC;
6
+ export { SectionsContext, SectionsContextProvider, };
@@ -0,0 +1,9 @@
1
+ import { User } from '@tivio/common';
2
+ import React from 'react';
3
+ interface UserContextState {
4
+ user: User | null;
5
+ setUser: (user: User) => void;
6
+ }
7
+ declare const UserContext: React.Context<UserContextState>;
8
+ declare const UserContextProvider: React.FC;
9
+ export { UserContextProvider, UserContext, };
@@ -0,0 +1,6 @@
1
+ import { Video } from '@tivio/common';
2
+ import React from 'react';
3
+ import { DataState } from './types';
4
+ declare const VideosContext: React.Context<DataState<Video>>;
5
+ declare const VideosContextProvider: React.FC;
6
+ export { VideosContext, VideosContextProvider, };
@@ -0,0 +1,8 @@
1
+ export * from './ChannelsContext';
2
+ export * from './OrganizationSubscriptionsContext';
3
+ export * from './PurchasesWithVideosContext';
4
+ export * from './ScreensContext';
5
+ export * from './SectionsContext';
6
+ export * from './UserContext';
7
+ export * from './VideosContext';
8
+ export * from './RowItemsContext';
@@ -0,0 +1,27 @@
1
+ export interface SingleHookData<T> {
2
+ data: T | null;
3
+ error: Error | null;
4
+ isLoading: boolean;
5
+ }
6
+ export interface SingleDataState<T> {
7
+ data: {
8
+ [key: string]: SingleHookData<T>;
9
+ };
10
+ setData: (key: string, data: SingleHookData<T>) => void;
11
+ }
12
+ export declare type PaginationData<T> = {
13
+ items: T[];
14
+ hasNextPage: boolean;
15
+ fetchMore: Function;
16
+ };
17
+ export interface HookData<T> {
18
+ data: PaginationData<T> | null;
19
+ error: Error | null;
20
+ isLoading: boolean;
21
+ }
22
+ export interface DataState<T> {
23
+ data: {
24
+ [key: string]: HookData<T>;
25
+ };
26
+ setData: (key: string, data: HookData<T>) => void;
27
+ }
@@ -0,0 +1,68 @@
1
+ import { Channel, Section, Video, Widget } from '../..';
2
+ import { ChannelsContext, SectionsContext, VideosContext } from '../context';
3
+ /**
4
+ * Use widget
5
+ * @param widgetId - widget id
6
+ */
7
+ declare const useWidget: (widgetId: string) => {
8
+ error: string;
9
+ widget: Widget | null;
10
+ };
11
+ /**
12
+ * Use channel
13
+ * @param channelId - channel id
14
+ */
15
+ declare const useChannel: (channelId: string) => {
16
+ error: string | null;
17
+ data: Channel | null;
18
+ };
19
+ /**
20
+ * Use section
21
+ * @param sectionId - section id
22
+ */
23
+ declare const useSection: (sectionId: string) => {
24
+ error: string | null;
25
+ data: Section | null;
26
+ };
27
+ /**
28
+ * Use video
29
+ * @param videoId - video id
30
+ */
31
+ declare const useVideo: (videoId?: string | undefined) => {
32
+ error: string | null;
33
+ data: Video | null;
34
+ };
35
+ /**
36
+ * Use videos in section
37
+ * @param sectionId - section id
38
+ * @param [limit] - videos count, defaults to 10
39
+ */
40
+ declare const useVideosInSection: (sectionId?: string | undefined, limit?: number) => {
41
+ error: Error | null;
42
+ data: import("../context/types").PaginationData<Video> | null;
43
+ isLoading: boolean;
44
+ };
45
+ /**
46
+ * Use section in channel
47
+ * @param channelId - channel id
48
+ * @param [limit] - sections count, defaults to 10
49
+ */
50
+ declare const useSectionsInChannel: (channelId: string, limit?: number) => {
51
+ error: Error | null;
52
+ data: import("../context/types").PaginationData<import("@tivio/common/dist/types/externalTypes/section").Section> | null;
53
+ isLoading: boolean;
54
+ };
55
+ /**
56
+ * Use channels in widget
57
+ * @param widgetId - widget id
58
+ * @param [limit] - channels count, defaults to 10
59
+ */
60
+ declare const useChannelsInWidget: (widgetId: string, limit?: number) => {
61
+ error: Error | null;
62
+ data: import("../context/types").PaginationData<import("@tivio/common/dist/types/externalTypes/channel").Channel> | null;
63
+ isLoading: boolean;
64
+ };
65
+ declare const useIsLoaded: () => {
66
+ isTivioLoaded: boolean;
67
+ };
68
+ export { useWidget, useChannel, useIsLoaded, useSection, useVideo, useVideosInSection, useSectionsInChannel, useChannelsInWidget, VideosContext, SectionsContext, ChannelsContext, };
@@ -0,0 +1,18 @@
1
+ export * from './useUser';
2
+ export * from './useTaggedVideos';
3
+ export * from './useScreens';
4
+ export * from './useScreen';
5
+ export * from './useSearch';
6
+ export * from './useItemsInRow';
7
+ export * from './useCancelSubscription';
8
+ export * from './useTransactionPayment';
9
+ export * from './usePurchaseSubscription';
10
+ export * from './contentHooks';
11
+ export * from './playerHooks';
12
+ export * from './useOrganizationSubscriptions';
13
+ export * from './usePurchasesWithVideos';
14
+ export * from './useFreePurchase';
15
+ export * from './useRowsInScreen';
16
+ export * from './useTivio';
17
+ export * from './useOverlay';
18
+ export * from './useWatchWithoutAds';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import type { AdSource, UsePlayerEvent } from '../../types/customPlayer.types';
6
+ import type { BetOffer, Marker } from '../../types/types';
7
+ export declare const usePlayerEvent: UsePlayerEvent;
8
+ export declare const useMarkers: () => Marker[] | null;
9
+ export declare const useBetOffer: () => BetOffer | null;
10
+ interface IntroMarker {
11
+ marker: Marker;
12
+ skip: () => void;
13
+ }
14
+ export declare const useIntro: () => IntroMarker | null;
15
+ export declare const useAd: () => AdSource | null;
16
+ export declare const useCurrentMarker: () => Marker | null;
17
+ export declare const useSeekState: () => boolean | null;
18
+ interface AdSegment {
19
+ remainingMs: number;
20
+ canSeek: boolean;
21
+ }
22
+ export declare const useAdSegment: () => AdSegment | null;
23
+ export {};
@@ -0,0 +1,2 @@
1
+ import { UseCancelSubscription } from '@tivio/common';
2
+ export declare const useCancelSubscription: UseCancelSubscription;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Hook for displaying errors in UI components
3
+ */
4
+ declare const useError: () => {
5
+ error: Error | null;
6
+ raiseError: (error: Error) => void;
7
+ resetError: () => void;
8
+ };
9
+ export { useError, };
@@ -0,0 +1,4 @@
1
+ declare const useFreePurchase: () => {
2
+ purchase: (monetizationId: string) => Promise<void>;
3
+ };
4
+ export { useFreePurchase, };
@@ -0,0 +1,11 @@
1
+ import { PaginationInterface, SubscribeToItemsInRowOptions, Tag, Video } from '@tivio/common';
2
+ /**
3
+ * Use row items
4
+ * @param rowId - row ID
5
+ * @param options - subscription options
6
+ */
7
+ declare const useItemsInRow: (rowId: string, options?: SubscribeToItemsInRowOptions) => {
8
+ pagination: PaginationInterface<Video | Tag> | null;
9
+ error: Error | null;
10
+ };
11
+ export { useItemsInRow, };
@@ -0,0 +1,4 @@
1
+ declare const useOrganizationSubscriptions: () => {
2
+ subscriptions: import("@tivio/common").Monetization[];
3
+ };
4
+ export { useOrganizationSubscriptions, };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Displays overlay to purchase "watch without ads mode" if available.
3
+ * This overlay can be hidden by pressing BACK button on RC.
4
+ */
5
+ export declare const useOverlayToPurchaseWatchWithoutAds: () => {
6
+ showOverlay: () => void;
7
+ };
8
+ interface Callbacks {
9
+ onShow: () => void;
10
+ onHide: () => void;
11
+ }
12
+ export declare const useRegisterOverlayCallbacks: (callbacks: Callbacks) => void;
13
+ export {};
@@ -0,0 +1,3 @@
1
+ import { QerkoTransaction } from '@tivio/common';
2
+ declare const usePurchaseSubscription: (monetizationId: string) => QerkoTransaction;
3
+ export { usePurchaseSubscription, };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Return purchases with initialized video (purchases[i].video not null)
3
+ */
4
+ declare const usePurchasesWithVideos: () => {
5
+ purchases: import("@tivio/common/dist/types/externalTypes/user").Purchase[];
6
+ };
7
+ export { usePurchasesWithVideos, };
@@ -0,0 +1,6 @@
1
+ import { PaginationInterface, PaginationOptions, Row } from '@tivio/common';
2
+ declare const useRowsInScreen: (screenId: string, options?: PaginationOptions) => {
3
+ pagination: PaginationInterface<Row> | null;
4
+ error: Error | null;
5
+ };
6
+ export { useRowsInScreen, };
@@ -0,0 +1,12 @@
1
+ import { ScreenOptions } from '@tivio/common';
2
+ /**
3
+ * Use app screen
4
+ * @param screenId - screen ID
5
+ * @param options - subscribe to screen options
6
+ */
7
+ declare const useScreen: (screenId: string, options?: ScreenOptions | undefined) => {
8
+ error: Error | null;
9
+ data: import("@tivio/common").Screen | null;
10
+ isLoading: boolean;
11
+ };
12
+ export { useScreen, };
@@ -0,0 +1,5 @@
1
+ import { Screen } from '@tivio/common';
2
+ declare const useScreens: () => {
3
+ screens: Screen[];
4
+ };
5
+ export { useScreens, };
@@ -0,0 +1,8 @@
1
+ import { ALGOLIA_INDEX_NAME, UseSearch } from '@tivio/common';
2
+ /**
3
+ * Full text search that returns entities based on search query.
4
+ * @param indexName - index that search would be performed on ('videos', 'tags', etc.)
5
+ * @param options - pagination options
6
+ */
7
+ export declare const useSearch: UseSearch;
8
+ export { ALGOLIA_INDEX_NAME };
@@ -0,0 +1,11 @@
1
+ import { PaginationInterface, SubscribeToItemsInRowOptions, Video } from '@tivio/common';
2
+ /**
3
+ * Returns videos with given tag ids
4
+ * @param tagIds - tag ids
5
+ * @param options - subscription options
6
+ */
7
+ declare const useTaggedVideos: (tagIds: string[], options?: SubscribeToItemsInRowOptions) => {
8
+ pagination: PaginationInterface<Video> | null;
9
+ error: Error | null;
10
+ };
11
+ export { useTaggedVideos, };
@@ -0,0 +1,3 @@
1
+ declare const useTivioData: () => import("../../types/bundle.types").RemoteBundleState;
2
+ declare const useTivioReadyData: () => import("../../types/bundle.types").RemoteBundleState | null;
3
+ export { useTivioData, useTivioReadyData, };
@@ -0,0 +1,3 @@
1
+ import { QerkoTransaction } from '@tivio/common';
2
+ declare const useTransactionPayment: (videoId: string, monetizationId: string) => QerkoTransaction;
3
+ export { useTransactionPayment, };
@@ -0,0 +1,5 @@
1
+ declare const useUser: () => {
2
+ user: import("@tivio/common/dist/types/externalTypes/user").User | null;
3
+ error: string | null;
4
+ };
5
+ export { useUser, };
@@ -0,0 +1,5 @@
1
+ export declare const useCanPurchaseWatchWithoutAds: () => boolean;
2
+ export declare const useWatchWithoutAds: () => {
3
+ canPurchaseWatchWithoutAds: boolean;
4
+ showOverlay: () => void;
5
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) 2021, nangu.TV, a.s. All rights reserved.
3
+ * nangu.TV, a.s PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
4
+ */
5
+ import { Config as ExternalConfig, InternalConfig } from './types/bundle.types';
6
+ export declare const defaultConf: {
7
+ secret: null;
8
+ resolverUrl: string;
9
+ disableUnmounting: boolean;
10
+ fetchPackage: import("./services/packageLoader").FetchPackage;
11
+ pubSub: import("./types/bundle.types").PubSub;
12
+ LoaderComponent: import("react").FC<{}>;
13
+ ErrorComponent: import("react").FC<{
14
+ error: string | null;
15
+ }>;
16
+ };
17
+ export declare const createInternalConf: (conf: ExternalConfig | null) => InternalConfig;
@@ -0,0 +1,23 @@
1
+ export { PlayerProvider, withPlayerContext } from './components/PlayerProvider';
2
+ export type { PlayerProviderProps } from './components/PlayerProvider';
3
+ export { bundlePromise } from './services/bundlePromise';
4
+ export * from './components/hooks';
5
+ export * from './components/TivioProvider';
6
+ export * from './components/TivioWidget';
7
+ export * from './components/TivioWidgetError';
8
+ export * from './components/TvTivioProvider';
9
+ export * from './components/TivioWidgetLoader';
10
+ export * from './types/customPlayer.types';
11
+ export * from './services/bundleLoader';
12
+ export * from './services/pubSub';
13
+ export * from './types/types';
14
+ export { Disposer } from './types/common';
15
+ export { Empty } from './types/common';
16
+ export { Nullable } from './types/common';
17
+ export { Config } from './types/bundle.types';
18
+ export { TivioBundle } from './types/bundle.types';
19
+ export { TivioHooks } from './types/bundle.types';
20
+ export { TivioComponents } from './types/bundle.types';
21
+ export { TivioAuth } from './types/bundle.types';
22
+ export { TivioGetters } from './types/bundle.types';
23
+ export { TivioSubscriptions } from './types/bundle.types';