@tivio/sdk-react 3.5.2 → 3.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/README.md +12 -3
  2. package/README.md.bak +12 -3
  3. package/dist/index.d.ts +1946 -21
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.LICENSE.txt +12 -0
  6. package/package.json +10 -7
  7. package/dist/components/ContextProvider.d.ts +0 -7
  8. package/dist/components/PlayerProvider.d.ts +0 -19
  9. package/dist/components/TivioProvider.d.ts +0 -16
  10. package/dist/components/TivioWidget.d.ts +0 -7
  11. package/dist/components/TivioWidgetError.d.ts +0 -10
  12. package/dist/components/TivioWidgetLoader.d.ts +0 -6
  13. package/dist/components/TvTivioProvider.d.ts +0 -7
  14. package/dist/components/context/ChannelsContext.d.ts +0 -6
  15. package/dist/components/context/RowItemsContext.d.ts +0 -7
  16. package/dist/components/context/ScreensContext.d.ts +0 -6
  17. package/dist/components/context/SectionsContext.d.ts +0 -6
  18. package/dist/components/context/VideosContext.d.ts +0 -6
  19. package/dist/components/context/index.d.ts +0 -5
  20. package/dist/components/context/types.d.ts +0 -27
  21. package/dist/components/hooks/contentHooks.d.ts +0 -68
  22. package/dist/components/hooks/index.d.ts +0 -22
  23. package/dist/components/hooks/playerHooks.d.ts +0 -28
  24. package/dist/components/hooks/useApplyInviteCode.d.ts +0 -17
  25. package/dist/components/hooks/useCancelSubscription.d.ts +0 -2
  26. package/dist/components/hooks/useError.d.ts +0 -9
  27. package/dist/components/hooks/useFreePurchase.d.ts +0 -4
  28. package/dist/components/hooks/useIsMonetizationPurchased.d.ts +0 -3
  29. package/dist/components/hooks/useItemsInRow.d.ts +0 -11
  30. package/dist/components/hooks/useLastVideoByWidgetId.d.ts +0 -5
  31. package/dist/components/hooks/useOrganizationSubscriptions.d.ts +0 -3
  32. package/dist/components/hooks/usePurchaseRecovery.d.ts +0 -14
  33. package/dist/components/hooks/usePurchaseSubscription.d.ts +0 -4
  34. package/dist/components/hooks/usePurchasesWithVideos.d.ts +0 -7
  35. package/dist/components/hooks/useRowsInScreen.d.ts +0 -6
  36. package/dist/components/hooks/useScreen.d.ts +0 -10
  37. package/dist/components/hooks/useScreens.d.ts +0 -5
  38. package/dist/components/hooks/useSearch.d.ts +0 -8
  39. package/dist/components/hooks/useTaggedVideos.d.ts +0 -11
  40. package/dist/components/hooks/useTivio.d.ts +0 -3
  41. package/dist/components/hooks/useTransactionPayment.d.ts +0 -5
  42. package/dist/components/hooks/useUser.d.ts +0 -5
  43. package/dist/components/hooks/useVoucher.d.ts +0 -42
  44. package/dist/components/hooks/useWatchWithoutAdsOffer.d.ts +0 -4
  45. package/dist/config.d.ts +0 -20
  46. package/dist/info.d.ts +0 -2
  47. package/dist/services/bundleLoader.d.ts +0 -15
  48. package/dist/services/bundlePromise.d.ts +0 -7
  49. package/dist/services/dependencyResolver.d.ts +0 -24
  50. package/dist/services/gdpr.d.ts +0 -1
  51. package/dist/services/localFetch/coreReactDomDist.d.ts +0 -1
  52. package/dist/services/localFetch/none.d.ts +0 -1
  53. package/dist/services/logger.d.ts +0 -26
  54. package/dist/services/login.d.ts +0 -9
  55. package/dist/services/packageLoader.d.ts +0 -6
  56. package/dist/services/pubSub.d.ts +0 -13
  57. package/dist/services/sentry.d.ts +0 -4
  58. package/dist/services/settings.d.ts +0 -13
  59. package/dist/types/bundle.types.d.ts +0 -444
  60. package/dist/types/common.d.ts +0 -6
  61. package/dist/types/config.types.d.ts +0 -0
  62. package/dist/types/customPlayer.types.d.ts +0 -171
  63. package/dist/types/types.d.ts +0 -174
@@ -2,6 +2,10 @@
2
2
  !*** ./src/index.ts ***!
3
3
  \**********************/
4
4
 
5
+ /*!***********************!*\
6
+ !*** ./src/search.ts ***!
7
+ \***********************/
8
+
5
9
  /*!***********************!*\
6
10
  !*** external "mobx" ***!
7
11
  \***********************/
@@ -30,6 +34,10 @@
30
34
  !*** ./src/i18n/utils.ts ***!
31
35
  \***************************/
32
36
 
37
+ /*!***************************!*\
38
+ !*** ./src/pagination.ts ***!
39
+ \***************************/
40
+
33
41
  /*!***************************!*\
34
42
  !*** ./src/utils/math.ts ***!
35
43
  \***************************/
@@ -94,6 +102,10 @@
94
102
  !*** ./src/utils/logger.ts ***!
95
103
  \*****************************/
96
104
 
105
+ /*!******************************!*\
106
+ !*** ../types/dist/index.js ***!
107
+ \******************************/
108
+
97
109
  /*!******************************!*\
98
110
  !*** ./src/filters/index.ts ***!
99
111
  \******************************/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-react",
3
- "version": "3.5.2",
3
+ "version": "3.6.2",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",
@@ -9,16 +9,17 @@
9
9
  "access": "public"
10
10
  },
11
11
  "scripts": {
12
- "build": "bash ./scripts/build_prod.sh",
13
- "build:dev": "bash ./scripts/build_dev.sh",
14
- "build:local": "bash ./scripts/build_with_local_bundle.sh",
12
+ "build": "bash ./scripts/build_prod.sh && yarn typesRollup",
13
+ "build:dev": "bash ./scripts/build_dev.sh && yarn typesRollup",
14
+ "build:local": "bash ./scripts/build_with_local_bundle.sh && yarn typesRollup",
15
15
  "start": "yarn ts-node ./scripts/start.ts",
16
16
  "test": "jest --config=./jest.config.js --coverage",
17
17
  "clean": "rm -rf dist",
18
18
  "prepublishOnly": "yarn && yarn run build && yarn ts-node ./scripts/prepublish.ts",
19
19
  "postpublish": "yarn ts-node ./scripts/postpublish.ts",
20
20
  "publish:alpha": "npm publish --tag alpha",
21
- "check:cycles": "npx madge --circular src/**/*"
21
+ "check:cycles": "npx madge --circular src/**/*",
22
+ "typesRollup": "yarn ts-node ./scripts/typesRollup.ts"
22
23
  },
23
24
  "peerDependencies": {
24
25
  "react": "^17.0.0",
@@ -28,10 +29,10 @@
28
29
  "@material-ui/core": "^4.11.2",
29
30
  "@material-ui/icons": "^4.11.2",
30
31
  "@sentry/browser": "^6.1.0",
31
- "@tivio/common": "1.1.89",
32
+ "@tivio/common": "1.1.92",
32
33
  "dayjs": "^1.11.0",
33
34
  "es7-object-polyfill": "^1.0.1",
34
- "firebase": "^8.2.3",
35
+ "firebase": "8.10.1",
35
36
  "formik": "^2.2.7",
36
37
  "i18next": "^19.8.4",
37
38
  "mobx": "^6.0.4",
@@ -45,10 +46,12 @@
45
46
  "yup": "^0.32.9"
46
47
  },
47
48
  "devDependencies": {
49
+ "@microsoft/api-extractor": "^7.23.0",
48
50
  "@testing-library/jest-dom": "^5.11.9",
49
51
  "@testing-library/react": "^11.2.3",
50
52
  "@testing-library/react-hooks": "^5.0.3",
51
53
  "@testing-library/user-event": "^12.1.10",
54
+ "@tivio/types": "*",
52
55
  "@types/jest": "^26.0.15",
53
56
  "@types/node": "^12.0.0",
54
57
  "@types/node-fetch": "^2.5.8",
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { RemoteBundleState } from '../types/bundle.types';
3
- interface Props {
4
- bundleState: RemoteBundleState;
5
- }
6
- declare const ContextProvider: React.FC<Props>;
7
- export { ContextProvider, };
@@ -1,19 +0,0 @@
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;
@@ -1,16 +0,0 @@
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 { Config, RemoteBundleState } from '../types/bundle.types';
7
- export declare type TivioProviderProps = {
8
- /**
9
- * This prop must be set only once and not change value afterwards
10
- */
11
- conf: Config | undefined | null;
12
- children: React.ReactNode;
13
- };
14
- declare const TivioContext: React.Context<RemoteBundleState | null>;
15
- export declare const TivioProvider: React.FC<TivioProviderProps>;
16
- export { TivioContext, };
@@ -1,7 +0,0 @@
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>>;
@@ -1,10 +0,0 @@
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 {};
@@ -1,6 +0,0 @@
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;
@@ -1,7 +0,0 @@
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>;
@@ -1,6 +0,0 @@
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, };
@@ -1,7 +0,0 @@
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, };
@@ -1,6 +0,0 @@
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, };
@@ -1,6 +0,0 @@
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, };
@@ -1,6 +0,0 @@
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, };
@@ -1,5 +0,0 @@
1
- export * from './ChannelsContext';
2
- export * from './ScreensContext';
3
- export * from './SectionsContext';
4
- export * from './VideosContext';
5
- export * from './RowItemsContext';
@@ -1,27 +0,0 @@
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
- }
@@ -1,68 +0,0 @@
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
- data: Video | null;
33
- error: string | 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").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").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, };
@@ -1,22 +0,0 @@
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 './usePurchaseRecovery';
10
- export * from './usePurchaseSubscription';
11
- export * from './contentHooks';
12
- export * from './playerHooks';
13
- export * from './useOrganizationSubscriptions';
14
- export * from './useIsMonetizationPurchased';
15
- export * from './usePurchasesWithVideos';
16
- export * from './useFreePurchase';
17
- export * from './useRowsInScreen';
18
- export * from './useVoucher';
19
- export * from './useTivio';
20
- export * from './useLastVideoByWidgetId';
21
- export * from './useWatchWithoutAdsOffer';
22
- export * from './useApplyInviteCode';
@@ -1,28 +0,0 @@
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 { 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: () => import("../../types/customPlayer.types").AdSource | null;
16
- export declare const useCurrentMarker: () => Marker | null;
17
- export declare const useSeekState: () => boolean | null;
18
- export declare const useAdSegment: () => {
19
- id: string;
20
- remainingMs: number;
21
- secondsToEnd: number;
22
- secondsToSkippable: number | null;
23
- canSeek: boolean;
24
- canSkip: boolean;
25
- isSkippable: boolean;
26
- skip: () => any;
27
- } | null;
28
- export {};
@@ -1,17 +0,0 @@
1
- /**
2
- * Is used to login user through different device in which user is already logged in.
3
- * (e.g. login in tv app through web app)
4
- *
5
- * @return applyInviteCodeResult - true if code was applied successfully, false otherwise.
6
- * loading - loading state
7
- * error - error in case request failure
8
- * applyInviteCode - function to apply invite code
9
- * inviteCodeReset - function to reset to initial state
10
- */
11
- export declare function useApplyInviteCode(): {
12
- applyInviteCodeResult?: boolean | undefined;
13
- loading: boolean;
14
- error?: import("../..").GenericOnCallError | undefined;
15
- applyInviteCode: (code: string) => void;
16
- inviteCodeReset: () => void;
17
- };
@@ -1,2 +0,0 @@
1
- import { UseCancelSubscription } from '@tivio/common';
2
- export declare const useCancelSubscription: UseCancelSubscription;
@@ -1,9 +0,0 @@
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, };
@@ -1,4 +0,0 @@
1
- declare const useFreePurchase: () => {
2
- purchase: (monetizationId: string) => Promise<void>;
3
- };
4
- export { useFreePurchase, };
@@ -1,3 +0,0 @@
1
- export declare const useIsMonetizationPurchased: () => {
2
- isOneOfSubscriptionPurchased: (subscriptionIds: string[]) => boolean;
3
- };
@@ -1,11 +0,0 @@
1
- import { ItemsInRow, PaginationInterface, SubscribeToItemsInRowOptions } 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<ItemsInRow> | null;
9
- error: Error | null;
10
- };
11
- export { useItemsInRow, };
@@ -1,5 +0,0 @@
1
- import { Video } from '@tivio/common';
2
- /**
3
- * @deprecated will be removed in v4
4
- */
5
- export declare function useLastVideoByWidgetId(widgetId: string): Video | null;
@@ -1,3 +0,0 @@
1
- export declare const useOrganizationSubscriptions: () => {
2
- subscriptions: import("@tivio/common").Monetization[];
3
- };
@@ -1,14 +0,0 @@
1
- /**
2
- * Is used to mark purchase in recovery state as PAID.
3
- *
4
- * @return purchaseRecoveryResult - message describing result of the recovery
5
- * loading - loading state
6
- * error - error in case request failure
7
- * purchaseRecovery - functions to execute purchase recovery
8
- */
9
- export declare function usePurchaseRecovery(): {
10
- purchaseRecoveryResult?: string | undefined;
11
- loading: boolean;
12
- error?: import("../..").GenericOnCallError | undefined;
13
- purchaseRecovery: (monetizationId: string) => void;
14
- };
@@ -1,4 +0,0 @@
1
- import { QerkoTransaction } from '@tivio/common';
2
- import { NewVoucher } from '../../types/bundle.types';
3
- declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher | undefined) => QerkoTransaction;
4
- export { usePurchaseSubscription, };
@@ -1,7 +0,0 @@
1
- /**
2
- * Return purchases with initialized video (purchases[i].video not null)
3
- */
4
- declare const usePurchasesWithVideos: () => {
5
- purchases: import("@tivio/common").Purchase[];
6
- };
7
- export { usePurchasesWithVideos, };
@@ -1,6 +0,0 @@
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, };
@@ -1,10 +0,0 @@
1
- import { ScreenOptions } from '@tivio/common';
2
- /**
3
- * @deprecated
4
- *
5
- * Use app screen
6
- * @param screenId - screen ID
7
- * @param options - subscribe to screen options
8
- */
9
- declare const useScreen: (screenId: string, options?: ScreenOptions | undefined) => never;
10
- export { useScreen, };
@@ -1,5 +0,0 @@
1
- import { Screen } from '@tivio/common';
2
- declare const useScreens: () => {
3
- screens: Screen[];
4
- };
5
- export { useScreens, };
@@ -1,8 +0,0 @@
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 };
@@ -1,11 +0,0 @@
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, };
@@ -1,3 +0,0 @@
1
- declare const useTivioData: () => import("../../types/bundle.types").RemoteBundleState;
2
- declare const useTivioReadyData: () => import("../../types/bundle.types").RemoteBundleState | null;
3
- export { useTivioData, useTivioReadyData, };
@@ -1,5 +0,0 @@
1
- import { QerkoTransaction } from '@tivio/common';
2
- import { NewVoucher } from '../../types/bundle.types';
3
- declare const useTransactionPayment: (videoId: string, monetizationId: string, voucher?: NewVoucher | undefined) => QerkoTransaction;
4
- export { useTransactionPayment, };
5
- export type { NewVoucher, };
@@ -1,5 +0,0 @@
1
- export declare const useUser: () => {
2
- user: import("@tivio/common").User | null;
3
- error: string | null;
4
- isInitialized: boolean;
5
- };
@@ -1,42 +0,0 @@
1
- export declare type BadRequestError = Error & {
2
- details?: {
3
- reason?: 'DOES_NOT_EXIST' | 'EXPIRED' | 'ALREADY_USED';
4
- };
5
- };
6
- /**
7
- * TODO: Should be in core-js, we can't import types from it, though.
8
- */
9
- declare type Voucher = {
10
- activate: () => void;
11
- isUsed: boolean;
12
- isExpired: boolean;
13
- status: 'NEW' | 'USED';
14
- voucherInfo: SubscriptionInfo | TransactionInfo;
15
- };
16
- declare type SubscriptionInfo = {
17
- type: 'subscription';
18
- name: string;
19
- benefits: string[];
20
- frequency: string;
21
- };
22
- declare type TransactionInfo = {
23
- type: 'transaction';
24
- name: string;
25
- videoId: string;
26
- cover: string;
27
- description: string;
28
- };
29
- declare const useVoucher: (voucherId: string) => {
30
- activate: (() => Promise<void>) | null;
31
- voucher: Voucher | null;
32
- /**
33
- * You can check error.details if you need to know error type when you want your own error messages
34
- * (can be one of "DOES_NOT_EXIST", "EXPIRED" and "ALREADY_USED").
35
- */
36
- error: Error | BadRequestError | null;
37
- /**
38
- * True if voucher has been successfully activated in current session.
39
- */
40
- activationSuccess: boolean;
41
- };
42
- export { useVoucher, };
@@ -1,4 +0,0 @@
1
- export declare const useWatchWithoutAdsOffer: () => {
2
- canPurchaseWatchWithoutAds: boolean;
3
- showPurchaseDialog: () => void;
4
- };
package/dist/config.d.ts DELETED
@@ -1,20 +0,0 @@
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
- /// <reference types="react" />
6
- import type { Config as ExternalConfig, InternalConfig } from './types/bundle.types';
7
- import type { Currency } from '@tivio/common';
8
- export declare const defaultConf: {
9
- secret: null;
10
- resolverUrl: string;
11
- currency: Currency;
12
- disableUnmounting: boolean;
13
- fetchPackage: import("./services/packageLoader").FetchPackage;
14
- pubSub: import("./types/bundle.types").PubSub;
15
- LoaderComponent: import("react").FC<{}>;
16
- ErrorComponent: import("react").FC<{
17
- error: string | null;
18
- }>;
19
- };
20
- export declare const createInternalConf: (conf: ExternalConfig | undefined | null) => InternalConfig;
package/dist/info.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const logInfo: () => void;
2
- export { logInfo };
@@ -1,15 +0,0 @@
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 { InternalConfig, RemoteBundleState, TivioBundle } from '../types/bundle.types';
6
- /**
7
- * @throws if fetch fails
8
- */
9
- declare const fetchBundle: (secret: string, conf: InternalConfig) => Promise<string>;
10
- /**
11
- * Fetch & load CommonJS remote module.
12
- */
13
- declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig) => Promise<TivioBundle>;
14
- declare const createUseRemoteBundle: () => (conf: InternalConfig) => RemoteBundleState;
15
- export { fetchBundle, createRemotePackageLoader, createUseRemoteBundle, };
@@ -1,7 +0,0 @@
1
- import { TivioBundle } from '../types/bundle.types';
2
- import type { RemoteBundleState } from '../types/bundle.types';
3
- export declare let tivioBundle: TivioBundle | null;
4
- /**
5
- * rejects when bundle is not available
6
- */
7
- export declare const bundlePromise: Promise<RemoteBundleState>;