@tivio/sdk-react 3.5.2 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +6 -3
- package/README.md.bak +6 -3
- package/dist/index.d.ts +1729 -21
- package/dist/index.js +1 -2
- package/package.json +10 -7
- package/dist/components/ContextProvider.d.ts +0 -7
- package/dist/components/PlayerProvider.d.ts +0 -19
- package/dist/components/TivioProvider.d.ts +0 -16
- package/dist/components/TivioWidget.d.ts +0 -7
- package/dist/components/TivioWidgetError.d.ts +0 -10
- package/dist/components/TivioWidgetLoader.d.ts +0 -6
- package/dist/components/TvTivioProvider.d.ts +0 -7
- package/dist/components/context/ChannelsContext.d.ts +0 -6
- package/dist/components/context/RowItemsContext.d.ts +0 -7
- package/dist/components/context/ScreensContext.d.ts +0 -6
- package/dist/components/context/SectionsContext.d.ts +0 -6
- package/dist/components/context/VideosContext.d.ts +0 -6
- package/dist/components/context/index.d.ts +0 -5
- package/dist/components/context/types.d.ts +0 -27
- package/dist/components/hooks/contentHooks.d.ts +0 -68
- package/dist/components/hooks/index.d.ts +0 -22
- package/dist/components/hooks/playerHooks.d.ts +0 -28
- package/dist/components/hooks/useApplyInviteCode.d.ts +0 -17
- package/dist/components/hooks/useCancelSubscription.d.ts +0 -2
- package/dist/components/hooks/useError.d.ts +0 -9
- package/dist/components/hooks/useFreePurchase.d.ts +0 -4
- package/dist/components/hooks/useIsMonetizationPurchased.d.ts +0 -3
- package/dist/components/hooks/useItemsInRow.d.ts +0 -11
- package/dist/components/hooks/useLastVideoByWidgetId.d.ts +0 -5
- package/dist/components/hooks/useOrganizationSubscriptions.d.ts +0 -3
- package/dist/components/hooks/usePurchaseRecovery.d.ts +0 -14
- package/dist/components/hooks/usePurchaseSubscription.d.ts +0 -4
- package/dist/components/hooks/usePurchasesWithVideos.d.ts +0 -7
- package/dist/components/hooks/useRowsInScreen.d.ts +0 -6
- package/dist/components/hooks/useScreen.d.ts +0 -10
- package/dist/components/hooks/useScreens.d.ts +0 -5
- package/dist/components/hooks/useSearch.d.ts +0 -8
- package/dist/components/hooks/useTaggedVideos.d.ts +0 -11
- package/dist/components/hooks/useTivio.d.ts +0 -3
- package/dist/components/hooks/useTransactionPayment.d.ts +0 -5
- package/dist/components/hooks/useUser.d.ts +0 -5
- package/dist/components/hooks/useVoucher.d.ts +0 -42
- package/dist/components/hooks/useWatchWithoutAdsOffer.d.ts +0 -4
- package/dist/config.d.ts +0 -20
- package/dist/index.js.LICENSE.txt +0 -335
- package/dist/info.d.ts +0 -2
- package/dist/services/bundleLoader.d.ts +0 -15
- package/dist/services/bundlePromise.d.ts +0 -7
- package/dist/services/dependencyResolver.d.ts +0 -24
- package/dist/services/gdpr.d.ts +0 -1
- package/dist/services/localFetch/coreReactDomDist.d.ts +0 -1
- package/dist/services/localFetch/none.d.ts +0 -1
- package/dist/services/logger.d.ts +0 -26
- package/dist/services/login.d.ts +0 -9
- package/dist/services/packageLoader.d.ts +0 -6
- package/dist/services/pubSub.d.ts +0 -13
- package/dist/services/sentry.d.ts +0 -4
- package/dist/services/settings.d.ts +0 -13
- package/dist/types/bundle.types.d.ts +0 -444
- package/dist/types/common.d.ts +0 -6
- package/dist/types/config.types.d.ts +0 -0
- package/dist/types/customPlayer.types.d.ts +0 -171
- package/dist/types/types.d.ts +0 -174
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tivio/sdk-react",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.6.0",
|
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.
|
32
|
+
"@tivio/common": "1.1.90",
|
32
33
|
"dayjs": "^1.11.0",
|
33
34
|
"es7-object-polyfill": "^1.0.1",
|
34
|
-
"firebase": "
|
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,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,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,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,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,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,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,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,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,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, };
|
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;
|