@tivio/sdk-react 10.0.0 → 10.1.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/CHANGELOG.md +4 -0
- package/README.md +2 -2
- package/README.md.bak +2 -2
- package/dist/index.d.ts +242 -77
- package/dist/index.js +1 -1
- package/dist/sdk-react.d.ts +242 -77
- package/package.json +2 -2
package/dist/sdk-react.d.ts
CHANGED
|
@@ -649,6 +649,52 @@ export declare interface BannerProps {
|
|
|
649
649
|
*/
|
|
650
650
|
export declare type BannerPropsPartial = Partial<BannerProps>;
|
|
651
651
|
|
|
652
|
+
/**
|
|
653
|
+
* Fields and methods common to every interactive widget (quiz, poll, …).
|
|
654
|
+
* Parameterized over the concrete answer type, state type, and scene type so
|
|
655
|
+
* more specialized widget interfaces can narrow each axis independently.
|
|
656
|
+
*/
|
|
657
|
+
export declare interface BaseInteractiveWidget<TAnswer extends BaseQuestionAnswer = QuestionAnswer, TState extends InteractiveWidgetState = InteractiveWidgetState, TScene extends InteractiveWidgetScene = InteractiveWidgetScene> {
|
|
658
|
+
readonly id: string;
|
|
659
|
+
readonly name: string;
|
|
660
|
+
readonly path: string;
|
|
661
|
+
readonly type: InteractiveWidgetType;
|
|
662
|
+
readonly status: InteractiveWidgetStatus;
|
|
663
|
+
readonly questionsCount: number;
|
|
664
|
+
readonly currentAnswerId?: string;
|
|
665
|
+
readonly currentState: TState;
|
|
666
|
+
/**
|
|
667
|
+
* State delayed for end users, used to toggle scenes just like in OBS / host view.
|
|
668
|
+
*/
|
|
669
|
+
readonly currentStateWithDelay: InteractiveWidgetCurrentStateWithDelay<TState>;
|
|
670
|
+
readonly currentQuestion: CurrentQuestion<TAnswer> | null;
|
|
671
|
+
readonly answers?: TAnswer[];
|
|
672
|
+
readonly questionIndex?: number;
|
|
673
|
+
readonly isSubmitted?: boolean;
|
|
674
|
+
readonly userRole: InteractiveWidgetRole;
|
|
675
|
+
readonly scenes: TScene[];
|
|
676
|
+
readonly activeScene: TScene | null;
|
|
677
|
+
readonly theme?: InteractiveWidgetTheme;
|
|
678
|
+
/**
|
|
679
|
+
* @remarks Always `false` for `PollWidget` — kept on the base to minimize
|
|
680
|
+
* disruption to existing consumers.
|
|
681
|
+
*/
|
|
682
|
+
readonly isWaitingForStart: boolean;
|
|
683
|
+
answerQuestion(answerId: string): void;
|
|
684
|
+
submitAnswer(request: Pick<SubmitAnswerRequest, 'answerOptionId' | 'answerText'>): Promise<void>;
|
|
685
|
+
verifyJoinCode(joinCode: string, shouldJoinPlayer?: boolean): Promise<boolean>;
|
|
686
|
+
destroy(): void;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Fields shared by both quiz and poll answers.
|
|
691
|
+
*/
|
|
692
|
+
export declare interface BaseQuestionAnswer {
|
|
693
|
+
id: string;
|
|
694
|
+
answer: Translation;
|
|
695
|
+
status?: AnswerStatus;
|
|
696
|
+
}
|
|
697
|
+
|
|
652
698
|
/**
|
|
653
699
|
* Base row interface with common fields
|
|
654
700
|
* @public
|
|
@@ -1355,13 +1401,17 @@ export declare type CurrencyLowerCase = 'czk' | 'eur' | 'usd' | 'pln';
|
|
|
1355
1401
|
*/
|
|
1356
1402
|
export declare const CurrencyToTitle: Record<Currency, string>;
|
|
1357
1403
|
|
|
1358
|
-
|
|
1404
|
+
/**
|
|
1405
|
+
* Generic "current question" shape, parameterized by answer type.
|
|
1406
|
+
* Use `QuizQuestion` / `PollQuestion` for concrete forms.
|
|
1407
|
+
*/
|
|
1408
|
+
export declare interface CurrentQuestion<TAnswer extends BaseQuestionAnswer = QuestionAnswer> {
|
|
1359
1409
|
id: string;
|
|
1360
1410
|
question: Translation;
|
|
1361
|
-
answers?:
|
|
1411
|
+
answers?: TAnswer[];
|
|
1362
1412
|
index?: number;
|
|
1363
1413
|
endTimestampMs?: number;
|
|
1364
|
-
status?:
|
|
1414
|
+
status?: InteractiveWidgetStatus;
|
|
1365
1415
|
}
|
|
1366
1416
|
|
|
1367
1417
|
export declare type CurrentQuestionScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.CURRENT_QUESTION>;
|
|
@@ -2843,41 +2893,10 @@ export declare interface InputOptions {
|
|
|
2843
2893
|
|
|
2844
2894
|
export declare type IntegrationType = 'discord' | 'patreon';
|
|
2845
2895
|
|
|
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
|
-
}
|
|
2896
|
+
export declare type InteractiveWidget<TScene extends InteractiveWidgetScene = InteractiveWidgetScene> = QuizWidget<TScene> | PollWidget<TScene>;
|
|
2878
2897
|
|
|
2879
|
-
export declare interface InteractiveWidgetCurrentStateWithDelay {
|
|
2880
|
-
state:
|
|
2898
|
+
export declare interface InteractiveWidgetCurrentStateWithDelay<TState extends InteractiveWidgetState = InteractiveWidgetState> {
|
|
2899
|
+
state: TState;
|
|
2881
2900
|
enteredAt: Date;
|
|
2882
2901
|
}
|
|
2883
2902
|
|
|
@@ -2891,6 +2910,27 @@ export declare enum InteractiveWidgetDisplayComponent {
|
|
|
2891
2910
|
AD_VAST = "adVast"
|
|
2892
2911
|
}
|
|
2893
2912
|
|
|
2913
|
+
export declare interface InteractiveWidgetGroupStats {
|
|
2914
|
+
answerPercentages: Record<string, number>;
|
|
2915
|
+
averageScore: number;
|
|
2916
|
+
correctAnswersRatio: number;
|
|
2917
|
+
}
|
|
2918
|
+
|
|
2919
|
+
export declare enum InteractiveWidgetGroupType {
|
|
2920
|
+
HIGHLIGHTED_PLAYERS = "HIGHLIGHTED_PLAYERS",
|
|
2921
|
+
/** Participants playing in Offline mode */
|
|
2922
|
+
LOCAL_PLAYERS = "LOCAL_PLAYERS",
|
|
2923
|
+
ALL = "ALL",
|
|
2924
|
+
PARTY = "PARTY"
|
|
2925
|
+
}
|
|
2926
|
+
|
|
2927
|
+
export declare enum InteractiveWidgetRole {
|
|
2928
|
+
OBS = "OBS",
|
|
2929
|
+
HOST = "HOST",
|
|
2930
|
+
PLAYER = "PLAYER",
|
|
2931
|
+
LOCAL_PLAYER = "LOCAL_PLAYER"
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2894
2934
|
export declare type InteractiveWidgetScene = CurrentQuestionScene | LeaderboardScene | QRCodeScene | AdBannerScene | PlayersScene | NoGraphicsScene | CountdownScene;
|
|
2895
2935
|
|
|
2896
2936
|
export declare interface InteractiveWidgetSceneBase<TType extends InteractiveWidgetSceneTemplateType> {
|
|
@@ -2948,6 +2988,16 @@ export declare enum InteractiveWidgetState {
|
|
|
2948
2988
|
RESET_GAME = "ResetGame"
|
|
2949
2989
|
}
|
|
2950
2990
|
|
|
2991
|
+
export declare enum InteractiveWidgetStatus {
|
|
2992
|
+
/**
|
|
2993
|
+
* Waiting to start the quiz / question
|
|
2994
|
+
*/
|
|
2995
|
+
WAITING = "WAITING",
|
|
2996
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
2997
|
+
IN_BETWEEN_QUESTIONS = "IN_BETWEEN_QUESTIONS",
|
|
2998
|
+
DONE = "DONE"
|
|
2999
|
+
}
|
|
3000
|
+
|
|
2951
3001
|
export declare interface InteractiveWidgetTheme {
|
|
2952
3002
|
palette: Record<string, string>;
|
|
2953
3003
|
components: {
|
|
@@ -2957,6 +3007,11 @@ export declare interface InteractiveWidgetTheme {
|
|
|
2957
3007
|
|
|
2958
3008
|
declare type InteractiveWidgetThemeKey = InteractiveWidgetDisplayComponent | `${InteractiveWidgetDisplayComponent.CURRENT_QUESTION}${AnswerStatus}` | 'timeLeftBar';
|
|
2959
3009
|
|
|
3010
|
+
export declare enum InteractiveWidgetType {
|
|
3011
|
+
POLL = "POLL",
|
|
3012
|
+
QUIZ = "QUIZ"
|
|
3013
|
+
}
|
|
3014
|
+
|
|
2960
3015
|
/**
|
|
2961
3016
|
* @public
|
|
2962
3017
|
*/
|
|
@@ -2983,6 +3038,15 @@ export declare type InternalConfig = SdkReactConfig & {
|
|
|
2983
3038
|
forceCloudFnResolver?: boolean;
|
|
2984
3039
|
};
|
|
2985
3040
|
|
|
3041
|
+
/**
|
|
3042
|
+
* Subset of `BaseInteractiveWidget` methods that are intentionally **not**
|
|
3043
|
+
* advertised on the SDK hook return types (`useInteractiveWidget`,
|
|
3044
|
+
* `useQuizWidget`, `usePollWidget`). These methods still exist at runtime and
|
|
3045
|
+
* are used by internal `core-react-dom` UI / server flows — they're just hidden
|
|
3046
|
+
* from external SDK consumers, which should only call `submitAnswer`.
|
|
3047
|
+
*/
|
|
3048
|
+
export declare type InternalInteractiveWidgetMethods = 'answerQuestion' | 'verifyJoinCode' | 'changeState';
|
|
3049
|
+
|
|
2986
3050
|
/**
|
|
2987
3051
|
* @public
|
|
2988
3052
|
*/
|
|
@@ -3137,7 +3201,7 @@ export declare interface LastMessage {
|
|
|
3137
3201
|
export declare interface LeaderboardGroupItem {
|
|
3138
3202
|
groupPath?: string;
|
|
3139
3203
|
groupName?: string;
|
|
3140
|
-
type:
|
|
3204
|
+
type: InteractiveWidgetGroupType;
|
|
3141
3205
|
/**
|
|
3142
3206
|
* Consists of top 3 players of the group (global or private team)
|
|
3143
3207
|
* the player's rank in the group
|
|
@@ -4774,6 +4838,22 @@ export declare enum PlayerWrapperEventType {
|
|
|
4774
4838
|
*/
|
|
4775
4839
|
export declare type PlayerWrapperEventTypeType = `${PlayerWrapperEventType}`;
|
|
4776
4840
|
|
|
4841
|
+
export declare type PollQuestion = CurrentQuestion<PollQuestionAnswer>;
|
|
4842
|
+
|
|
4843
|
+
export declare interface PollQuestionAnswer extends BaseQuestionAnswer {
|
|
4844
|
+
votes?: number;
|
|
4845
|
+
}
|
|
4846
|
+
|
|
4847
|
+
/**
|
|
4848
|
+
* A poll-flavored interactive widget. No scoring / leaderboard / countdown — just
|
|
4849
|
+
* "here's a question, here are the vote counts". Uses a narrower state machine.
|
|
4850
|
+
*/
|
|
4851
|
+
export declare interface PollWidget<TScene extends InteractiveWidgetScene = InteractiveWidgetScene> extends BaseInteractiveWidget<PollQuestionAnswer, PollWidgetState, TScene> {
|
|
4852
|
+
readonly type: InteractiveWidgetType.POLL;
|
|
4853
|
+
}
|
|
4854
|
+
|
|
4855
|
+
export declare type PollWidgetState = InteractiveWidgetState.IDLE | InteractiveWidgetState.CURRENT_QUESTION | InteractiveWidgetState.LEADERBOARD | InteractiveWidgetState.RESET_GAME | InteractiveWidgetState.NEXT_STATE;
|
|
4856
|
+
|
|
4777
4857
|
/**
|
|
4778
4858
|
* @public
|
|
4779
4859
|
*/
|
|
@@ -5439,13 +5519,7 @@ export declare interface QerkoTransaction {
|
|
|
5439
5519
|
|
|
5440
5520
|
export declare type QRCodeScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.QR_CODE>;
|
|
5441
5521
|
|
|
5442
|
-
export declare
|
|
5443
|
-
id: string;
|
|
5444
|
-
answer: Translation;
|
|
5445
|
-
isCorrect?: boolean;
|
|
5446
|
-
votes?: number;
|
|
5447
|
-
status?: AnswerStatus;
|
|
5448
|
-
}
|
|
5522
|
+
export declare type QuestionAnswer = QuizQuestionAnswer | PollQuestionAnswer;
|
|
5449
5523
|
|
|
5450
5524
|
export declare enum QuestionEvents {
|
|
5451
5525
|
NEW_QUESTION = "new_question",
|
|
@@ -5463,7 +5537,7 @@ export declare interface QuestionRepository {
|
|
|
5463
5537
|
readonly selectedAnswerId: string | undefined;
|
|
5464
5538
|
isSubmitted: boolean;
|
|
5465
5539
|
isSubmitting: boolean;
|
|
5466
|
-
setCurrentQuestion: (question: CurrentQuestion | null, role:
|
|
5540
|
+
setCurrentQuestion: (question: CurrentQuestion | null, role: InteractiveWidgetRole, secondsToAnswer: number, shouldEnterAtTimestampMs?: number, shouldAdjustEndTimestampMs?: boolean) => void;
|
|
5467
5541
|
selectAnswer: (answerId: string | undefined) => void;
|
|
5468
5542
|
setShowCountdown: (showCountdown: boolean) => void;
|
|
5469
5543
|
reset: () => void;
|
|
@@ -5477,41 +5551,28 @@ export declare type QuestionRepositoryEventMap = {
|
|
|
5477
5551
|
[QuestionEvents.QUESTION_TIMEOUT]: (question: CurrentQuestion | null) => void;
|
|
5478
5552
|
};
|
|
5479
5553
|
|
|
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
|
-
}
|
|
5554
|
+
export declare type QuizQuestion = CurrentQuestion<QuizQuestionAnswer>;
|
|
5493
5555
|
|
|
5494
|
-
export declare
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
PLAYER = "PLAYER",
|
|
5498
|
-
LOCAL_PLAYER = "LOCAL_PLAYER"
|
|
5556
|
+
export declare interface QuizQuestionAnswer extends BaseQuestionAnswer {
|
|
5557
|
+
isCorrect?: boolean;
|
|
5558
|
+
votes?: number;
|
|
5499
5559
|
}
|
|
5500
5560
|
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5561
|
+
/**
|
|
5562
|
+
* A quiz-flavored interactive widget. Adds scoring, leaderboard, and countdown
|
|
5563
|
+
* concepts on top of the base, and narrows answers to `QuizQuestionAnswer`.
|
|
5564
|
+
*/
|
|
5565
|
+
export declare interface QuizWidget<TScene extends InteractiveWidgetScene = InteractiveWidgetScene> extends BaseInteractiveWidget<QuizQuestionAnswer, QuizWidgetState, TScene> {
|
|
5566
|
+
readonly type: InteractiveWidgetType.QUIZ;
|
|
5567
|
+
readonly leaderboard: LeaderboardGroupItem | null;
|
|
5568
|
+
readonly lastQuestionTopScorers: LeaderboardPlayer[];
|
|
5569
|
+
readonly highlightedUsersIds: string[];
|
|
5570
|
+
readonly secondsToAnswer: number;
|
|
5571
|
+
readonly showCountdown: boolean;
|
|
5572
|
+
readonly questionRepository: QuestionRepository;
|
|
5509
5573
|
}
|
|
5510
5574
|
|
|
5511
|
-
export declare
|
|
5512
|
-
POLL = "POLL",
|
|
5513
|
-
QUIZ = "QUIZ"
|
|
5514
|
-
}
|
|
5575
|
+
export declare type QuizWidgetState = InteractiveWidgetState;
|
|
5515
5576
|
|
|
5516
5577
|
/**
|
|
5517
5578
|
* @public
|
|
@@ -5628,6 +5689,11 @@ export declare interface RemoteControlPairPayload {
|
|
|
5628
5689
|
profileId: string;
|
|
5629
5690
|
}
|
|
5630
5691
|
|
|
5692
|
+
export declare interface RemoteControlPairResponse {
|
|
5693
|
+
sessionId: string;
|
|
5694
|
+
videoId: string;
|
|
5695
|
+
}
|
|
5696
|
+
|
|
5631
5697
|
export declare interface RemoteControlPlaybackControlPayload {
|
|
5632
5698
|
sessionId: string;
|
|
5633
5699
|
videoId: string;
|
|
@@ -6018,7 +6084,7 @@ declare type SceneMetadata<TType extends InteractiveWidgetSceneTemplateType> = T
|
|
|
6018
6084
|
} : TType extends InteractiveWidgetSceneTemplateType.LEADERBOARD ? {
|
|
6019
6085
|
highlightedPlayers: LeaderboardPlayer[];
|
|
6020
6086
|
topPlayers: LeaderboardPlayer[];
|
|
6021
|
-
stats?:
|
|
6087
|
+
stats?: InteractiveWidgetGroupStats;
|
|
6022
6088
|
} : 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
6089
|
|
|
6024
6090
|
export declare interface SceneMetadataKeys {
|
|
@@ -6171,6 +6237,13 @@ export declare type SdkReactConfig = Omit<TivioConfig, 'language'> & {
|
|
|
6171
6237
|
language?: LangCode;
|
|
6172
6238
|
};
|
|
6173
6239
|
|
|
6240
|
+
/**
|
|
6241
|
+
* Narrows away `InternalInteractiveWidgetMethods` from any concrete widget
|
|
6242
|
+
* type. Distributes over discriminated unions so `SDKWidget<InteractiveWidget>`
|
|
6243
|
+
* stays a union of `SDKWidget<QuizWidget> | SDKWidget<PollWidget>`.
|
|
6244
|
+
*/
|
|
6245
|
+
export declare type SDKWidget<T> = T extends unknown ? Omit<T, InternalInteractiveWidgetMethods> : never;
|
|
6246
|
+
|
|
6174
6247
|
/**
|
|
6175
6248
|
* @public
|
|
6176
6249
|
* @deprecated sections are no longer used.
|
|
@@ -7549,6 +7622,22 @@ export declare type TivioHooks = {
|
|
|
7549
7622
|
};
|
|
7550
7623
|
useChannelSource: UseChannelSource;
|
|
7551
7624
|
useTvChannel: UseTvChannel;
|
|
7625
|
+
useInteractiveWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
7626
|
+
widget: SDKWidget<InteractiveWidget> | null;
|
|
7627
|
+
isLoading: boolean;
|
|
7628
|
+
error: Error | null;
|
|
7629
|
+
};
|
|
7630
|
+
useQuizWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
7631
|
+
widget: SDKWidget<QuizWidget> | null;
|
|
7632
|
+
isLoading: boolean;
|
|
7633
|
+
error: Error | null;
|
|
7634
|
+
};
|
|
7635
|
+
usePollWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
7636
|
+
widget: SDKWidget<PollWidget> | null;
|
|
7637
|
+
isLoading: boolean;
|
|
7638
|
+
error: Error | null;
|
|
7639
|
+
};
|
|
7640
|
+
useRemoteController: UseRemoteController;
|
|
7552
7641
|
};
|
|
7553
7642
|
|
|
7554
7643
|
/**
|
|
@@ -8197,6 +8286,18 @@ export declare type UseEpisodesResult = {
|
|
|
8197
8286
|
hasMoreEpisodes: boolean;
|
|
8198
8287
|
};
|
|
8199
8288
|
|
|
8289
|
+
/**
|
|
8290
|
+
* Load the interactive widget at `widgetPath` via the remote Tivio bundle.
|
|
8291
|
+
* Returns the union widget (`QuizWidget | PollWidget`); narrow
|
|
8292
|
+
* on `widget.type` to access type-specific fields. Prefer `useQuizWidget` /
|
|
8293
|
+
* `usePollWidget` when you know the type up-front.
|
|
8294
|
+
*/
|
|
8295
|
+
export declare const useInteractiveWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
8296
|
+
widget: SDKWidget<InteractiveWidget> | null;
|
|
8297
|
+
isLoading: boolean;
|
|
8298
|
+
error: Error | null;
|
|
8299
|
+
};
|
|
8300
|
+
|
|
8200
8301
|
/**
|
|
8201
8302
|
* @public
|
|
8202
8303
|
*/
|
|
@@ -8289,6 +8390,12 @@ export declare const useOrganizationSubscriptions: (onlyPurchasableSubscriptions
|
|
|
8289
8390
|
subscriptions: PurchasableMonetization[];
|
|
8290
8391
|
};
|
|
8291
8392
|
|
|
8393
|
+
export declare const usePollWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
8394
|
+
widget: Omit<PollWidget<InteractiveWidgetScene>, InternalInteractiveWidgetMethods> | null;
|
|
8395
|
+
isLoading: boolean;
|
|
8396
|
+
error: Error | null;
|
|
8397
|
+
};
|
|
8398
|
+
|
|
8292
8399
|
/**
|
|
8293
8400
|
* Is used to mark purchase in recovery state as PAID.
|
|
8294
8401
|
*
|
|
@@ -8310,6 +8417,12 @@ export declare function usePurchaseRecovery(): {
|
|
|
8310
8417
|
*/
|
|
8311
8418
|
export declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
|
|
8312
8419
|
|
|
8420
|
+
export declare const useQuizWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
8421
|
+
widget: Omit<QuizWidget<InteractiveWidgetScene>, InternalInteractiveWidgetMethods> | null;
|
|
8422
|
+
isLoading: boolean;
|
|
8423
|
+
error: Error | null;
|
|
8424
|
+
};
|
|
8425
|
+
|
|
8313
8426
|
/**
|
|
8314
8427
|
* @public
|
|
8315
8428
|
*/
|
|
@@ -8451,6 +8564,58 @@ export declare interface UseReactionsOptions {
|
|
|
8451
8564
|
onError?: (error: Error) => void;
|
|
8452
8565
|
}
|
|
8453
8566
|
|
|
8567
|
+
/**
|
|
8568
|
+
* @public
|
|
8569
|
+
*/
|
|
8570
|
+
export declare type UseRemoteController = (options?: UseRemoteControllerOptions) => UseRemoteControllerResult;
|
|
8571
|
+
|
|
8572
|
+
export declare const useRemoteController: UseRemoteController;
|
|
8573
|
+
|
|
8574
|
+
/**
|
|
8575
|
+
* @public
|
|
8576
|
+
*/
|
|
8577
|
+
export declare interface UseRemoteControllerOptions {
|
|
8578
|
+
sessionId?: string;
|
|
8579
|
+
videoId?: string;
|
|
8580
|
+
}
|
|
8581
|
+
|
|
8582
|
+
/**
|
|
8583
|
+
* @public
|
|
8584
|
+
*/
|
|
8585
|
+
export declare type UseRemoteControllerPlaybackControlPayload = Pick<RemoteControlPlaybackControlPayload, 'playback' | 'activeVideoId'> & Partial<Pick<RemoteControlPlaybackControlPayload, 'sessionId' | 'videoId'>>;
|
|
8586
|
+
|
|
8587
|
+
/**
|
|
8588
|
+
* @public
|
|
8589
|
+
*/
|
|
8590
|
+
export declare type UseRemoteControllerPlayHighlightPayload = Pick<RemoteControlPlayHighlightPayload, 'activeVideoId' | 'replay'> & Partial<Pick<RemoteControlPlayHighlightPayload, 'sessionId' | 'videoId'>>;
|
|
8591
|
+
|
|
8592
|
+
/**
|
|
8593
|
+
* @public
|
|
8594
|
+
*/
|
|
8595
|
+
export declare interface UseRemoteControllerResult {
|
|
8596
|
+
session: UserStreamingSessionFieldInterface | null;
|
|
8597
|
+
sessionId: string | null;
|
|
8598
|
+
videoId: string | null;
|
|
8599
|
+
activeContentId: string | null;
|
|
8600
|
+
isInitialized: boolean;
|
|
8601
|
+
isSignedIn: boolean;
|
|
8602
|
+
isLoading: boolean;
|
|
8603
|
+
error: Error | null;
|
|
8604
|
+
resetError: () => void;
|
|
8605
|
+
pairDevice: (payload: RemoteControlPairPayload) => Promise<RemoteControlPairResponse>;
|
|
8606
|
+
unpairDevice: (payload?: Partial<RemoteControlUnpairPayload>) => Promise<boolean | string>;
|
|
8607
|
+
selectCamera: (payload: UseRemoteControllerSelectCameraPayload) => Promise<boolean | string>;
|
|
8608
|
+
playHighlight: (payload: UseRemoteControllerPlayHighlightPayload) => Promise<boolean | string>;
|
|
8609
|
+
playbackControl: (payload: UseRemoteControllerPlaybackControlPayload) => Promise<boolean | string>;
|
|
8610
|
+
getSourceUrl: (payload: RemoteControlGetSourceUrlPayload) => Promise<RemoteControlGenerateSourceResponse>;
|
|
8611
|
+
remoteControl: <TResponse = RemoteControlGenerateSourceResponse | boolean | string>(payload: RemoteControlRequest) => Promise<TResponse>;
|
|
8612
|
+
}
|
|
8613
|
+
|
|
8614
|
+
/**
|
|
8615
|
+
* @public
|
|
8616
|
+
*/
|
|
8617
|
+
export declare type UseRemoteControllerSelectCameraPayload = Pick<RemoteControlSelectCameraPayload, 'activeVideoId'> & Partial<Pick<RemoteControlSelectCameraPayload, 'sessionId' | 'videoId'>>;
|
|
8618
|
+
|
|
8454
8619
|
export declare enum UserGroup {
|
|
8455
8620
|
ALL = "all",
|
|
8456
8621
|
FREE = "free",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tivio/sdk-react",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@material-ui/core": "^4.11.2",
|
|
40
40
|
"@material-ui/icons": "^4.11.2",
|
|
41
41
|
"@sentry/browser": "^6.1.0",
|
|
42
|
-
"@tivio/common": "1.1.
|
|
42
|
+
"@tivio/common": "1.1.135",
|
|
43
43
|
"dayjs": "^1.11.0",
|
|
44
44
|
"es7-object-polyfill": "^1.0.1",
|
|
45
45
|
"firebase": "8.10.1",
|