@tivio/sdk-react 10.0.0 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -2
- package/README.md.bak +86 -2
- package/dist/index.d.ts +325 -124
- package/dist/index.js +1 -1
- package/dist/sdk-react.d.ts +325 -124
- package/package.json +4 -2
- package/CHANGELOG.md +0 -329
package/dist/sdk-react.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import { DocumentReference } from '@firebase/firestore-types';
|
|
3
3
|
import type duration from 'dayjs/plugin/duration';
|
|
4
|
-
import type
|
|
5
|
-
import type { default as firebase_3 } from 'firebase';
|
|
4
|
+
import type firebase from '@firebase/app-types';
|
|
6
5
|
import { FunctionComponentElement } from 'react';
|
|
7
6
|
import type { GeoPoint } from '@firebase/firestore-types';
|
|
8
7
|
import { OperatingSystem } from 'detect-browser';
|
|
@@ -26,7 +25,22 @@ export declare interface ActivatedPromotionsWithIdsResponse {
|
|
|
26
25
|
activatedPromotionsIds: string[];
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Response returned when `activateVoucher` is called with `responseFormat: 'extended'`.
|
|
30
|
+
*
|
|
31
|
+
* It always carries `voucherInfo` (safe server-side metadata) and, depending on the
|
|
32
|
+
* voucher type, either a `purchaseId` (transaction / subscription) or the list of
|
|
33
|
+
* `activatedPromotions` (promotion voucher).
|
|
34
|
+
*/
|
|
35
|
+
export declare interface ActivateVoucherExtendedResponse {
|
|
36
|
+
voucherInfo: VoucherInfoPublic;
|
|
37
|
+
purchaseId?: string;
|
|
38
|
+
activatedPromotions?: ActivatedPromotion[];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export declare type ActivateVoucherResponse = string | ActivatedPromotionsResponse | ActivatedPromotionsWithIdsResponse | ActivateVoucherExtendedResponse;
|
|
42
|
+
|
|
43
|
+
export declare type ActivateVoucherResponseFormat = 'legacy' | 'extended';
|
|
30
44
|
|
|
31
45
|
declare interface actualPriceDetails {
|
|
32
46
|
amountCents: number;
|
|
@@ -599,7 +613,7 @@ export declare interface AvatarProps {
|
|
|
599
613
|
*/
|
|
600
614
|
export declare type BadRequestError = Error & {
|
|
601
615
|
details?: {
|
|
602
|
-
reason?: 'DOES_NOT_EXIST' | 'EXPIRED' | 'ALREADY_USED' | 'ALREADY_USED_BY_CURRENT_USER';
|
|
616
|
+
reason?: 'DOES_NOT_EXIST' | 'EXPIRED' | 'ALREADY_USED' | 'ALREADY_USED_BY_CURRENT_USER' | 'LIMIT_REACHED' | 'FULFILLED' | 'INVALID_VOUCHER_TYPE';
|
|
603
617
|
};
|
|
604
618
|
};
|
|
605
619
|
|
|
@@ -649,6 +663,52 @@ export declare interface BannerProps {
|
|
|
649
663
|
*/
|
|
650
664
|
export declare type BannerPropsPartial = Partial<BannerProps>;
|
|
651
665
|
|
|
666
|
+
/**
|
|
667
|
+
* Fields and methods common to every interactive widget (quiz, poll, …).
|
|
668
|
+
* Parameterized over the concrete answer type, state type, and scene type so
|
|
669
|
+
* more specialized widget interfaces can narrow each axis independently.
|
|
670
|
+
*/
|
|
671
|
+
export declare interface BaseInteractiveWidget<TAnswer extends BaseQuestionAnswer = QuestionAnswer, TState extends InteractiveWidgetState = InteractiveWidgetState, TScene extends InteractiveWidgetScene = InteractiveWidgetScene> {
|
|
672
|
+
readonly id: string;
|
|
673
|
+
readonly name: string;
|
|
674
|
+
readonly path: string;
|
|
675
|
+
readonly type: InteractiveWidgetType;
|
|
676
|
+
readonly status: InteractiveWidgetStatus;
|
|
677
|
+
readonly questionsCount: number;
|
|
678
|
+
readonly currentAnswerId?: string;
|
|
679
|
+
readonly currentState: TState;
|
|
680
|
+
/**
|
|
681
|
+
* State delayed for end users, used to toggle scenes just like in OBS / host view.
|
|
682
|
+
*/
|
|
683
|
+
readonly currentStateWithDelay: InteractiveWidgetCurrentStateWithDelay<TState>;
|
|
684
|
+
readonly currentQuestion: CurrentQuestion<TAnswer> | null;
|
|
685
|
+
readonly answers?: TAnswer[];
|
|
686
|
+
readonly questionIndex?: number;
|
|
687
|
+
readonly isSubmitted?: boolean;
|
|
688
|
+
readonly userRole: InteractiveWidgetRole;
|
|
689
|
+
readonly scenes: TScene[];
|
|
690
|
+
readonly activeScene: TScene | null;
|
|
691
|
+
readonly theme?: InteractiveWidgetTheme;
|
|
692
|
+
/**
|
|
693
|
+
* @remarks Always `false` for `PollWidget` — kept on the base to minimize
|
|
694
|
+
* disruption to existing consumers.
|
|
695
|
+
*/
|
|
696
|
+
readonly isWaitingForStart: boolean;
|
|
697
|
+
answerQuestion(answerId: string): void;
|
|
698
|
+
submitAnswer(request: Pick<SubmitAnswerRequest, 'answerOptionId' | 'answerText'>): Promise<void>;
|
|
699
|
+
verifyJoinCode(joinCode: string, shouldJoinPlayer?: boolean): Promise<boolean>;
|
|
700
|
+
destroy(): void;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Fields shared by both quiz and poll answers.
|
|
705
|
+
*/
|
|
706
|
+
export declare interface BaseQuestionAnswer {
|
|
707
|
+
id: string;
|
|
708
|
+
answer: Translation;
|
|
709
|
+
status?: AnswerStatus;
|
|
710
|
+
}
|
|
711
|
+
|
|
652
712
|
/**
|
|
653
713
|
* Base row interface with common fields
|
|
654
714
|
* @public
|
|
@@ -1355,13 +1415,17 @@ export declare type CurrencyLowerCase = 'czk' | 'eur' | 'usd' | 'pln';
|
|
|
1355
1415
|
*/
|
|
1356
1416
|
export declare const CurrencyToTitle: Record<Currency, string>;
|
|
1357
1417
|
|
|
1358
|
-
|
|
1418
|
+
/**
|
|
1419
|
+
* Generic "current question" shape, parameterized by answer type.
|
|
1420
|
+
* Use `QuizQuestion` / `PollQuestion` for concrete forms.
|
|
1421
|
+
*/
|
|
1422
|
+
export declare interface CurrentQuestion<TAnswer extends BaseQuestionAnswer = QuestionAnswer> {
|
|
1359
1423
|
id: string;
|
|
1360
1424
|
question: Translation;
|
|
1361
|
-
answers?:
|
|
1425
|
+
answers?: TAnswer[];
|
|
1362
1426
|
index?: number;
|
|
1363
1427
|
endTimestampMs?: number;
|
|
1364
|
-
status?:
|
|
1428
|
+
status?: InteractiveWidgetStatus;
|
|
1365
1429
|
}
|
|
1366
1430
|
|
|
1367
1431
|
export declare type CurrentQuestionScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.CURRENT_QUESTION>;
|
|
@@ -1448,7 +1512,9 @@ export declare enum CustomerId {
|
|
|
1448
1512
|
THE_JOHNY = "THE_JOHNY",
|
|
1449
1513
|
GOOD_MOVE = "GOOD_MOVE",
|
|
1450
1514
|
JANA_HANZ = "JANA_HANZ",
|
|
1451
|
-
MYSTICO = "MYSTICO"
|
|
1515
|
+
MYSTICO = "MYSTICO",
|
|
1516
|
+
MORAVEC = "MORAVEC",
|
|
1517
|
+
JAN_TUNA = "JAN_TUNA"
|
|
1452
1518
|
}
|
|
1453
1519
|
|
|
1454
1520
|
/**
|
|
@@ -2843,41 +2909,10 @@ export declare interface InputOptions {
|
|
|
2843
2909
|
|
|
2844
2910
|
export declare type IntegrationType = 'discord' | 'patreon';
|
|
2845
2911
|
|
|
2846
|
-
export declare
|
|
2847
|
-
readonly id: string;
|
|
2848
|
-
readonly name: string;
|
|
2849
|
-
readonly path: string;
|
|
2850
|
-
readonly currentQuestion: CurrentQuestion | null;
|
|
2851
|
-
readonly status: QuizGameStatus;
|
|
2852
|
-
readonly questionsCount: number;
|
|
2853
|
-
readonly currentAnswerId?: string;
|
|
2854
|
-
readonly currentState: InteractiveWidgetState;
|
|
2855
|
-
/**
|
|
2856
|
-
* State delayed for end users, which is used to toggle scenes just like in OBS and host view
|
|
2857
|
-
*/
|
|
2858
|
-
readonly currentStateWithDelay: InteractiveWidgetCurrentStateWithDelay;
|
|
2859
|
-
readonly answers?: QuestionAnswer[];
|
|
2860
|
-
readonly questionIndex?: number;
|
|
2861
|
-
readonly isSubmitted?: boolean;
|
|
2862
|
-
readonly leaderboard: LeaderboardGroupItem | null;
|
|
2863
|
-
readonly highlightedUsersIds: string[];
|
|
2864
|
-
readonly userRole: QuizGameRole;
|
|
2865
|
-
readonly secondsToAnswer: number;
|
|
2866
|
-
readonly scenes: T[];
|
|
2867
|
-
readonly activeScene: T | null;
|
|
2868
|
-
readonly theme?: InteractiveWidgetTheme;
|
|
2869
|
-
readonly showCountdown: boolean;
|
|
2870
|
-
readonly lastQuestionTopScorers: LeaderboardPlayer[];
|
|
2871
|
-
readonly questionRepository: QuestionRepository;
|
|
2872
|
-
readonly isWaitingForStart: boolean;
|
|
2873
|
-
answerQuestion(answerId: string): void;
|
|
2874
|
-
submitAnswer(request: Pick<SubmitAnswerRequest, 'answerOptionId' | 'answerText'>): Promise<void>;
|
|
2875
|
-
verifyJoinCode(joinCode: string, shouldJoinPlayer?: boolean): Promise<boolean>;
|
|
2876
|
-
destroy(): void;
|
|
2877
|
-
}
|
|
2912
|
+
export declare type InteractiveWidget<TScene extends InteractiveWidgetScene = InteractiveWidgetScene> = QuizWidget<TScene> | PollWidget<TScene>;
|
|
2878
2913
|
|
|
2879
|
-
export declare interface InteractiveWidgetCurrentStateWithDelay {
|
|
2880
|
-
state:
|
|
2914
|
+
export declare interface InteractiveWidgetCurrentStateWithDelay<TState extends InteractiveWidgetState = InteractiveWidgetState> {
|
|
2915
|
+
state: TState;
|
|
2881
2916
|
enteredAt: Date;
|
|
2882
2917
|
}
|
|
2883
2918
|
|
|
@@ -2891,6 +2926,27 @@ export declare enum InteractiveWidgetDisplayComponent {
|
|
|
2891
2926
|
AD_VAST = "adVast"
|
|
2892
2927
|
}
|
|
2893
2928
|
|
|
2929
|
+
export declare interface InteractiveWidgetGroupStats {
|
|
2930
|
+
answerPercentages: Record<string, number>;
|
|
2931
|
+
averageScore: number;
|
|
2932
|
+
correctAnswersRatio: number;
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2935
|
+
export declare enum InteractiveWidgetGroupType {
|
|
2936
|
+
HIGHLIGHTED_PLAYERS = "HIGHLIGHTED_PLAYERS",
|
|
2937
|
+
/** Participants playing in Offline mode */
|
|
2938
|
+
LOCAL_PLAYERS = "LOCAL_PLAYERS",
|
|
2939
|
+
ALL = "ALL",
|
|
2940
|
+
PARTY = "PARTY"
|
|
2941
|
+
}
|
|
2942
|
+
|
|
2943
|
+
export declare enum InteractiveWidgetRole {
|
|
2944
|
+
OBS = "OBS",
|
|
2945
|
+
HOST = "HOST",
|
|
2946
|
+
PLAYER = "PLAYER",
|
|
2947
|
+
LOCAL_PLAYER = "LOCAL_PLAYER"
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2894
2950
|
export declare type InteractiveWidgetScene = CurrentQuestionScene | LeaderboardScene | QRCodeScene | AdBannerScene | PlayersScene | NoGraphicsScene | CountdownScene;
|
|
2895
2951
|
|
|
2896
2952
|
export declare interface InteractiveWidgetSceneBase<TType extends InteractiveWidgetSceneTemplateType> {
|
|
@@ -2948,6 +3004,16 @@ export declare enum InteractiveWidgetState {
|
|
|
2948
3004
|
RESET_GAME = "ResetGame"
|
|
2949
3005
|
}
|
|
2950
3006
|
|
|
3007
|
+
export declare enum InteractiveWidgetStatus {
|
|
3008
|
+
/**
|
|
3009
|
+
* Waiting to start the quiz / question
|
|
3010
|
+
*/
|
|
3011
|
+
WAITING = "WAITING",
|
|
3012
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
3013
|
+
IN_BETWEEN_QUESTIONS = "IN_BETWEEN_QUESTIONS",
|
|
3014
|
+
DONE = "DONE"
|
|
3015
|
+
}
|
|
3016
|
+
|
|
2951
3017
|
export declare interface InteractiveWidgetTheme {
|
|
2952
3018
|
palette: Record<string, string>;
|
|
2953
3019
|
components: {
|
|
@@ -2957,6 +3023,11 @@ export declare interface InteractiveWidgetTheme {
|
|
|
2957
3023
|
|
|
2958
3024
|
declare type InteractiveWidgetThemeKey = InteractiveWidgetDisplayComponent | `${InteractiveWidgetDisplayComponent.CURRENT_QUESTION}${AnswerStatus}` | 'timeLeftBar';
|
|
2959
3025
|
|
|
3026
|
+
export declare enum InteractiveWidgetType {
|
|
3027
|
+
POLL = "POLL",
|
|
3028
|
+
QUIZ = "QUIZ"
|
|
3029
|
+
}
|
|
3030
|
+
|
|
2960
3031
|
/**
|
|
2961
3032
|
* @public
|
|
2962
3033
|
*/
|
|
@@ -2983,6 +3054,15 @@ export declare type InternalConfig = SdkReactConfig & {
|
|
|
2983
3054
|
forceCloudFnResolver?: boolean;
|
|
2984
3055
|
};
|
|
2985
3056
|
|
|
3057
|
+
/**
|
|
3058
|
+
* Subset of `BaseInteractiveWidget` methods that are intentionally **not**
|
|
3059
|
+
* advertised on the SDK hook return types (`useInteractiveWidget`,
|
|
3060
|
+
* `useQuizWidget`, `usePollWidget`). These methods still exist at runtime and
|
|
3061
|
+
* are used by internal `core-react-dom` UI / server flows — they're just hidden
|
|
3062
|
+
* from external SDK consumers, which should only call `submitAnswer`.
|
|
3063
|
+
*/
|
|
3064
|
+
export declare type InternalInteractiveWidgetMethods = 'answerQuestion' | 'verifyJoinCode' | 'changeState';
|
|
3065
|
+
|
|
2986
3066
|
/**
|
|
2987
3067
|
* @public
|
|
2988
3068
|
*/
|
|
@@ -3137,7 +3217,7 @@ export declare interface LastMessage {
|
|
|
3137
3217
|
export declare interface LeaderboardGroupItem {
|
|
3138
3218
|
groupPath?: string;
|
|
3139
3219
|
groupName?: string;
|
|
3140
|
-
type:
|
|
3220
|
+
type: InteractiveWidgetGroupType;
|
|
3141
3221
|
/**
|
|
3142
3222
|
* Consists of top 3 players of the group (global or private team)
|
|
3143
3223
|
* the player's rank in the group
|
|
@@ -3557,6 +3637,16 @@ export declare interface MonetizationCardProps {
|
|
|
3557
3637
|
focused?: boolean;
|
|
3558
3638
|
}
|
|
3559
3639
|
|
|
3640
|
+
/**
|
|
3641
|
+
* @public
|
|
3642
|
+
*/
|
|
3643
|
+
export declare type MonetizationCta = {
|
|
3644
|
+
type: 'email';
|
|
3645
|
+
payload: {
|
|
3646
|
+
email: string;
|
|
3647
|
+
};
|
|
3648
|
+
};
|
|
3649
|
+
|
|
3560
3650
|
export declare interface MonetizationsCountsSummaryItem {
|
|
3561
3651
|
/**
|
|
3562
3652
|
* Unix timestamp at which the data is aggregated
|
|
@@ -4774,6 +4864,22 @@ export declare enum PlayerWrapperEventType {
|
|
|
4774
4864
|
*/
|
|
4775
4865
|
export declare type PlayerWrapperEventTypeType = `${PlayerWrapperEventType}`;
|
|
4776
4866
|
|
|
4867
|
+
export declare type PollQuestion = CurrentQuestion<PollQuestionAnswer>;
|
|
4868
|
+
|
|
4869
|
+
export declare interface PollQuestionAnswer extends BaseQuestionAnswer {
|
|
4870
|
+
votes?: number;
|
|
4871
|
+
}
|
|
4872
|
+
|
|
4873
|
+
/**
|
|
4874
|
+
* A poll-flavored interactive widget. No scoring / leaderboard / countdown — just
|
|
4875
|
+
* "here's a question, here are the vote counts". Uses a narrower state machine.
|
|
4876
|
+
*/
|
|
4877
|
+
export declare interface PollWidget<TScene extends InteractiveWidgetScene = InteractiveWidgetScene> extends BaseInteractiveWidget<PollQuestionAnswer, PollWidgetState, TScene> {
|
|
4878
|
+
readonly type: InteractiveWidgetType.POLL;
|
|
4879
|
+
}
|
|
4880
|
+
|
|
4881
|
+
export declare type PollWidgetState = InteractiveWidgetState.IDLE | InteractiveWidgetState.CURRENT_QUESTION | InteractiveWidgetState.LEADERBOARD | InteractiveWidgetState.RESET_GAME | InteractiveWidgetState.NEXT_STATE;
|
|
4882
|
+
|
|
4777
4883
|
/**
|
|
4778
4884
|
* @public
|
|
4779
4885
|
*/
|
|
@@ -4941,6 +5047,11 @@ export declare interface PubSub {
|
|
|
4941
5047
|
* @public
|
|
4942
5048
|
*/
|
|
4943
5049
|
export declare interface PurchasableMonetization extends Monetization {
|
|
5050
|
+
/**
|
|
5051
|
+
* If CTA is configured, the monetization should not be directly purchasable in clients.
|
|
5052
|
+
* Client apps should render CTA action instead of purchase button.
|
|
5053
|
+
*/
|
|
5054
|
+
cta?: MonetizationCta;
|
|
4944
5055
|
/**
|
|
4945
5056
|
* Price before any discounts (e.g. promotions).
|
|
4946
5057
|
*/
|
|
@@ -5439,13 +5550,7 @@ export declare interface QerkoTransaction {
|
|
|
5439
5550
|
|
|
5440
5551
|
export declare type QRCodeScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.QR_CODE>;
|
|
5441
5552
|
|
|
5442
|
-
export declare
|
|
5443
|
-
id: string;
|
|
5444
|
-
answer: Translation;
|
|
5445
|
-
isCorrect?: boolean;
|
|
5446
|
-
votes?: number;
|
|
5447
|
-
status?: AnswerStatus;
|
|
5448
|
-
}
|
|
5553
|
+
export declare type QuestionAnswer = QuizQuestionAnswer | PollQuestionAnswer;
|
|
5449
5554
|
|
|
5450
5555
|
export declare enum QuestionEvents {
|
|
5451
5556
|
NEW_QUESTION = "new_question",
|
|
@@ -5463,7 +5568,7 @@ export declare interface QuestionRepository {
|
|
|
5463
5568
|
readonly selectedAnswerId: string | undefined;
|
|
5464
5569
|
isSubmitted: boolean;
|
|
5465
5570
|
isSubmitting: boolean;
|
|
5466
|
-
setCurrentQuestion: (question: CurrentQuestion | null, role:
|
|
5571
|
+
setCurrentQuestion: (question: CurrentQuestion | null, role: InteractiveWidgetRole, secondsToAnswer: number, shouldEnterAtTimestampMs?: number, shouldAdjustEndTimestampMs?: boolean) => void;
|
|
5467
5572
|
selectAnswer: (answerId: string | undefined) => void;
|
|
5468
5573
|
setShowCountdown: (showCountdown: boolean) => void;
|
|
5469
5574
|
reset: () => void;
|
|
@@ -5477,41 +5582,28 @@ export declare type QuestionRepositoryEventMap = {
|
|
|
5477
5582
|
[QuestionEvents.QUESTION_TIMEOUT]: (question: CurrentQuestion | null) => void;
|
|
5478
5583
|
};
|
|
5479
5584
|
|
|
5480
|
-
export declare
|
|
5481
|
-
answerPercentages: Record<string, number>;
|
|
5482
|
-
averageScore: number;
|
|
5483
|
-
correctAnswersRatio: number;
|
|
5484
|
-
}
|
|
5485
|
-
|
|
5486
|
-
export declare enum QuizGameGroupType {
|
|
5487
|
-
HIGHLIGHTED_PLAYERS = "HIGHLIGHTED_PLAYERS",
|
|
5488
|
-
/** Participants playing in Offline mode */
|
|
5489
|
-
LOCAL_PLAYERS = "LOCAL_PLAYERS",
|
|
5490
|
-
ALL = "ALL",
|
|
5491
|
-
PARTY = "PARTY"
|
|
5492
|
-
}
|
|
5585
|
+
export declare type QuizQuestion = CurrentQuestion<QuizQuestionAnswer>;
|
|
5493
5586
|
|
|
5494
|
-
export declare
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
PLAYER = "PLAYER",
|
|
5498
|
-
LOCAL_PLAYER = "LOCAL_PLAYER"
|
|
5587
|
+
export declare interface QuizQuestionAnswer extends BaseQuestionAnswer {
|
|
5588
|
+
isCorrect?: boolean;
|
|
5589
|
+
votes?: number;
|
|
5499
5590
|
}
|
|
5500
5591
|
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5592
|
+
/**
|
|
5593
|
+
* A quiz-flavored interactive widget. Adds scoring, leaderboard, and countdown
|
|
5594
|
+
* concepts on top of the base, and narrows answers to `QuizQuestionAnswer`.
|
|
5595
|
+
*/
|
|
5596
|
+
export declare interface QuizWidget<TScene extends InteractiveWidgetScene = InteractiveWidgetScene> extends BaseInteractiveWidget<QuizQuestionAnswer, QuizWidgetState, TScene> {
|
|
5597
|
+
readonly type: InteractiveWidgetType.QUIZ;
|
|
5598
|
+
readonly leaderboard: LeaderboardGroupItem | null;
|
|
5599
|
+
readonly lastQuestionTopScorers: LeaderboardPlayer[];
|
|
5600
|
+
readonly highlightedUsersIds: string[];
|
|
5601
|
+
readonly secondsToAnswer: number;
|
|
5602
|
+
readonly showCountdown: boolean;
|
|
5603
|
+
readonly questionRepository: QuestionRepository;
|
|
5509
5604
|
}
|
|
5510
5605
|
|
|
5511
|
-
export declare
|
|
5512
|
-
POLL = "POLL",
|
|
5513
|
-
QUIZ = "QUIZ"
|
|
5514
|
-
}
|
|
5606
|
+
export declare type QuizWidgetState = InteractiveWidgetState;
|
|
5515
5607
|
|
|
5516
5608
|
/**
|
|
5517
5609
|
* @public
|
|
@@ -5628,6 +5720,11 @@ export declare interface RemoteControlPairPayload {
|
|
|
5628
5720
|
profileId: string;
|
|
5629
5721
|
}
|
|
5630
5722
|
|
|
5723
|
+
export declare interface RemoteControlPairResponse {
|
|
5724
|
+
sessionId: string;
|
|
5725
|
+
videoId: string;
|
|
5726
|
+
}
|
|
5727
|
+
|
|
5631
5728
|
export declare interface RemoteControlPlaybackControlPayload {
|
|
5632
5729
|
sessionId: string;
|
|
5633
5730
|
videoId: string;
|
|
@@ -6018,7 +6115,7 @@ declare type SceneMetadata<TType extends InteractiveWidgetSceneTemplateType> = T
|
|
|
6018
6115
|
} : TType extends InteractiveWidgetSceneTemplateType.LEADERBOARD ? {
|
|
6019
6116
|
highlightedPlayers: LeaderboardPlayer[];
|
|
6020
6117
|
topPlayers: LeaderboardPlayer[];
|
|
6021
|
-
stats?:
|
|
6118
|
+
stats?: InteractiveWidgetGroupStats;
|
|
6022
6119
|
} : TType extends InteractiveWidgetSceneTemplateType.QR_CODE ? Record<Extract<SceneMetadataKeys[TType], string>, string> : TType extends InteractiveWidgetSceneTemplateType.AD_BANNER ? Record<Extract<SceneMetadataKeys[TType], string>, string> : TType extends InteractiveWidgetSceneTemplateType.PLAYERS ? Record<Extract<SceneMetadataKeys[TType], string>, string> : object;
|
|
6023
6120
|
|
|
6024
6121
|
export declare interface SceneMetadataKeys {
|
|
@@ -6171,6 +6268,13 @@ export declare type SdkReactConfig = Omit<TivioConfig, 'language'> & {
|
|
|
6171
6268
|
language?: LangCode;
|
|
6172
6269
|
};
|
|
6173
6270
|
|
|
6271
|
+
/**
|
|
6272
|
+
* Narrows away `InternalInteractiveWidgetMethods` from any concrete widget
|
|
6273
|
+
* type. Distributes over discriminated unions so `SDKWidget<InteractiveWidget>`
|
|
6274
|
+
* stays a union of `SDKWidget<QuizWidget> | SDKWidget<PollWidget>`.
|
|
6275
|
+
*/
|
|
6276
|
+
export declare type SDKWidget<T> = T extends unknown ? Omit<T, InternalInteractiveWidgetMethods> : never;
|
|
6277
|
+
|
|
6174
6278
|
/**
|
|
6175
6279
|
* @public
|
|
6176
6280
|
* @deprecated sections are no longer used.
|
|
@@ -6934,14 +7038,6 @@ export declare type SubscribeToTaggedVideosOptions = Omit<SubscribeToItemsInRowO
|
|
|
6934
7038
|
orderBy?: OrderBy<TaggedVideosOrderByField>[];
|
|
6935
7039
|
};
|
|
6936
7040
|
|
|
6937
|
-
declare interface SubscriptionInfo {
|
|
6938
|
-
id: string;
|
|
6939
|
-
type: 'subscription';
|
|
6940
|
-
name: string;
|
|
6941
|
-
benefits: string[];
|
|
6942
|
-
frequency: string;
|
|
6943
|
-
}
|
|
6944
|
-
|
|
6945
7041
|
/**
|
|
6946
7042
|
* Extended language codes for subtitle tracks.
|
|
6947
7043
|
* Includes all LangCode values plus additional languages only needed for subtitles.
|
|
@@ -7410,7 +7506,7 @@ export declare interface TivioConfig {
|
|
|
7410
7506
|
debug?: boolean;
|
|
7411
7507
|
verbose?: boolean;
|
|
7412
7508
|
firebaseApp?: any | null;
|
|
7413
|
-
firebaseFactory?: (config: object, appName?: string) =>
|
|
7509
|
+
firebaseFactory?: (config: object, appName?: string) => firebase.FirebaseApp;
|
|
7414
7510
|
authDomainOverride?: string;
|
|
7415
7511
|
/**
|
|
7416
7512
|
* @deprecated this field is no longer in use and has no impact when set.
|
|
@@ -7539,7 +7635,7 @@ export declare type TivioHooks = {
|
|
|
7539
7635
|
data: Video | null;
|
|
7540
7636
|
error: string | null;
|
|
7541
7637
|
};
|
|
7542
|
-
useVoucher: (voucherId: string) =>
|
|
7638
|
+
useVoucher: (voucherId: string) => UseVoucherReturn;
|
|
7543
7639
|
useApplyInviteCode: () => {
|
|
7544
7640
|
applyInviteCodeResult?: boolean;
|
|
7545
7641
|
loading: boolean;
|
|
@@ -7549,6 +7645,22 @@ export declare type TivioHooks = {
|
|
|
7549
7645
|
};
|
|
7550
7646
|
useChannelSource: UseChannelSource;
|
|
7551
7647
|
useTvChannel: UseTvChannel;
|
|
7648
|
+
useInteractiveWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
7649
|
+
widget: SDKWidget<InteractiveWidget> | null;
|
|
7650
|
+
isLoading: boolean;
|
|
7651
|
+
error: Error | null;
|
|
7652
|
+
};
|
|
7653
|
+
useQuizWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
7654
|
+
widget: SDKWidget<QuizWidget> | null;
|
|
7655
|
+
isLoading: boolean;
|
|
7656
|
+
error: Error | null;
|
|
7657
|
+
};
|
|
7658
|
+
usePollWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
7659
|
+
widget: SDKWidget<PollWidget> | null;
|
|
7660
|
+
isLoading: boolean;
|
|
7661
|
+
error: Error | null;
|
|
7662
|
+
};
|
|
7663
|
+
useRemoteController: UseRemoteController;
|
|
7552
7664
|
};
|
|
7553
7665
|
|
|
7554
7666
|
/**
|
|
@@ -7774,7 +7886,7 @@ export declare type TivioReactBundle = {
|
|
|
7774
7886
|
}, email?: string) => Promise<QerkoPaymentInfo>;
|
|
7775
7887
|
purchaseSubscriptionWithQerko: (monetizationId: string, voucher?: {
|
|
7776
7888
|
expirationDate: Date;
|
|
7777
|
-
}) => Promise<QerkoPaymentInfo>;
|
|
7889
|
+
}, email?: string, quantity?: number) => Promise<QerkoPaymentInfo>;
|
|
7778
7890
|
cancelSubscriptionWithQerko: (subscriptionId: string) => Promise<QerkoCancellationInfo>;
|
|
7779
7891
|
showConsentPreferences: () => void;
|
|
7780
7892
|
/**
|
|
@@ -7883,17 +7995,6 @@ export declare interface Track {
|
|
|
7883
7995
|
language: LangCode;
|
|
7884
7996
|
}
|
|
7885
7997
|
|
|
7886
|
-
declare interface TransactionInfo {
|
|
7887
|
-
id: string;
|
|
7888
|
-
type: 'transaction';
|
|
7889
|
-
name: string;
|
|
7890
|
-
videoId: string;
|
|
7891
|
-
cover: string;
|
|
7892
|
-
description: string;
|
|
7893
|
-
promotions?: firebase_3.firestore.DocumentReference<Promotion>[];
|
|
7894
|
-
fullDiscount?: boolean;
|
|
7895
|
-
}
|
|
7896
|
-
|
|
7897
7998
|
/**
|
|
7898
7999
|
* Represents one string in every supported language mutation.
|
|
7899
8000
|
* @public
|
|
@@ -8197,6 +8298,18 @@ export declare type UseEpisodesResult = {
|
|
|
8197
8298
|
hasMoreEpisodes: boolean;
|
|
8198
8299
|
};
|
|
8199
8300
|
|
|
8301
|
+
/**
|
|
8302
|
+
* Load the interactive widget at `widgetPath` via the remote Tivio bundle.
|
|
8303
|
+
* Returns the union widget (`QuizWidget | PollWidget`); narrow
|
|
8304
|
+
* on `widget.type` to access type-specific fields. Prefer `useQuizWidget` /
|
|
8305
|
+
* `usePollWidget` when you know the type up-front.
|
|
8306
|
+
*/
|
|
8307
|
+
export declare const useInteractiveWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
8308
|
+
widget: SDKWidget<InteractiveWidget> | null;
|
|
8309
|
+
isLoading: boolean;
|
|
8310
|
+
error: Error | null;
|
|
8311
|
+
};
|
|
8312
|
+
|
|
8200
8313
|
/**
|
|
8201
8314
|
* @public
|
|
8202
8315
|
*/
|
|
@@ -8289,6 +8402,12 @@ export declare const useOrganizationSubscriptions: (onlyPurchasableSubscriptions
|
|
|
8289
8402
|
subscriptions: PurchasableMonetization[];
|
|
8290
8403
|
};
|
|
8291
8404
|
|
|
8405
|
+
export declare const usePollWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
8406
|
+
widget: Omit<PollWidget<InteractiveWidgetScene>, InternalInteractiveWidgetMethods> | null;
|
|
8407
|
+
isLoading: boolean;
|
|
8408
|
+
error: Error | null;
|
|
8409
|
+
};
|
|
8410
|
+
|
|
8292
8411
|
/**
|
|
8293
8412
|
* Is used to mark purchase in recovery state as PAID.
|
|
8294
8413
|
*
|
|
@@ -8310,6 +8429,12 @@ export declare function usePurchaseRecovery(): {
|
|
|
8310
8429
|
*/
|
|
8311
8430
|
export declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
|
|
8312
8431
|
|
|
8432
|
+
export declare const useQuizWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
8433
|
+
widget: Omit<QuizWidget<InteractiveWidgetScene>, InternalInteractiveWidgetMethods> | null;
|
|
8434
|
+
isLoading: boolean;
|
|
8435
|
+
error: Error | null;
|
|
8436
|
+
};
|
|
8437
|
+
|
|
8313
8438
|
/**
|
|
8314
8439
|
* @public
|
|
8315
8440
|
*/
|
|
@@ -8451,6 +8576,58 @@ export declare interface UseReactionsOptions {
|
|
|
8451
8576
|
onError?: (error: Error) => void;
|
|
8452
8577
|
}
|
|
8453
8578
|
|
|
8579
|
+
/**
|
|
8580
|
+
* @public
|
|
8581
|
+
*/
|
|
8582
|
+
export declare type UseRemoteController = (options?: UseRemoteControllerOptions) => UseRemoteControllerResult;
|
|
8583
|
+
|
|
8584
|
+
export declare const useRemoteController: UseRemoteController;
|
|
8585
|
+
|
|
8586
|
+
/**
|
|
8587
|
+
* @public
|
|
8588
|
+
*/
|
|
8589
|
+
export declare interface UseRemoteControllerOptions {
|
|
8590
|
+
sessionId?: string;
|
|
8591
|
+
videoId?: string;
|
|
8592
|
+
}
|
|
8593
|
+
|
|
8594
|
+
/**
|
|
8595
|
+
* @public
|
|
8596
|
+
*/
|
|
8597
|
+
export declare type UseRemoteControllerPlaybackControlPayload = Pick<RemoteControlPlaybackControlPayload, 'playback' | 'activeVideoId'> & Partial<Pick<RemoteControlPlaybackControlPayload, 'sessionId' | 'videoId'>>;
|
|
8598
|
+
|
|
8599
|
+
/**
|
|
8600
|
+
* @public
|
|
8601
|
+
*/
|
|
8602
|
+
export declare type UseRemoteControllerPlayHighlightPayload = Pick<RemoteControlPlayHighlightPayload, 'activeVideoId' | 'replay'> & Partial<Pick<RemoteControlPlayHighlightPayload, 'sessionId' | 'videoId'>>;
|
|
8603
|
+
|
|
8604
|
+
/**
|
|
8605
|
+
* @public
|
|
8606
|
+
*/
|
|
8607
|
+
export declare interface UseRemoteControllerResult {
|
|
8608
|
+
session: UserStreamingSessionFieldInterface | null;
|
|
8609
|
+
sessionId: string | null;
|
|
8610
|
+
videoId: string | null;
|
|
8611
|
+
activeContentId: string | null;
|
|
8612
|
+
isInitialized: boolean;
|
|
8613
|
+
isSignedIn: boolean;
|
|
8614
|
+
isLoading: boolean;
|
|
8615
|
+
error: Error | null;
|
|
8616
|
+
resetError: () => void;
|
|
8617
|
+
pairDevice: (payload: RemoteControlPairPayload) => Promise<RemoteControlPairResponse>;
|
|
8618
|
+
unpairDevice: (payload?: Partial<RemoteControlUnpairPayload>) => Promise<boolean | string>;
|
|
8619
|
+
selectCamera: (payload: UseRemoteControllerSelectCameraPayload) => Promise<boolean | string>;
|
|
8620
|
+
playHighlight: (payload: UseRemoteControllerPlayHighlightPayload) => Promise<boolean | string>;
|
|
8621
|
+
playbackControl: (payload: UseRemoteControllerPlaybackControlPayload) => Promise<boolean | string>;
|
|
8622
|
+
getSourceUrl: (payload: RemoteControlGetSourceUrlPayload) => Promise<RemoteControlGenerateSourceResponse>;
|
|
8623
|
+
remoteControl: <TResponse = RemoteControlGenerateSourceResponse | boolean | string>(payload: RemoteControlRequest) => Promise<TResponse>;
|
|
8624
|
+
}
|
|
8625
|
+
|
|
8626
|
+
/**
|
|
8627
|
+
* @public
|
|
8628
|
+
*/
|
|
8629
|
+
export declare type UseRemoteControllerSelectCameraPayload = Pick<RemoteControlSelectCameraPayload, 'activeVideoId'> & Partial<Pick<RemoteControlSelectCameraPayload, 'sessionId' | 'videoId'>>;
|
|
8630
|
+
|
|
8454
8631
|
export declare enum UserGroup {
|
|
8455
8632
|
ALL = "all",
|
|
8456
8633
|
FREE = "free",
|
|
@@ -8666,19 +8843,28 @@ export declare const useVideo: (videoIdOrUrlName?: string) => {
|
|
|
8666
8843
|
/**
|
|
8667
8844
|
* @public
|
|
8668
8845
|
*/
|
|
8669
|
-
export declare const useVoucher: (voucherId: string) =>
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8846
|
+
export declare const useVoucher: (voucherId: string) => UseVoucherReturn;
|
|
8847
|
+
|
|
8848
|
+
/**
|
|
8849
|
+
* Return type of `useVoucher` hook (core-react / sdk-react).
|
|
8850
|
+
*
|
|
8851
|
+
* Activation is triggered via the top-level `activate`. After a successful activation
|
|
8852
|
+
* `voucher` carries the server-provided metadata (`voucherInfo`, `videoId`,
|
|
8853
|
+
* `subscriptionsToShow`) as flat attributes. While the voucher is still initializing,
|
|
8854
|
+
* `voucher` is `null`.
|
|
8855
|
+
*/
|
|
8856
|
+
export declare interface UseVoucherReturn {
|
|
8857
|
+
activate: () => Promise<void>;
|
|
8858
|
+
voucher: {
|
|
8859
|
+
organizationId: string | null;
|
|
8860
|
+
isInitialized: boolean;
|
|
8861
|
+
voucherInfo: VoucherInfoPublic | null;
|
|
8862
|
+
videoId?: string;
|
|
8863
|
+
subscriptionsToShow: PurchasableMonetization[];
|
|
8864
|
+
} | null;
|
|
8865
|
+
error: Error | null;
|
|
8680
8866
|
activationSuccess: boolean;
|
|
8681
|
-
}
|
|
8867
|
+
}
|
|
8682
8868
|
|
|
8683
8869
|
/**
|
|
8684
8870
|
* @public
|
|
@@ -9312,15 +9498,30 @@ export declare interface VodTivioSourceParams extends PlayerSourceParams<SourceT
|
|
|
9312
9498
|
sessionId?: string;
|
|
9313
9499
|
}
|
|
9314
9500
|
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
*/
|
|
9318
|
-
declare interface Voucher {
|
|
9319
|
-
activate: () => void;
|
|
9320
|
-
isUsed: boolean;
|
|
9501
|
+
export declare interface VoucherInfoBasePublic {
|
|
9502
|
+
id: string;
|
|
9321
9503
|
isExpired: boolean;
|
|
9322
|
-
status:
|
|
9323
|
-
|
|
9504
|
+
status: VoucherInfoPublicStatus;
|
|
9505
|
+
fullDiscount?: boolean;
|
|
9506
|
+
}
|
|
9507
|
+
|
|
9508
|
+
export declare type VoucherInfoPublic = VoucherInfoSubscriptionPublic | VoucherInfoTransactionPublic;
|
|
9509
|
+
|
|
9510
|
+
export declare type VoucherInfoPublicStatus = 'NEW' | 'USED' | 'FULFILLED';
|
|
9511
|
+
|
|
9512
|
+
export declare interface VoucherInfoSubscriptionPublic extends VoucherInfoBasePublic {
|
|
9513
|
+
type: 'subscription';
|
|
9514
|
+
name: string;
|
|
9515
|
+
benefits: string[];
|
|
9516
|
+
frequency?: MONETIZATION_FREQUENCY;
|
|
9517
|
+
}
|
|
9518
|
+
|
|
9519
|
+
export declare interface VoucherInfoTransactionPublic extends VoucherInfoBasePublic {
|
|
9520
|
+
type: 'transaction';
|
|
9521
|
+
name: string;
|
|
9522
|
+
videoId: string;
|
|
9523
|
+
cover: string;
|
|
9524
|
+
description: string;
|
|
9324
9525
|
}
|
|
9325
9526
|
|
|
9326
9527
|
declare interface VoucherPageConfiguration {
|