@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/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
## Changelog
|
|
2
|
+
* 10.1.0
|
|
3
|
+
* minor: expose useInteractiveWidget, usePollWidget, useQuizWidget, useRemoteController
|
|
4
|
+
* minor: expose useRemoteController hook
|
|
5
|
+
|
|
2
6
|
* 10.0.0
|
|
3
7
|
* major: **BREAKING** new purchase flow — `PurchasableMonetization.frequency` is now a structured object (`{ unit, value, title }`) instead of a plain `MONETIZATION_FREQUENCY` enum value. Replace `frequency === MONETIZATION_FREQUENCY.X` checks with `frequency?.unit === MONETIZATION_FREQUENCY.X`. The new `value` and `title` fields make it easier to render recurring prices (e.g. "9.99 € / 3 months") without hand-rolling the period label.
|
|
4
8
|
* major: **BREAKING** `TileProps` renamed to `TileComponentProps` to avoid a naming collision with the `TileProps` exported from row types
|
package/README.md
CHANGED
|
@@ -8,9 +8,9 @@ settings in the administration of Tivio Studio while having the freedom to build
|
|
|
8
8
|
|
|
9
9
|
Install @tivio/sdk-react along with its peer dependencies
|
|
10
10
|
```sh
|
|
11
|
-
npm i react@
|
|
11
|
+
npm i react@18 react-dom@18 @tivio/sdk-react
|
|
12
12
|
# or
|
|
13
|
-
yarn add react@
|
|
13
|
+
yarn add react@18 react-dom@18 @tivio/sdk-react
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Initialization
|
package/README.md.bak
CHANGED
|
@@ -8,9 +8,9 @@ settings in the administration of Tivio Studio while having the freedom to build
|
|
|
8
8
|
|
|
9
9
|
Install @tivio/sdk-react along with its peer dependencies
|
|
10
10
|
```sh
|
|
11
|
-
npm i react@
|
|
11
|
+
npm i react@18 react-dom@18 @tivio/sdk-react
|
|
12
12
|
# or
|
|
13
|
-
yarn add react@
|
|
13
|
+
yarn add react@18 react-dom@18 @tivio/sdk-react
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## Initialization
|
package/dist/index.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
|
|
@@ -1313,13 +1359,17 @@ export declare type CurrencyLowerCase = 'czk' | 'eur' | 'usd' | 'pln';
|
|
|
1313
1359
|
*/
|
|
1314
1360
|
export declare const CurrencyToTitle: Record<Currency, string>;
|
|
1315
1361
|
|
|
1316
|
-
|
|
1362
|
+
/**
|
|
1363
|
+
* Generic "current question" shape, parameterized by answer type.
|
|
1364
|
+
* Use `QuizQuestion` / `PollQuestion` for concrete forms.
|
|
1365
|
+
*/
|
|
1366
|
+
export declare interface CurrentQuestion<TAnswer extends BaseQuestionAnswer = QuestionAnswer> {
|
|
1317
1367
|
id: string;
|
|
1318
1368
|
question: Translation;
|
|
1319
|
-
answers?:
|
|
1369
|
+
answers?: TAnswer[];
|
|
1320
1370
|
index?: number;
|
|
1321
1371
|
endTimestampMs?: number;
|
|
1322
|
-
status?:
|
|
1372
|
+
status?: InteractiveWidgetStatus;
|
|
1323
1373
|
}
|
|
1324
1374
|
|
|
1325
1375
|
export declare type CurrentQuestionScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.CURRENT_QUESTION>;
|
|
@@ -2449,41 +2499,10 @@ export declare interface IndexedVideo extends IndexedObject {
|
|
|
2449
2499
|
|
|
2450
2500
|
export declare type IntegrationType = 'discord' | 'patreon';
|
|
2451
2501
|
|
|
2452
|
-
export declare
|
|
2453
|
-
readonly id: string;
|
|
2454
|
-
readonly name: string;
|
|
2455
|
-
readonly path: string;
|
|
2456
|
-
readonly currentQuestion: CurrentQuestion | null;
|
|
2457
|
-
readonly status: QuizGameStatus;
|
|
2458
|
-
readonly questionsCount: number;
|
|
2459
|
-
readonly currentAnswerId?: string;
|
|
2460
|
-
readonly currentState: InteractiveWidgetState;
|
|
2461
|
-
/**
|
|
2462
|
-
* State delayed for end users, which is used to toggle scenes just like in OBS and host view
|
|
2463
|
-
*/
|
|
2464
|
-
readonly currentStateWithDelay: InteractiveWidgetCurrentStateWithDelay;
|
|
2465
|
-
readonly answers?: QuestionAnswer[];
|
|
2466
|
-
readonly questionIndex?: number;
|
|
2467
|
-
readonly isSubmitted?: boolean;
|
|
2468
|
-
readonly leaderboard: LeaderboardGroupItem | null;
|
|
2469
|
-
readonly highlightedUsersIds: string[];
|
|
2470
|
-
readonly userRole: QuizGameRole;
|
|
2471
|
-
readonly secondsToAnswer: number;
|
|
2472
|
-
readonly scenes: T[];
|
|
2473
|
-
readonly activeScene: T | null;
|
|
2474
|
-
readonly theme?: InteractiveWidgetTheme;
|
|
2475
|
-
readonly showCountdown: boolean;
|
|
2476
|
-
readonly lastQuestionTopScorers: LeaderboardPlayer[];
|
|
2477
|
-
readonly questionRepository: QuestionRepository;
|
|
2478
|
-
readonly isWaitingForStart: boolean;
|
|
2479
|
-
answerQuestion(answerId: string): void;
|
|
2480
|
-
submitAnswer(request: Pick<SubmitAnswerRequest, 'answerOptionId' | 'answerText'>): Promise<void>;
|
|
2481
|
-
verifyJoinCode(joinCode: string, shouldJoinPlayer?: boolean): Promise<boolean>;
|
|
2482
|
-
destroy(): void;
|
|
2483
|
-
}
|
|
2502
|
+
export declare type InteractiveWidget<TScene extends InteractiveWidgetScene = InteractiveWidgetScene> = QuizWidget<TScene> | PollWidget<TScene>;
|
|
2484
2503
|
|
|
2485
|
-
export declare interface InteractiveWidgetCurrentStateWithDelay {
|
|
2486
|
-
state:
|
|
2504
|
+
export declare interface InteractiveWidgetCurrentStateWithDelay<TState extends InteractiveWidgetState = InteractiveWidgetState> {
|
|
2505
|
+
state: TState;
|
|
2487
2506
|
enteredAt: Date;
|
|
2488
2507
|
}
|
|
2489
2508
|
|
|
@@ -2497,6 +2516,27 @@ export declare enum InteractiveWidgetDisplayComponent {
|
|
|
2497
2516
|
AD_VAST = "adVast"
|
|
2498
2517
|
}
|
|
2499
2518
|
|
|
2519
|
+
export declare interface InteractiveWidgetGroupStats {
|
|
2520
|
+
answerPercentages: Record<string, number>;
|
|
2521
|
+
averageScore: number;
|
|
2522
|
+
correctAnswersRatio: number;
|
|
2523
|
+
}
|
|
2524
|
+
|
|
2525
|
+
export declare enum InteractiveWidgetGroupType {
|
|
2526
|
+
HIGHLIGHTED_PLAYERS = "HIGHLIGHTED_PLAYERS",
|
|
2527
|
+
/** Participants playing in Offline mode */
|
|
2528
|
+
LOCAL_PLAYERS = "LOCAL_PLAYERS",
|
|
2529
|
+
ALL = "ALL",
|
|
2530
|
+
PARTY = "PARTY"
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
export declare enum InteractiveWidgetRole {
|
|
2534
|
+
OBS = "OBS",
|
|
2535
|
+
HOST = "HOST",
|
|
2536
|
+
PLAYER = "PLAYER",
|
|
2537
|
+
LOCAL_PLAYER = "LOCAL_PLAYER"
|
|
2538
|
+
}
|
|
2539
|
+
|
|
2500
2540
|
export declare type InteractiveWidgetScene = CurrentQuestionScene | LeaderboardScene | QRCodeScene | AdBannerScene | PlayersScene | NoGraphicsScene | CountdownScene;
|
|
2501
2541
|
|
|
2502
2542
|
export declare interface InteractiveWidgetSceneBase<TType extends InteractiveWidgetSceneTemplateType> {
|
|
@@ -2554,6 +2594,16 @@ export declare enum InteractiveWidgetState {
|
|
|
2554
2594
|
RESET_GAME = "ResetGame"
|
|
2555
2595
|
}
|
|
2556
2596
|
|
|
2597
|
+
export declare enum InteractiveWidgetStatus {
|
|
2598
|
+
/**
|
|
2599
|
+
* Waiting to start the quiz / question
|
|
2600
|
+
*/
|
|
2601
|
+
WAITING = "WAITING",
|
|
2602
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
2603
|
+
IN_BETWEEN_QUESTIONS = "IN_BETWEEN_QUESTIONS",
|
|
2604
|
+
DONE = "DONE"
|
|
2605
|
+
}
|
|
2606
|
+
|
|
2557
2607
|
export declare interface InteractiveWidgetTheme {
|
|
2558
2608
|
palette: Record<string, string>;
|
|
2559
2609
|
components: {
|
|
@@ -2563,6 +2613,11 @@ export declare interface InteractiveWidgetTheme {
|
|
|
2563
2613
|
|
|
2564
2614
|
declare type InteractiveWidgetThemeKey = InteractiveWidgetDisplayComponent | `${InteractiveWidgetDisplayComponent.CURRENT_QUESTION}${AnswerStatus}` | 'timeLeftBar';
|
|
2565
2615
|
|
|
2616
|
+
export declare enum InteractiveWidgetType {
|
|
2617
|
+
POLL = "POLL",
|
|
2618
|
+
QUIZ = "QUIZ"
|
|
2619
|
+
}
|
|
2620
|
+
|
|
2566
2621
|
/**
|
|
2567
2622
|
* @public
|
|
2568
2623
|
*/
|
|
@@ -2589,6 +2644,15 @@ export declare type InternalConfig = SdkReactConfig & {
|
|
|
2589
2644
|
forceCloudFnResolver?: boolean;
|
|
2590
2645
|
};
|
|
2591
2646
|
|
|
2647
|
+
/**
|
|
2648
|
+
* Subset of `BaseInteractiveWidget` methods that are intentionally **not**
|
|
2649
|
+
* advertised on the SDK hook return types (`useInteractiveWidget`,
|
|
2650
|
+
* `useQuizWidget`, `usePollWidget`). These methods still exist at runtime and
|
|
2651
|
+
* are used by internal `core-react-dom` UI / server flows — they're just hidden
|
|
2652
|
+
* from external SDK consumers, which should only call `submitAnswer`.
|
|
2653
|
+
*/
|
|
2654
|
+
export declare type InternalInteractiveWidgetMethods = 'answerQuestion' | 'verifyJoinCode' | 'changeState';
|
|
2655
|
+
|
|
2592
2656
|
/**
|
|
2593
2657
|
* @public
|
|
2594
2658
|
*/
|
|
@@ -2743,7 +2807,7 @@ export declare interface LastMessage {
|
|
|
2743
2807
|
export declare interface LeaderboardGroupItem {
|
|
2744
2808
|
groupPath?: string;
|
|
2745
2809
|
groupName?: string;
|
|
2746
|
-
type:
|
|
2810
|
+
type: InteractiveWidgetGroupType;
|
|
2747
2811
|
/**
|
|
2748
2812
|
* Consists of top 3 players of the group (global or private team)
|
|
2749
2813
|
* the player's rank in the group
|
|
@@ -4370,6 +4434,22 @@ export declare enum PlayerWrapperEventType {
|
|
|
4370
4434
|
*/
|
|
4371
4435
|
export declare type PlayerWrapperEventTypeType = `${PlayerWrapperEventType}`;
|
|
4372
4436
|
|
|
4437
|
+
export declare type PollQuestion = CurrentQuestion<PollQuestionAnswer>;
|
|
4438
|
+
|
|
4439
|
+
export declare interface PollQuestionAnswer extends BaseQuestionAnswer {
|
|
4440
|
+
votes?: number;
|
|
4441
|
+
}
|
|
4442
|
+
|
|
4443
|
+
/**
|
|
4444
|
+
* A poll-flavored interactive widget. No scoring / leaderboard / countdown — just
|
|
4445
|
+
* "here's a question, here are the vote counts". Uses a narrower state machine.
|
|
4446
|
+
*/
|
|
4447
|
+
export declare interface PollWidget<TScene extends InteractiveWidgetScene = InteractiveWidgetScene> extends BaseInteractiveWidget<PollQuestionAnswer, PollWidgetState, TScene> {
|
|
4448
|
+
readonly type: InteractiveWidgetType.POLL;
|
|
4449
|
+
}
|
|
4450
|
+
|
|
4451
|
+
export declare type PollWidgetState = InteractiveWidgetState.IDLE | InteractiveWidgetState.CURRENT_QUESTION | InteractiveWidgetState.LEADERBOARD | InteractiveWidgetState.RESET_GAME | InteractiveWidgetState.NEXT_STATE;
|
|
4452
|
+
|
|
4373
4453
|
/**
|
|
4374
4454
|
* @public
|
|
4375
4455
|
*/
|
|
@@ -5035,13 +5115,7 @@ export declare interface QerkoTransaction {
|
|
|
5035
5115
|
|
|
5036
5116
|
export declare type QRCodeScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.QR_CODE>;
|
|
5037
5117
|
|
|
5038
|
-
export declare
|
|
5039
|
-
id: string;
|
|
5040
|
-
answer: Translation;
|
|
5041
|
-
isCorrect?: boolean;
|
|
5042
|
-
votes?: number;
|
|
5043
|
-
status?: AnswerStatus;
|
|
5044
|
-
}
|
|
5118
|
+
export declare type QuestionAnswer = QuizQuestionAnswer | PollQuestionAnswer;
|
|
5045
5119
|
|
|
5046
5120
|
export declare enum QuestionEvents {
|
|
5047
5121
|
NEW_QUESTION = "new_question",
|
|
@@ -5059,7 +5133,7 @@ export declare interface QuestionRepository {
|
|
|
5059
5133
|
readonly selectedAnswerId: string | undefined;
|
|
5060
5134
|
isSubmitted: boolean;
|
|
5061
5135
|
isSubmitting: boolean;
|
|
5062
|
-
setCurrentQuestion: (question: CurrentQuestion | null, role:
|
|
5136
|
+
setCurrentQuestion: (question: CurrentQuestion | null, role: InteractiveWidgetRole, secondsToAnswer: number, shouldEnterAtTimestampMs?: number, shouldAdjustEndTimestampMs?: boolean) => void;
|
|
5063
5137
|
selectAnswer: (answerId: string | undefined) => void;
|
|
5064
5138
|
setShowCountdown: (showCountdown: boolean) => void;
|
|
5065
5139
|
reset: () => void;
|
|
@@ -5073,41 +5147,28 @@ export declare type QuestionRepositoryEventMap = {
|
|
|
5073
5147
|
[QuestionEvents.QUESTION_TIMEOUT]: (question: CurrentQuestion | null) => void;
|
|
5074
5148
|
};
|
|
5075
5149
|
|
|
5076
|
-
export declare
|
|
5077
|
-
answerPercentages: Record<string, number>;
|
|
5078
|
-
averageScore: number;
|
|
5079
|
-
correctAnswersRatio: number;
|
|
5080
|
-
}
|
|
5081
|
-
|
|
5082
|
-
export declare enum QuizGameGroupType {
|
|
5083
|
-
HIGHLIGHTED_PLAYERS = "HIGHLIGHTED_PLAYERS",
|
|
5084
|
-
/** Participants playing in Offline mode */
|
|
5085
|
-
LOCAL_PLAYERS = "LOCAL_PLAYERS",
|
|
5086
|
-
ALL = "ALL",
|
|
5087
|
-
PARTY = "PARTY"
|
|
5088
|
-
}
|
|
5150
|
+
export declare type QuizQuestion = CurrentQuestion<QuizQuestionAnswer>;
|
|
5089
5151
|
|
|
5090
|
-
export declare
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
PLAYER = "PLAYER",
|
|
5094
|
-
LOCAL_PLAYER = "LOCAL_PLAYER"
|
|
5152
|
+
export declare interface QuizQuestionAnswer extends BaseQuestionAnswer {
|
|
5153
|
+
isCorrect?: boolean;
|
|
5154
|
+
votes?: number;
|
|
5095
5155
|
}
|
|
5096
5156
|
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5157
|
+
/**
|
|
5158
|
+
* A quiz-flavored interactive widget. Adds scoring, leaderboard, and countdown
|
|
5159
|
+
* concepts on top of the base, and narrows answers to `QuizQuestionAnswer`.
|
|
5160
|
+
*/
|
|
5161
|
+
export declare interface QuizWidget<TScene extends InteractiveWidgetScene = InteractiveWidgetScene> extends BaseInteractiveWidget<QuizQuestionAnswer, QuizWidgetState, TScene> {
|
|
5162
|
+
readonly type: InteractiveWidgetType.QUIZ;
|
|
5163
|
+
readonly leaderboard: LeaderboardGroupItem | null;
|
|
5164
|
+
readonly lastQuestionTopScorers: LeaderboardPlayer[];
|
|
5165
|
+
readonly highlightedUsersIds: string[];
|
|
5166
|
+
readonly secondsToAnswer: number;
|
|
5167
|
+
readonly showCountdown: boolean;
|
|
5168
|
+
readonly questionRepository: QuestionRepository;
|
|
5105
5169
|
}
|
|
5106
5170
|
|
|
5107
|
-
export declare
|
|
5108
|
-
POLL = "POLL",
|
|
5109
|
-
QUIZ = "QUIZ"
|
|
5110
|
-
}
|
|
5171
|
+
export declare type QuizWidgetState = InteractiveWidgetState;
|
|
5111
5172
|
|
|
5112
5173
|
/**
|
|
5113
5174
|
* @public
|
|
@@ -5224,6 +5285,11 @@ export declare interface RemoteControlPairPayload {
|
|
|
5224
5285
|
profileId: string;
|
|
5225
5286
|
}
|
|
5226
5287
|
|
|
5288
|
+
export declare interface RemoteControlPairResponse {
|
|
5289
|
+
sessionId: string;
|
|
5290
|
+
videoId: string;
|
|
5291
|
+
}
|
|
5292
|
+
|
|
5227
5293
|
export declare interface RemoteControlPlaybackControlPayload {
|
|
5228
5294
|
sessionId: string;
|
|
5229
5295
|
videoId: string;
|
|
@@ -5605,7 +5671,7 @@ declare type SceneMetadata<TType extends InteractiveWidgetSceneTemplateType> = T
|
|
|
5605
5671
|
} : TType extends InteractiveWidgetSceneTemplateType.LEADERBOARD ? {
|
|
5606
5672
|
highlightedPlayers: LeaderboardPlayer[];
|
|
5607
5673
|
topPlayers: LeaderboardPlayer[];
|
|
5608
|
-
stats?:
|
|
5674
|
+
stats?: InteractiveWidgetGroupStats;
|
|
5609
5675
|
} : 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;
|
|
5610
5676
|
|
|
5611
5677
|
export declare interface SceneMetadataKeys {
|
|
@@ -5758,6 +5824,13 @@ export declare type SdkReactConfig = Omit<TivioConfig, 'language'> & {
|
|
|
5758
5824
|
language?: LangCode;
|
|
5759
5825
|
};
|
|
5760
5826
|
|
|
5827
|
+
/**
|
|
5828
|
+
* Narrows away `InternalInteractiveWidgetMethods` from any concrete widget
|
|
5829
|
+
* type. Distributes over discriminated unions so `SDKWidget<InteractiveWidget>`
|
|
5830
|
+
* stays a union of `SDKWidget<QuizWidget> | SDKWidget<PollWidget>`.
|
|
5831
|
+
*/
|
|
5832
|
+
export declare type SDKWidget<T> = T extends unknown ? Omit<T, InternalInteractiveWidgetMethods> : never;
|
|
5833
|
+
|
|
5761
5834
|
/**
|
|
5762
5835
|
* @public
|
|
5763
5836
|
* @deprecated sections are no longer used.
|
|
@@ -7050,6 +7123,22 @@ export declare type TivioHooks = {
|
|
|
7050
7123
|
};
|
|
7051
7124
|
useChannelSource: UseChannelSource;
|
|
7052
7125
|
useTvChannel: UseTvChannel;
|
|
7126
|
+
useInteractiveWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
7127
|
+
widget: SDKWidget<InteractiveWidget> | null;
|
|
7128
|
+
isLoading: boolean;
|
|
7129
|
+
error: Error | null;
|
|
7130
|
+
};
|
|
7131
|
+
useQuizWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
7132
|
+
widget: SDKWidget<QuizWidget> | null;
|
|
7133
|
+
isLoading: boolean;
|
|
7134
|
+
error: Error | null;
|
|
7135
|
+
};
|
|
7136
|
+
usePollWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
7137
|
+
widget: SDKWidget<PollWidget> | null;
|
|
7138
|
+
isLoading: boolean;
|
|
7139
|
+
error: Error | null;
|
|
7140
|
+
};
|
|
7141
|
+
useRemoteController: UseRemoteController;
|
|
7053
7142
|
};
|
|
7054
7143
|
|
|
7055
7144
|
/**
|
|
@@ -7690,6 +7779,18 @@ export declare type UseEpisodesResult = {
|
|
|
7690
7779
|
hasMoreEpisodes: boolean;
|
|
7691
7780
|
};
|
|
7692
7781
|
|
|
7782
|
+
/**
|
|
7783
|
+
* Load the interactive widget at `widgetPath` via the remote Tivio bundle.
|
|
7784
|
+
* Returns the union widget (`QuizWidget | PollWidget`); narrow
|
|
7785
|
+
* on `widget.type` to access type-specific fields. Prefer `useQuizWidget` /
|
|
7786
|
+
* `usePollWidget` when you know the type up-front.
|
|
7787
|
+
*/
|
|
7788
|
+
export declare const useInteractiveWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
7789
|
+
widget: SDKWidget<InteractiveWidget> | null;
|
|
7790
|
+
isLoading: boolean;
|
|
7791
|
+
error: Error | null;
|
|
7792
|
+
};
|
|
7793
|
+
|
|
7693
7794
|
/**
|
|
7694
7795
|
* @public
|
|
7695
7796
|
*/
|
|
@@ -7782,6 +7883,12 @@ export declare const useOrganizationSubscriptions: (onlyPurchasableSubscriptions
|
|
|
7782
7883
|
subscriptions: PurchasableMonetization[];
|
|
7783
7884
|
};
|
|
7784
7885
|
|
|
7886
|
+
export declare const usePollWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
7887
|
+
widget: Omit<PollWidget<InteractiveWidgetScene>, InternalInteractiveWidgetMethods> | null;
|
|
7888
|
+
isLoading: boolean;
|
|
7889
|
+
error: Error | null;
|
|
7890
|
+
};
|
|
7891
|
+
|
|
7785
7892
|
/**
|
|
7786
7893
|
* Is used to mark purchase in recovery state as PAID.
|
|
7787
7894
|
*
|
|
@@ -7803,6 +7910,12 @@ export declare function usePurchaseRecovery(): {
|
|
|
7803
7910
|
*/
|
|
7804
7911
|
export declare const usePurchaseSubscription: (monetizationId: string, voucher?: NewVoucher) => QerkoTransaction;
|
|
7805
7912
|
|
|
7913
|
+
export declare const useQuizWidget: (widgetPath: string | undefined, isObs?: boolean) => {
|
|
7914
|
+
widget: Omit<QuizWidget<InteractiveWidgetScene>, InternalInteractiveWidgetMethods> | null;
|
|
7915
|
+
isLoading: boolean;
|
|
7916
|
+
error: Error | null;
|
|
7917
|
+
};
|
|
7918
|
+
|
|
7806
7919
|
/**
|
|
7807
7920
|
* @public
|
|
7808
7921
|
*/
|
|
@@ -7944,6 +8057,58 @@ export declare interface UseReactionsOptions {
|
|
|
7944
8057
|
onError?: (error: Error) => void;
|
|
7945
8058
|
}
|
|
7946
8059
|
|
|
8060
|
+
/**
|
|
8061
|
+
* @public
|
|
8062
|
+
*/
|
|
8063
|
+
export declare type UseRemoteController = (options?: UseRemoteControllerOptions) => UseRemoteControllerResult;
|
|
8064
|
+
|
|
8065
|
+
export declare const useRemoteController: UseRemoteController;
|
|
8066
|
+
|
|
8067
|
+
/**
|
|
8068
|
+
* @public
|
|
8069
|
+
*/
|
|
8070
|
+
export declare interface UseRemoteControllerOptions {
|
|
8071
|
+
sessionId?: string;
|
|
8072
|
+
videoId?: string;
|
|
8073
|
+
}
|
|
8074
|
+
|
|
8075
|
+
/**
|
|
8076
|
+
* @public
|
|
8077
|
+
*/
|
|
8078
|
+
export declare type UseRemoteControllerPlaybackControlPayload = Pick<RemoteControlPlaybackControlPayload, 'playback' | 'activeVideoId'> & Partial<Pick<RemoteControlPlaybackControlPayload, 'sessionId' | 'videoId'>>;
|
|
8079
|
+
|
|
8080
|
+
/**
|
|
8081
|
+
* @public
|
|
8082
|
+
*/
|
|
8083
|
+
export declare type UseRemoteControllerPlayHighlightPayload = Pick<RemoteControlPlayHighlightPayload, 'activeVideoId' | 'replay'> & Partial<Pick<RemoteControlPlayHighlightPayload, 'sessionId' | 'videoId'>>;
|
|
8084
|
+
|
|
8085
|
+
/**
|
|
8086
|
+
* @public
|
|
8087
|
+
*/
|
|
8088
|
+
export declare interface UseRemoteControllerResult {
|
|
8089
|
+
session: UserStreamingSessionFieldInterface | null;
|
|
8090
|
+
sessionId: string | null;
|
|
8091
|
+
videoId: string | null;
|
|
8092
|
+
activeContentId: string | null;
|
|
8093
|
+
isInitialized: boolean;
|
|
8094
|
+
isSignedIn: boolean;
|
|
8095
|
+
isLoading: boolean;
|
|
8096
|
+
error: Error | null;
|
|
8097
|
+
resetError: () => void;
|
|
8098
|
+
pairDevice: (payload: RemoteControlPairPayload) => Promise<RemoteControlPairResponse>;
|
|
8099
|
+
unpairDevice: (payload?: Partial<RemoteControlUnpairPayload>) => Promise<boolean | string>;
|
|
8100
|
+
selectCamera: (payload: UseRemoteControllerSelectCameraPayload) => Promise<boolean | string>;
|
|
8101
|
+
playHighlight: (payload: UseRemoteControllerPlayHighlightPayload) => Promise<boolean | string>;
|
|
8102
|
+
playbackControl: (payload: UseRemoteControllerPlaybackControlPayload) => Promise<boolean | string>;
|
|
8103
|
+
getSourceUrl: (payload: RemoteControlGetSourceUrlPayload) => Promise<RemoteControlGenerateSourceResponse>;
|
|
8104
|
+
remoteControl: <TResponse = RemoteControlGenerateSourceResponse | boolean | string>(payload: RemoteControlRequest) => Promise<TResponse>;
|
|
8105
|
+
}
|
|
8106
|
+
|
|
8107
|
+
/**
|
|
8108
|
+
* @public
|
|
8109
|
+
*/
|
|
8110
|
+
export declare type UseRemoteControllerSelectCameraPayload = Pick<RemoteControlSelectCameraPayload, 'activeVideoId'> & Partial<Pick<RemoteControlSelectCameraPayload, 'sessionId' | 'videoId'>>;
|
|
8111
|
+
|
|
7947
8112
|
export declare enum UserGroup {
|
|
7948
8113
|
ALL = "all",
|
|
7949
8114
|
FREE = "free",
|