@tivio/sdk-react 9.1.3-alpha3 → 9.1.3
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 +4 -0
- package/README.md.bak +4 -0
- package/dist/index.d.ts +450 -34
- package/dist/index.js +1 -1
- package/dist/sdk-react.d.ts +458 -34
- package/package.json +2 -2
package/dist/sdk-react.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { ComponentType } from 'react';
|
1
|
+
import type { ComponentType } from 'react';
|
2
2
|
import type dayjs from 'dayjs';
|
3
3
|
import { DocumentReference } from '@firebase/firestore-types';
|
4
4
|
import type duration from 'dayjs/plugin/duration';
|
5
|
-
import firebase from '@firebase/app-types';
|
5
|
+
import type firebase from '@firebase/app-types';
|
6
6
|
import { FunctionComponentElement } from 'react';
|
7
7
|
import type { GeoPoint } from '@firebase/firestore-types';
|
8
8
|
import { OperatingSystem } from 'detect-browser';
|
@@ -21,6 +21,8 @@ export declare type ActivateVoucherResponse = string | {
|
|
21
21
|
activatedPromotions: ActivatedPromotionResponse[];
|
22
22
|
};
|
23
23
|
|
24
|
+
export declare type AdBannerScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.AD_BANNER>;
|
25
|
+
|
24
26
|
export declare type AddEditCommentResponse = {
|
25
27
|
id: string;
|
26
28
|
error?: string;
|
@@ -515,7 +517,8 @@ export declare enum BannerItemComponent {
|
|
515
517
|
BACKGROUND = "BACKGROUND",
|
516
518
|
BACKGROUND_BLUR = "BACKGROUND_BLUR",
|
517
519
|
ORGANIZATION_BANNER = "ORGANIZATION_BANNER",
|
518
|
-
CAROUSEL = "CAROUSEL"
|
520
|
+
CAROUSEL = "CAROUSEL",
|
521
|
+
RATIO = "RATIO"
|
519
522
|
}
|
520
523
|
|
521
524
|
/**
|
@@ -968,6 +971,8 @@ export declare interface ConversionsTargetItem {
|
|
968
971
|
totalCount: number;
|
969
972
|
}
|
970
973
|
|
974
|
+
export declare type CountdownScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.COUNTDOWN>;
|
975
|
+
|
971
976
|
/**
|
972
977
|
* @public
|
973
978
|
* @TODO move somewhere else
|
@@ -990,6 +995,10 @@ export declare const createPubSub: () => PubSub;
|
|
990
995
|
*/
|
991
996
|
export declare const createRemotePackageLoader: () => (secret: string, conf: InternalConfig, checkBundleCharCount?: boolean) => Promise<TivioBundle>;
|
992
997
|
|
998
|
+
export declare const createTivio: () => (conf: SdkReactConfig) => Promise<RemoteBundleState>;
|
999
|
+
|
1000
|
+
export declare const createUseRemoteBundle: () => (sdkReactConfig: SdkReactConfig, checkBundleCharCount?: boolean) => RemoteBundleState;
|
1001
|
+
|
993
1002
|
export declare interface CreateUserPayload {
|
994
1003
|
displayName?: string;
|
995
1004
|
email?: string;
|
@@ -1030,6 +1039,17 @@ export declare type Currency = 'CZK' | 'EUR' | 'USD';
|
|
1030
1039
|
*/
|
1031
1040
|
export declare type CurrencyLowerCase = 'czk' | 'eur' | 'usd';
|
1032
1041
|
|
1042
|
+
export declare interface CurrentQuestion {
|
1043
|
+
id: string;
|
1044
|
+
question: Translation;
|
1045
|
+
answers?: QuestionAnswer[];
|
1046
|
+
index?: number;
|
1047
|
+
endTimestampMs?: number;
|
1048
|
+
status?: QuizGameStatus;
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
export declare type CurrentQuestionScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.CURRENT_QUESTION>;
|
1052
|
+
|
1033
1053
|
/**
|
1034
1054
|
* @public
|
1035
1055
|
*/
|
@@ -1085,7 +1105,8 @@ export declare enum CustomerId {
|
|
1085
1105
|
NERUDA_TV = "NERUDA_TV",
|
1086
1106
|
DAVID_FRANK_TV = "DAVID_FRANK_TV",
|
1087
1107
|
LEPSI_UZ_TO_NEBUDE = "LEPSI_UZ_TO_NEBUDE",
|
1088
|
-
BEAT_SEXISM = "BEAT_SEXISM"
|
1108
|
+
BEAT_SEXISM = "BEAT_SEXISM",
|
1109
|
+
KAROL_A_KVIDO = "KAROL_A_KVIDO"
|
1089
1110
|
}
|
1090
1111
|
|
1091
1112
|
/**
|
@@ -1121,6 +1142,7 @@ export declare interface Customizations {
|
|
1121
1142
|
borderRadius?: number;
|
1122
1143
|
backgroundColor?: string;
|
1123
1144
|
color?: string;
|
1145
|
+
borderColor?: string;
|
1124
1146
|
};
|
1125
1147
|
SplitBanner: {
|
1126
1148
|
height: string;
|
@@ -1139,6 +1161,10 @@ export declare interface Customizations {
|
|
1139
1161
|
backgroundColor: string;
|
1140
1162
|
color: string;
|
1141
1163
|
};
|
1164
|
+
voucherButton?: {
|
1165
|
+
backgroundColor: string;
|
1166
|
+
color: string;
|
1167
|
+
};
|
1142
1168
|
};
|
1143
1169
|
Row: {
|
1144
1170
|
/**
|
@@ -1150,6 +1176,9 @@ export declare interface Customizations {
|
|
1150
1176
|
header: {
|
1151
1177
|
opacity?: number;
|
1152
1178
|
};
|
1179
|
+
search?: {
|
1180
|
+
bottomComponent?: BottomComponent;
|
1181
|
+
};
|
1153
1182
|
};
|
1154
1183
|
ProgressBar?: {
|
1155
1184
|
color: string;
|
@@ -1790,9 +1819,9 @@ export declare interface GetSourceUrlResponse {
|
|
1790
1819
|
*/
|
1791
1820
|
audioOnly?: boolean;
|
1792
1821
|
/**
|
1793
|
-
*
|
1822
|
+
* Current session id for given user and source.
|
1794
1823
|
*/
|
1795
|
-
|
1824
|
+
sessionId?: string;
|
1796
1825
|
/**
|
1797
1826
|
* Template for generating image previews for user scrubbing in player.
|
1798
1827
|
*/
|
@@ -1870,6 +1899,8 @@ export declare interface GetViewAnalyticsResponse {
|
|
1870
1899
|
|
1871
1900
|
export declare type GetViewsAnalyticsRequest = GetBaseAnalyticsRequest;
|
1872
1901
|
|
1902
|
+
export declare let globalSdkReactConfig: SdkReactConfig | undefined;
|
1903
|
+
|
1873
1904
|
/**
|
1874
1905
|
* @public
|
1875
1906
|
*/
|
@@ -1993,6 +2024,117 @@ export declare interface InputOptions {
|
|
1993
2024
|
|
1994
2025
|
export declare type IntegrationType = 'discord' | 'patreon';
|
1995
2026
|
|
2027
|
+
export declare interface InteractiveWidget<T extends InteractiveWidgetScene = InteractiveWidgetScene> {
|
2028
|
+
readonly id: string;
|
2029
|
+
readonly path: string;
|
2030
|
+
readonly currentQuestion: CurrentQuestion | null;
|
2031
|
+
readonly status: QuizGameStatus;
|
2032
|
+
readonly questionsCount: number;
|
2033
|
+
readonly currentAnswerId?: string;
|
2034
|
+
readonly currentState: InteractiveWidgetState;
|
2035
|
+
/**
|
2036
|
+
* State delayed for end users, which is used to toggle scenes just like in OBS and host view
|
2037
|
+
*/
|
2038
|
+
readonly currentStateWithDelay: InteractiveWidgetCurrentStateWithDelay;
|
2039
|
+
readonly answers?: QuestionAnswer[];
|
2040
|
+
readonly questionIndex?: number;
|
2041
|
+
readonly isSubmitted?: boolean;
|
2042
|
+
readonly leaderboard: LeaderboardGroupItem | null;
|
2043
|
+
readonly highlightedUsersIds: string[];
|
2044
|
+
readonly userRole: QuizGameRole;
|
2045
|
+
readonly secondsToAnswer: number;
|
2046
|
+
readonly scenes: T[];
|
2047
|
+
readonly activeScene: T | null;
|
2048
|
+
readonly theme?: InteractiveWidgetTheme;
|
2049
|
+
readonly showCountdown: boolean;
|
2050
|
+
readonly lastQuestionTopScorers: LeaderboardPlayer[];
|
2051
|
+
readonly questionRepository: QuestionRepository;
|
2052
|
+
readonly isWaitingForStart: boolean;
|
2053
|
+
answerQuestion(answerId: string): void;
|
2054
|
+
submitAnswer(request: Pick<SubmitAnswerRequest, 'answerOptionId' | 'answerText'>): Promise<void>;
|
2055
|
+
destroy(): void;
|
2056
|
+
}
|
2057
|
+
|
2058
|
+
export declare interface InteractiveWidgetCurrentStateWithDelay {
|
2059
|
+
state: InteractiveWidgetState;
|
2060
|
+
enteredAt: Date;
|
2061
|
+
}
|
2062
|
+
|
2063
|
+
export declare enum InteractiveWidgetDisplayComponent {
|
2064
|
+
LEADERBOARD_SUMMARY = "leaderboardSummary",
|
2065
|
+
FULLSCREEN_LEADERBOARD = "fullscreenLeaderboard",
|
2066
|
+
CURRENT_QUESTION = "currentQuestion",
|
2067
|
+
PLAYERS = "players",
|
2068
|
+
QR_CODE = "qrCode",
|
2069
|
+
AD_BANNER = "adBanner",
|
2070
|
+
AD_VAST = "adVast"
|
2071
|
+
}
|
2072
|
+
|
2073
|
+
export declare type InteractiveWidgetScene = CurrentQuestionScene | LeaderboardScene | QRCodeScene | AdBannerScene | PlayersScene | NoGraphicsScene | CountdownScene;
|
2074
|
+
|
2075
|
+
export declare interface InteractiveWidgetSceneBase<TType extends InteractiveWidgetSceneTemplateType> {
|
2076
|
+
id: string;
|
2077
|
+
type: TType;
|
2078
|
+
name: Translation;
|
2079
|
+
metadata: SceneMetadata<TType>;
|
2080
|
+
}
|
2081
|
+
|
2082
|
+
export declare enum InteractiveWidgetSceneTemplateType {
|
2083
|
+
COUNTDOWN = "countdown",
|
2084
|
+
CURRENT_QUESTION = "currentQuestion",
|
2085
|
+
LEADERBOARD = "leaderboard",
|
2086
|
+
PLAYERS = "players",
|
2087
|
+
AD_BANNER = "adBanner",
|
2088
|
+
QR_CODE = "qrCode",
|
2089
|
+
NO_GRAPHICS = "noGraphics"
|
2090
|
+
}
|
2091
|
+
|
2092
|
+
export declare enum InteractiveWidgetState {
|
2093
|
+
/**
|
2094
|
+
* Transition to the next state
|
2095
|
+
*/
|
2096
|
+
NEXT_STATE = "NextState",
|
2097
|
+
/**
|
2098
|
+
* Idle state
|
2099
|
+
* activeSceneIds: noGraphics, adBanner, players
|
2100
|
+
* Idle -> Countdown
|
2101
|
+
*/
|
2102
|
+
IDLE = "Idle",
|
2103
|
+
/**
|
2104
|
+
* Countdown -> CurrentQuestion
|
2105
|
+
*/
|
2106
|
+
COUNTDOWN = "Countdown",
|
2107
|
+
/**
|
2108
|
+
* Displays the current question
|
2109
|
+
*/
|
2110
|
+
CURRENT_QUESTION = "CurrentQuestion",
|
2111
|
+
/**
|
2112
|
+
* CurrentQuestion -> GuestsAnsweredQuestions
|
2113
|
+
*/
|
2114
|
+
GUESTS_ANSWERED_QUESTIONS = "GuestsAnsweredQuestions",
|
2115
|
+
/**
|
2116
|
+
* GuestsAnsweredQuestions -> ResolvedQuestion
|
2117
|
+
*/
|
2118
|
+
RESOLVED_QUESTION = "ResolvedQuestion",
|
2119
|
+
/**
|
2120
|
+
* ResolvedQuestion -> ShowResults
|
2121
|
+
*/
|
2122
|
+
LEADERBOARD = "Leaderboard",
|
2123
|
+
/**
|
2124
|
+
* Reset Game can be called only from Idle state
|
2125
|
+
*/
|
2126
|
+
RESET_GAME = "ResetGame"
|
2127
|
+
}
|
2128
|
+
|
2129
|
+
export declare interface InteractiveWidgetTheme {
|
2130
|
+
palette: Record<string, string>;
|
2131
|
+
components: {
|
2132
|
+
[key in InteractiveWidgetThemeKey]?: Record<string, string>;
|
2133
|
+
};
|
2134
|
+
}
|
2135
|
+
|
2136
|
+
declare type InteractiveWidgetThemeKey = InteractiveWidgetDisplayComponent | `${InteractiveWidgetDisplayComponent.CURRENT_QUESTION}${AnswerStatus}` | 'timeLeftBar';
|
2137
|
+
|
1996
2138
|
/**
|
1997
2139
|
* @public
|
1998
2140
|
*/
|
@@ -2070,7 +2212,7 @@ export declare function isVodTivioSource(source?: CommonSource | null): source i
|
|
2070
2212
|
/**
|
2071
2213
|
* @public
|
2072
2214
|
*/
|
2073
|
-
export declare type ItemComponent = RowItemComponent | BannerItemComponent;
|
2215
|
+
export declare type ItemComponent = RowItemComponent | BannerItemComponent | SurveyItemComponent;
|
2074
2216
|
|
2075
2217
|
/**
|
2076
2218
|
* @public
|
@@ -2135,6 +2277,31 @@ export declare interface LastMessage {
|
|
2135
2277
|
createdAt: Date;
|
2136
2278
|
}
|
2137
2279
|
|
2280
|
+
export declare interface LeaderboardGroupItem {
|
2281
|
+
groupPath?: string;
|
2282
|
+
groupName?: string;
|
2283
|
+
type: QuizGameGroupType;
|
2284
|
+
/**
|
2285
|
+
* Consists of top 3 players of the group (global or private team)
|
2286
|
+
* the player's rank in the group
|
2287
|
+
* and adjacent players in the group leaderboard
|
2288
|
+
*/
|
2289
|
+
players: LeaderboardPlayer[];
|
2290
|
+
}
|
2291
|
+
|
2292
|
+
export declare interface LeaderboardPlayer {
|
2293
|
+
id: string;
|
2294
|
+
rank: number;
|
2295
|
+
name?: string;
|
2296
|
+
score: number;
|
2297
|
+
/**
|
2298
|
+
* We use this date to distinguish between players with the same name
|
2299
|
+
*/
|
2300
|
+
userCreatedDate: Date;
|
2301
|
+
}
|
2302
|
+
|
2303
|
+
export declare type LeaderboardScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.LEADERBOARD>;
|
2304
|
+
|
2138
2305
|
/**
|
2139
2306
|
* @public
|
2140
2307
|
*/
|
@@ -2559,6 +2726,8 @@ export declare type NewVoucher = {
|
|
2559
2726
|
|
2560
2727
|
declare type NextPageParamType = 'screenId' | 'rowId' | 'filter';
|
2561
2728
|
|
2729
|
+
export declare type NoGraphicsScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.NO_GRAPHICS>;
|
2730
|
+
|
2562
2731
|
/**
|
2563
2732
|
* @public
|
2564
2733
|
*/
|
@@ -2779,6 +2948,11 @@ export declare interface OrganizationSettingsField extends OrganizationResponsiv
|
|
2779
2948
|
cancelledSubscriptionDiscount?: {
|
2780
2949
|
enabled: boolean;
|
2781
2950
|
};
|
2951
|
+
modalDetail?: {
|
2952
|
+
tagModal?: {
|
2953
|
+
hideTitle?: boolean;
|
2954
|
+
};
|
2955
|
+
};
|
2782
2956
|
}
|
2783
2957
|
|
2784
2958
|
/**
|
@@ -3132,6 +3306,18 @@ export declare interface PlayerError {
|
|
3132
3306
|
message: string;
|
3133
3307
|
}
|
3134
3308
|
|
3309
|
+
/**
|
3310
|
+
* @public
|
3311
|
+
*/
|
3312
|
+
export declare type PlayerEvent = {
|
3313
|
+
name: PlayerEventName;
|
3314
|
+
};
|
3315
|
+
|
3316
|
+
/**
|
3317
|
+
* @public
|
3318
|
+
*/
|
3319
|
+
export declare type PlayerEventName = `${PlayerWrapperEvents}`;
|
3320
|
+
|
3135
3321
|
/**
|
3136
3322
|
* @public
|
3137
3323
|
*/
|
@@ -3274,6 +3460,8 @@ export declare interface PlayerSourceParams<T extends NonAdSourceType = NonAdSou
|
|
3274
3460
|
sourcePlayMode: SourcePlayMode;
|
3275
3461
|
}
|
3276
3462
|
|
3463
|
+
export declare type PlayersScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.PLAYERS>;
|
3464
|
+
|
3277
3465
|
/**
|
3278
3466
|
* @public
|
3279
3467
|
*/
|
@@ -3315,11 +3503,19 @@ export declare interface PlayerWrapper {
|
|
3315
3503
|
* Pause video
|
3316
3504
|
*/
|
3317
3505
|
pause: () => void;
|
3506
|
+
ad: AdSourceInterface | null;
|
3507
|
+
adMetadata: AdMetadata | null;
|
3508
|
+
adSegment: AdSegment | null;
|
3509
|
+
availableLanguages: LangCode[] | null;
|
3510
|
+
canReplay: boolean;
|
3511
|
+
currentTime: number;
|
3318
3512
|
/**
|
3319
3513
|
* Currently playing source
|
3320
3514
|
*/
|
3321
3515
|
source: PlayerSource | null;
|
3516
|
+
seekInterceptor: SeekInterceptor;
|
3322
3517
|
events: EmitterInterface;
|
3518
|
+
event: PlayerEvent | null;
|
3323
3519
|
/**
|
3324
3520
|
* Register a low level player that implements player methods, like play video, change volume, etc.
|
3325
3521
|
*/
|
@@ -3327,12 +3523,29 @@ export declare interface PlayerWrapper {
|
|
3327
3523
|
/**
|
3328
3524
|
* duration of current source in ms (both setter and getter)
|
3329
3525
|
*/
|
3330
|
-
durationMs: number
|
3526
|
+
durationMs: number;
|
3527
|
+
intro: {
|
3528
|
+
marker: any;
|
3529
|
+
skip: () => void;
|
3530
|
+
} | null;
|
3531
|
+
isBuffering: boolean;
|
3532
|
+
isCurrentTimeLive: boolean;
|
3533
|
+
isLiveSeekingEnabled: boolean;
|
3534
|
+
isMuted: boolean;
|
3331
3535
|
isPlaybackStarted?: boolean;
|
3332
3536
|
isPaused: boolean;
|
3333
3537
|
isPlaying: boolean;
|
3334
3538
|
isIdle: boolean;
|
3539
|
+
language: LangCode | null;
|
3540
|
+
nextRecommendedVideo: Video | null;
|
3541
|
+
prerollCheck: PrerollCheck;
|
3542
|
+
previousSource: PlayerSource | null;
|
3543
|
+
progress: number | null;
|
3544
|
+
progressMetadata: ProgressMetadata;
|
3545
|
+
requestedSource: PlayerSource | null;
|
3335
3546
|
error: PlayerError | null;
|
3547
|
+
state: PlayerState;
|
3548
|
+
volume: number;
|
3336
3549
|
/**
|
3337
3550
|
* Replay the video that finished playback
|
3338
3551
|
*/
|
@@ -3347,6 +3560,7 @@ export declare interface PlayerWrapper {
|
|
3347
3560
|
* set volume to value between 0,1
|
3348
3561
|
*/
|
3349
3562
|
setVolume: (volume: number) => void;
|
3563
|
+
changeLanguage: (langCode: LangCode) => Promise<void>;
|
3350
3564
|
/**
|
3351
3565
|
* change volume by value between -1,1
|
3352
3566
|
*/
|
@@ -3354,6 +3568,48 @@ export declare interface PlayerWrapper {
|
|
3354
3568
|
setMuted: (muted: boolean) => void;
|
3355
3569
|
toggleMuted: () => void;
|
3356
3570
|
getQualities: () => Track[];
|
3571
|
+
playNativeImaAd: (url: string) => void;
|
3572
|
+
playSourceAfterAdsRun: () => void;
|
3573
|
+
putAd: (ad: AdSourceInterface) => void;
|
3574
|
+
putAdMetadata: (ad: AdSourceInterface) => void;
|
3575
|
+
reportLoadError: (error: Error) => void;
|
3576
|
+
reportStateChanged: (state: PlayerState) => void;
|
3577
|
+
reportTimeProgress: (ms: number) => void;
|
3578
|
+
reportPlaybackCancelled: () => void;
|
3579
|
+
reportPlaybackError: (error: Error) => void;
|
3580
|
+
reportPlaybackEnded: () => void;
|
3581
|
+
seekToPercent: (percentage: number) => void;
|
3582
|
+
seekToInternal: (ms: number) => void;
|
3583
|
+
seekToLive: () => void;
|
3584
|
+
seekToLiveInternal: () => void;
|
3585
|
+
setIsBuffering: (isBuffering: boolean) => void;
|
3586
|
+
skipAd: () => void;
|
3587
|
+
skipAllAds: () => void;
|
3588
|
+
}
|
3589
|
+
|
3590
|
+
/**
|
3591
|
+
* @public
|
3592
|
+
*/
|
3593
|
+
export declare enum PlayerWrapperEvents {
|
3594
|
+
'playback_cancelled' = "playback_cancelled",
|
3595
|
+
/**
|
3596
|
+
* Triggered when content video or ad finished playing until the end
|
3597
|
+
*/
|
3598
|
+
'playback_ended' = "playback_ended",
|
3599
|
+
/**
|
3600
|
+
* Triggered when both content video and all its associated ads finished playing until the end.
|
3601
|
+
* Or in case of postroll, when content video finished playing unit the end and all postroll
|
3602
|
+
* ads either finished / failed or were skipped.
|
3603
|
+
*/
|
3604
|
+
'video_unit_ended' = "video_unit_ended",
|
3605
|
+
/**
|
3606
|
+
* Pause was triggered
|
3607
|
+
*/
|
3608
|
+
'pause_triggered' = "pause_triggered",
|
3609
|
+
/**
|
3610
|
+
* Un-pause was triggered
|
3611
|
+
*/
|
3612
|
+
'unpause_triggered' = "unpause_triggered"
|
3357
3613
|
}
|
3358
3614
|
|
3359
3615
|
/**
|
@@ -3369,6 +3625,18 @@ export declare enum PlayerWrapperEventType {
|
|
3369
3625
|
*/
|
3370
3626
|
export declare type PlayerWrapperEventTypeType = `${PlayerWrapperEventType}`;
|
3371
3627
|
|
3628
|
+
/**
|
3629
|
+
* @public
|
3630
|
+
*/
|
3631
|
+
/**
|
3632
|
+
* A promise that ads will be loaded. Resolves to the first ad source,
|
3633
|
+
* other ads are linked to it via `ad.next` attribute.
|
3634
|
+
*
|
3635
|
+
* In case preroll is not configured or no ad
|
3636
|
+
* manages to load successfully, resolves to null.
|
3637
|
+
*/
|
3638
|
+
export declare type PrerollCheck = (source: PlayerSource) => Promise<AdSourceInterface | null>;
|
3639
|
+
|
3372
3640
|
/**
|
3373
3641
|
* Values that user entered in survey for given profile.
|
3374
3642
|
*/
|
@@ -3377,6 +3645,18 @@ export declare type ProfileSurvey = {
|
|
3377
3645
|
age?: AgeRange;
|
3378
3646
|
};
|
3379
3647
|
|
3648
|
+
/**
|
3649
|
+
* @public
|
3650
|
+
*/
|
3651
|
+
export declare interface ProgressMetadata {
|
3652
|
+
currentTimeMs: number;
|
3653
|
+
durationMs: number;
|
3654
|
+
percent: number;
|
3655
|
+
remainingMs: number;
|
3656
|
+
type: 'original' | 'cutout';
|
3657
|
+
cutout?: Cutout;
|
3658
|
+
}
|
3659
|
+
|
3380
3660
|
/**
|
3381
3661
|
* @public
|
3382
3662
|
*/
|
@@ -3726,7 +4006,12 @@ export declare enum PurchaseStatus {
|
|
3726
4006
|
/**
|
3727
4007
|
* From PAID to EXPIRED when payment fails to renew subscription.
|
3728
4008
|
*/
|
3729
|
-
EXPIRED = "EXPIRED"
|
4009
|
+
EXPIRED = "EXPIRED",
|
4010
|
+
/**
|
4011
|
+
* From PAID to EXPIRING when a Stargaze purchase has passed its expire date but hasn't been fully expired yet.
|
4012
|
+
* Stargaze will try to renew the purchase even after it has expired.
|
4013
|
+
*/
|
4014
|
+
EXPIRING = "EXPIRING"
|
3730
4015
|
}
|
3731
4016
|
|
3732
4017
|
/**
|
@@ -3857,6 +4142,58 @@ export declare interface QerkoTransaction {
|
|
3857
4142
|
voucherId?: string;
|
3858
4143
|
}
|
3859
4144
|
|
4145
|
+
export declare type QRCodeScene = InteractiveWidgetSceneBase<InteractiveWidgetSceneTemplateType.QR_CODE>;
|
4146
|
+
|
4147
|
+
export declare interface QuestionAnswer {
|
4148
|
+
id: string;
|
4149
|
+
answer: Translation;
|
4150
|
+
isCorrect?: boolean;
|
4151
|
+
votes?: number;
|
4152
|
+
status?: AnswerStatus;
|
4153
|
+
}
|
4154
|
+
|
4155
|
+
export declare enum QuestionEvents {
|
4156
|
+
NEW_QUESTION = "new_question",
|
4157
|
+
ANSWER_SELECTED = "answer_selected",
|
4158
|
+
COUNTDOWN_START = "countdown_start",
|
4159
|
+
COUNTDOWN_END = "countdown_end",
|
4160
|
+
QUESTION_TIMEOUT = "question_timeout"
|
4161
|
+
}
|
4162
|
+
|
4163
|
+
export declare interface QuestionRepository {
|
4164
|
+
on<K extends keyof QuestionRepositoryEventMap>(event: K, listener: QuestionRepositoryEventMap[K]): void;
|
4165
|
+
off<K extends keyof QuestionRepositoryEventMap>(event: K, listener: QuestionRepositoryEventMap[K]): void;
|
4166
|
+
readonly showCountdown: boolean;
|
4167
|
+
readonly currentQuestion: CurrentQuestion | null;
|
4168
|
+
readonly selectedAnswerId: string | undefined;
|
4169
|
+
isSubmitted: boolean;
|
4170
|
+
isSubmitting: boolean;
|
4171
|
+
setCurrentQuestion: (question: CurrentQuestion | null, role: QuizGameRole, secondsToAnswer: number, shouldEnterAtTimestampMs?: number) => void;
|
4172
|
+
selectAnswer: (answerId: string | undefined) => void;
|
4173
|
+
setShowCountdown: (showCountdown: boolean) => void;
|
4174
|
+
reset: () => void;
|
4175
|
+
}
|
4176
|
+
|
4177
|
+
export declare type QuestionRepositoryEventMap = {
|
4178
|
+
[QuestionEvents.NEW_QUESTION]: (question: CurrentQuestion | null) => void;
|
4179
|
+
[QuestionEvents.ANSWER_SELECTED]: (answerId: string | undefined) => void;
|
4180
|
+
[QuestionEvents.COUNTDOWN_START]: () => void;
|
4181
|
+
[QuestionEvents.COUNTDOWN_END]: () => void;
|
4182
|
+
[QuestionEvents.QUESTION_TIMEOUT]: (question: CurrentQuestion | null) => void;
|
4183
|
+
};
|
4184
|
+
|
4185
|
+
export declare interface QuizGameGroupStats {
|
4186
|
+
answerPercentages: Record<string, number>;
|
4187
|
+
averageScore: number;
|
4188
|
+
correctAnswersRatio: number;
|
4189
|
+
}
|
4190
|
+
|
4191
|
+
export declare enum QuizGameGroupType {
|
4192
|
+
HIGHLIGHTED_PLAYERS = "HIGHLIGHTED_PLAYERS",
|
4193
|
+
ALL = "ALL",
|
4194
|
+
PARTY = "PARTY"
|
4195
|
+
}
|
4196
|
+
|
3860
4197
|
export declare enum QuizGameRole {
|
3861
4198
|
OBS = "OBS",
|
3862
4199
|
HOST = "HOST",
|
@@ -3948,10 +4285,11 @@ declare type Relationship = {
|
|
3948
4285
|
* @public
|
3949
4286
|
*/
|
3950
4287
|
export declare type RemoteBundleState = {
|
3951
|
-
config: InternalConfig;
|
3952
|
-
error: string | null;
|
3953
4288
|
state: 'loading' | 'error' | 'ready';
|
3954
|
-
|
4289
|
+
error: string | null;
|
4290
|
+
config: InternalConfig;
|
4291
|
+
settings: Settings;
|
4292
|
+
} & Omit<Partial<TivioJsBundleExposedApi>, 'createPlayerWrapper'> & Nullable<TivioBundle>;
|
3955
4293
|
|
3956
4294
|
/**
|
3957
4295
|
* @public
|
@@ -3985,6 +4323,8 @@ export declare interface RenderConditionValue {
|
|
3985
4323
|
subscriptionRefs?: any[];
|
3986
4324
|
}
|
3987
4325
|
|
4326
|
+
export declare const renderWebPlayer: (container: HTMLElement, props: WebPlayerProps) => void;
|
4327
|
+
|
3988
4328
|
/**
|
3989
4329
|
* Make all attributes in given type required, non-nullable and defined.
|
3990
4330
|
* e.g. will make `{ attribute?: string | null }` to be `{ attribute: string }`
|
@@ -4319,6 +4659,26 @@ export declare type ScalableAsset = {
|
|
4319
4659
|
*/
|
4320
4660
|
export declare type Scale = '@1' | '@2' | '@3';
|
4321
4661
|
|
4662
|
+
declare type SceneMetadata<TType extends InteractiveWidgetSceneTemplateType> = TType extends InteractiveWidgetSceneTemplateType.CURRENT_QUESTION ? {
|
4663
|
+
highlightedUsersAnswers: Array<{
|
4664
|
+
answerId: string;
|
4665
|
+
userId: string;
|
4666
|
+
}>;
|
4667
|
+
} : TType extends InteractiveWidgetSceneTemplateType.LEADERBOARD ? {
|
4668
|
+
highlightedPlayers: LeaderboardPlayer[];
|
4669
|
+
topPlayers: LeaderboardPlayer[];
|
4670
|
+
stats?: QuizGameGroupStats;
|
4671
|
+
} : 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;
|
4672
|
+
|
4673
|
+
export declare interface SceneMetadataKeys {
|
4674
|
+
[InteractiveWidgetSceneTemplateType.CURRENT_QUESTION]: 'highlightedUsersAnswers';
|
4675
|
+
[InteractiveWidgetSceneTemplateType.LEADERBOARD]: 'highlightedPlayers';
|
4676
|
+
[InteractiveWidgetSceneTemplateType.QR_CODE]: 'qrCodeUrl' | 'title' | 'subtitle';
|
4677
|
+
[InteractiveWidgetSceneTemplateType.AD_BANNER]: 'bannerImage';
|
4678
|
+
[InteractiveWidgetSceneTemplateType.PLAYERS]: 'centerHtml' | 'player1Name' | 'player2Name' | 'player1Image' | 'player2Image' | 'player1Id' | 'player2Id';
|
4679
|
+
[InteractiveWidgetSceneTemplateType.NO_GRAPHICS]: never;
|
4680
|
+
}
|
4681
|
+
|
4322
4682
|
export declare interface ScheduleNotificationRequest {
|
4323
4683
|
notificationPath: string;
|
4324
4684
|
}
|
@@ -4456,6 +4816,26 @@ export declare interface SeekingMatrixTemplate {
|
|
4456
4816
|
interval: number;
|
4457
4817
|
}
|
4458
4818
|
|
4819
|
+
export declare interface SeekInterceptionResult {
|
4820
|
+
position: number | null;
|
4821
|
+
didChangePosition: boolean;
|
4822
|
+
priority: number;
|
4823
|
+
}
|
4824
|
+
|
4825
|
+
/**
|
4826
|
+
* @public
|
4827
|
+
*/
|
4828
|
+
export declare interface SeekInterceptor {
|
4829
|
+
addInterceptor(interceptor: SeekInterceptorFunction, callback?: SeekInterceptorCallback): void;
|
4830
|
+
applyInterceptors(currentPosition: number, seekPosition: number): SeekInterceptionResult;
|
4831
|
+
callCallbacksAfterInterception(): void;
|
4832
|
+
removeInterceptor(interceptor: SeekInterceptorFunction): void;
|
4833
|
+
}
|
4834
|
+
|
4835
|
+
export declare type SeekInterceptorCallback = (requestedSeekPosition: number) => void;
|
4836
|
+
|
4837
|
+
export declare type SeekInterceptorFunction = (currentPosition: number, seekPosition: number) => SeekInterceptionResult;
|
4838
|
+
|
4459
4839
|
export declare enum SemanticDate {
|
4460
4840
|
YESTERDAY = "Yesterday",
|
4461
4841
|
TODAY = "Today",
|
@@ -4525,6 +4905,13 @@ export declare interface SetCustomClaimsRequest {
|
|
4525
4905
|
organizationId: string;
|
4526
4906
|
}
|
4527
4907
|
|
4908
|
+
export declare const setSdkReactConfig: (tivioConfig: SdkReactConfig) => void;
|
4909
|
+
|
4910
|
+
declare type Settings = {
|
4911
|
+
onSetUser: (handler: (userId: string, userPayload: UserPayload) => void) => void;
|
4912
|
+
setUser: (userId: string, userPayload: UserPayload) => void;
|
4913
|
+
};
|
4914
|
+
|
4528
4915
|
/**
|
4529
4916
|
* Used for entities, that can be global (e.g. asset presets, tag types).
|
4530
4917
|
* Non-global is stored under organizations (in sub-collection), and shown for organization's users and super-admin.
|
@@ -4669,6 +5056,15 @@ export declare interface StoreBadgeConfig {
|
|
4669
5056
|
appId: string;
|
4670
5057
|
}
|
4671
5058
|
|
5059
|
+
export declare interface SubmitAnswerRequest {
|
5060
|
+
answerOptionId?: string;
|
5061
|
+
answerText?: string;
|
5062
|
+
clientTimestamp: number;
|
5063
|
+
questionEndTimestamp?: number;
|
5064
|
+
widgetPath: string;
|
5065
|
+
questionId: string;
|
5066
|
+
}
|
5067
|
+
|
4672
5068
|
export declare interface SubmitAnswerResponse {
|
4673
5069
|
id: string;
|
4674
5070
|
receivedTimestamp: number;
|
@@ -4735,6 +5131,10 @@ export declare interface SuccessConfirmationOverlayPayload extends ConfirmationO
|
|
4735
5131
|
confirmButtonText?: string;
|
4736
5132
|
}
|
4737
5133
|
|
5134
|
+
export declare enum SurveyItemComponent {
|
5135
|
+
SURVEY = "SURVEY"
|
5136
|
+
}
|
5137
|
+
|
4738
5138
|
export declare type SynchronizeUserTypeFunction = (payload: CreateUserPayload, tenantId: string, tenantUserId: string, organizationId?: string) => Promise<string>;
|
4739
5139
|
|
4740
5140
|
/**
|
@@ -5197,13 +5597,25 @@ export declare type TivioGetters = {
|
|
5197
5597
|
getPlayerWrapper: (opt: {
|
5198
5598
|
playerWrapperId?: string;
|
5199
5599
|
}) => PlayerWrapper;
|
5200
|
-
|
5600
|
+
organization: {
|
5601
|
+
/**
|
5602
|
+
* Get organization subscriptions
|
5603
|
+
* @returns {Promise<Monetization[] | undefined>} organization subscriptions or undefined if organization does not exists
|
5604
|
+
*/
|
5605
|
+
getSubscriptions: () => Promise<Monetization[] | undefined>;
|
5606
|
+
} | null;
|
5201
5607
|
/**
|
5202
5608
|
* Get video by its id.
|
5203
5609
|
* @param videoId - video id
|
5204
5610
|
* @returns {Promise<Video | null>} video or null if video does not exists
|
5205
5611
|
*/
|
5206
5612
|
getVideoById: (videoId: string) => Promise<Video | null>;
|
5613
|
+
/**
|
5614
|
+
* Get screen by its id.
|
5615
|
+
* @param screenId - screen id
|
5616
|
+
* @returns {Promise<Screen | null>} screen or null if screen does not exists
|
5617
|
+
*/
|
5618
|
+
getScreenById: (screenId: string, cb?: (error: Error | null, data: Screen_2 | null, disposer?: Disposer_2) => void) => Promise<Screen_2 | null>;
|
5207
5619
|
/**
|
5208
5620
|
* Get player capabilities based on user's browser and OS as resolved by Tivio.
|
5209
5621
|
* @returns PlayerCapability[]
|
@@ -5397,7 +5809,7 @@ export declare type TivioJsBundleExposedApi = {
|
|
5397
5809
|
* @param id - player wrapper id
|
5398
5810
|
* @returns {Player} player wrapper instance
|
5399
5811
|
*/
|
5400
|
-
getPlayerWrapper: (id: string) =>
|
5812
|
+
getPlayerWrapper: (id: string) => PlayerWrapper;
|
5401
5813
|
/**
|
5402
5814
|
* Get tv channel by its id.
|
5403
5815
|
* @param tvChannelId - tv channel id
|
@@ -5412,7 +5824,7 @@ export declare type TivioJsBundleExposedApi = {
|
|
5412
5824
|
getTagById: (tagId: string) => Promise<Tag | null>;
|
5413
5825
|
createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
|
5414
5826
|
destroy: () => Promise<void>;
|
5415
|
-
} & Pick<TivioGetters, 'getVideoById'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
|
5827
|
+
} & Pick<TivioGetters, 'getVideoById' | 'getScreenById' | 'organization'> & Pick<TivioSubscriptions, 'subscribeToVideo' | 'subscribeToItemsInRow' | 'subscribeToRowsInScreen'> & Pick<TivioAuth, 'createUserWithEmailAndPassword' | 'signInWithEmailAndPassword'> & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
|
5416
5828
|
|
5417
5829
|
/**
|
5418
5830
|
* @public
|
@@ -5438,13 +5850,12 @@ export declare const TivioProvider: React_2.FC<TivioProviderProps>;
|
|
5438
5850
|
/**
|
5439
5851
|
* @public
|
5440
5852
|
*/
|
5441
|
-
export declare
|
5853
|
+
export declare interface TivioProviderProps extends React_2.PropsWithChildren {
|
5442
5854
|
/**
|
5443
5855
|
* This prop must be set only once and not change value afterwards
|
5444
5856
|
*/
|
5445
5857
|
conf: SdkReactConfig | undefined | null;
|
5446
|
-
|
5447
|
-
};
|
5858
|
+
}
|
5448
5859
|
|
5449
5860
|
/**
|
5450
5861
|
* @public
|
@@ -5473,7 +5884,7 @@ export declare type TivioReactBundle = {
|
|
5473
5884
|
internal: TivioInternalBundle;
|
5474
5885
|
analytics: TivioAnalytics;
|
5475
5886
|
destroy: () => Promise<void>;
|
5476
|
-
} & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'>;
|
5887
|
+
} & Pick<TivioSetters, 'setBundleVersion' | 'setUser' | 'setLanguage' | 'setStorageManager'> & Omit<Partial<TivioJsBundleExposedApi>, 'createPlayerWrapper'>;
|
5477
5888
|
|
5478
5889
|
/**
|
5479
5890
|
* @public
|
@@ -6098,11 +6509,6 @@ export declare interface UseReactionsOptions {
|
|
6098
6509
|
onError?: (error: Error) => void;
|
6099
6510
|
}
|
6100
6511
|
|
6101
|
-
/**
|
6102
|
-
* @public
|
6103
|
-
*/
|
6104
|
-
export declare const useRemoteBundle: (conf: InternalConfig, checkBundleCharCount?: boolean) => RemoteBundleState;
|
6105
|
-
|
6106
6512
|
export declare enum UserGroup {
|
6107
6513
|
ALL = "all",
|
6108
6514
|
FREE = "free",
|
@@ -6446,6 +6852,7 @@ export declare interface Video extends RowItem, MonetizableItem, ReactableConten
|
|
6446
6852
|
pgRating?: string;
|
6447
6853
|
contentDescriptors?: string[];
|
6448
6854
|
publishedStatus?: PublishedStatus;
|
6855
|
+
widgetPaths?: string[];
|
6449
6856
|
}
|
6450
6857
|
|
6451
6858
|
/**
|
@@ -6508,7 +6915,7 @@ export declare enum VideoSourceEncryption {
|
|
6508
6915
|
PLAYREADY = "playready"
|
6509
6916
|
}
|
6510
6917
|
|
6511
|
-
export declare
|
6918
|
+
export declare type VideoSourceField = {
|
6512
6919
|
codec: VideoSourceCodec;
|
6513
6920
|
/**
|
6514
6921
|
* DRM provider for given encrypted source.
|
@@ -6524,24 +6931,40 @@ export declare interface VideoSourceField {
|
|
6524
6931
|
priority: VideoSourcePriority;
|
6525
6932
|
protocol: VideoSourceProtocol;
|
6526
6933
|
provider?: VideoSourceProvider;
|
6527
|
-
url: string;
|
6528
6934
|
languages?: LangCode[];
|
6529
|
-
/**
|
6530
|
-
* URL for source modification for user (e.g. add PIP window to livestream).
|
6531
|
-
*/
|
6532
|
-
managementUrl?: string;
|
6533
6935
|
/**
|
6534
6936
|
* Seeking matrix override for given source.
|
6535
6937
|
*/
|
6536
6938
|
seekingMatrix?: Partial<SeekingMatrixTemplate>;
|
6537
6939
|
/**
|
6538
|
-
*
|
6940
|
+
* Determines session type generated for source. If no provided it will be considered 'ondemand' session type.
|
6941
|
+
*/
|
6942
|
+
sessionType?: 'channel' | 'interactive' | 'live' | 'ondemand';
|
6943
|
+
/**
|
6944
|
+
* Content id override to include in authentication for api-streaming worker.
|
6539
6945
|
* Used when you have several sources from different contents (videos).
|
6540
|
-
* Without it {@link getSourceUrl} will use document's id, and
|
6541
|
-
* because content id in source url and
|
6946
|
+
* Without it {@link getSourceUrl} will use document's id, and authentication might fail
|
6947
|
+
* because content id in source url and authentication will not match.
|
6542
6948
|
*/
|
6543
6949
|
contentId?: string;
|
6544
|
-
}
|
6950
|
+
} & ({
|
6951
|
+
url: string;
|
6952
|
+
provider?: Exclude<VideoSourceProvider, VideoSourceProvider.CLOUDFLARE>;
|
6953
|
+
} | {
|
6954
|
+
url: string;
|
6955
|
+
/**
|
6956
|
+
* If both contentId and profileId provided, we don't need url, we have enough information to generate cloudflare source.
|
6957
|
+
*/
|
6958
|
+
provider: VideoSourceProvider.CLOUDFLARE;
|
6959
|
+
profileId: string;
|
6960
|
+
/**
|
6961
|
+
* Options to send to session source generation api. See {@link GenerateSessionSourceRequest} in @tivio/api.
|
6962
|
+
* TODO type duplication, but have no way to import ^ here.
|
6963
|
+
*/
|
6964
|
+
options?: {
|
6965
|
+
delaySegmentCount?: number;
|
6966
|
+
};
|
6967
|
+
});
|
6545
6968
|
|
6546
6969
|
/**
|
6547
6970
|
* Lower number = higher priority.
|
@@ -7085,6 +7508,7 @@ export declare interface WebPlayerProps {
|
|
7085
7508
|
disablePlayNext?: boolean;
|
7086
7509
|
setPaymentOverlayVisible?: React_2.Dispatch<React_2.SetStateAction<boolean>>;
|
7087
7510
|
hideOverlay?: boolean;
|
7511
|
+
sourcePlayMode?: SourcePlayMode;
|
7088
7512
|
}
|
7089
7513
|
|
7090
7514
|
/**
|