@vkontakte/videoplayer 1.1.95-dev.f2fd80887.0 → 1.1.96-beta.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.
Files changed (58) hide show
  1. package/es2015.cjs +12 -12
  2. package/es2015.esm.js +12 -12
  3. package/esnext.cjs +11 -11
  4. package/esnext.esm.js +11 -11
  5. package/evergreen.esm.js +11 -11
  6. package/package.json +5 -5
  7. package/types/VKVideoPlayer/index.svelte.d.ts +8 -1
  8. package/types/components/Ads/admanWrapper.d.ts +2 -0
  9. package/types/components/Ads/types.d.ts +1 -0
  10. package/types/components/Controls/contants/desktopButtonsLeftWeights.d.ts +1 -1
  11. package/types/components/Controls/contants/desktopButtonsRightIds.d.ts +2 -1
  12. package/types/components/Controls/contants/desktopButtonsRightWeights.d.ts +1 -1
  13. package/types/components/Menus/constants/contextMenuItemWeights.d.ts +1 -1
  14. package/types/components/Menus/constants/settingsMenuItemWeights.d.ts +1 -1
  15. package/types/components/Menus/subMenuTabs/types.d.ts +7 -0
  16. package/types/components/Menus/utils/getSubMenusStack.svelte.d.ts +1 -0
  17. package/types/components/Qoe/constants.d.ts +9 -0
  18. package/types/components/Qoe/utils.d.ts +1 -0
  19. package/types/config.d.ts +6 -0
  20. package/types/index.d.ts +3 -3
  21. package/types/store/composition.d.ts +14 -4
  22. package/types/store/connectors/statisticsConnector.d.ts +15 -0
  23. package/types/store/index.d.ts +1 -1
  24. package/types/store/modules/highlightedMenuItemsStore/highlightedMenuItems.module.d.ts +3 -0
  25. package/types/store/modules/highlightedMenuItemsStore/highlightedMenuItems.store.d.ts +21 -0
  26. package/types/store/modules/highlightedMenuItemsStore/highlightedMenuItems.token.d.ts +5 -0
  27. package/types/store/modules/highlightedMenuItemsStore/index.d.ts +3 -0
  28. package/types/store/modules/index.d.ts +12 -1
  29. package/types/store/modules/infrastructure/index.d.ts +1 -1
  30. package/types/store/modules/infrastructure/infrastructure.module.d.ts +6 -1
  31. package/types/store/modules/infrastructure/infrastructure.token.d.ts +5 -1
  32. package/types/store/modules/languageStore/index.d.ts +9 -0
  33. package/types/store/modules/languageStore/languageStore.module.d.ts +3 -0
  34. package/types/store/modules/languageStore/languageStore.store.d.ts +51 -0
  35. package/types/store/modules/languageStore/languageStore.token.d.ts +6 -0
  36. package/types/store/modules/playbackRateStore/index.d.ts +6 -0
  37. package/types/store/modules/playbackRateStore/playbackRateStore.module.d.ts +8 -0
  38. package/types/store/modules/playbackRateStore/playbackRateStore.store.d.ts +61 -0
  39. package/types/store/modules/playbackRateStore/playbackRateStore.token.d.ts +6 -0
  40. package/types/store/modules/qoeStore/index.d.ts +3 -0
  41. package/types/store/modules/qoeStore/qoeStore.module.d.ts +3 -0
  42. package/types/store/modules/qoeStore/qoeStore.store.d.ts +4 -0
  43. package/types/store/modules/qoeStore/qoeStore.token.d.ts +3 -0
  44. package/types/store/modules/qoeStore/types.d.ts +24 -0
  45. package/types/store/modules/qualityStore/index.d.ts +6 -0
  46. package/types/store/modules/qualityStore/qualityStore.module.d.ts +8 -0
  47. package/types/store/modules/qualityStore/qualityStore.store.d.ts +37 -0
  48. package/types/store/modules/qualityStore/qualityStore.token.d.ts +6 -0
  49. package/types/store/modules/subtitlesStore/index.d.ts +9 -0
  50. package/types/store/modules/subtitlesStore/subtitlesStore.module.d.ts +8 -0
  51. package/types/store/modules/subtitlesStore/subtitlesStore.store.d.ts +130 -0
  52. package/types/store/modules/subtitlesStore/subtitlesStore.token.d.ts +6 -0
  53. package/types/store/modules/utils.d.ts +1 -1
  54. package/types/store/types.d.ts +17 -11
  55. package/types/translation/types.d.ts +1 -0
  56. package/types/types/index.d.ts +5 -4
  57. package/types/types/qoe.d.ts +65 -0
  58. package/types/utils/sanitizeSvg.d.ts +5 -0
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Quality Store Module
3
+ *
4
+ * Управляет состоянием качества видео: доступные качества, авто-качество.
5
+ */
6
+ import type { Readable } from "svelte/store";
7
+ import type { IPlayer } from "@vkontakte/videoplayer-core";
8
+ import type { Key } from "../../../translation/types";
9
+ import type { VideoQualityForRender } from "../../../types";
10
+ /**
11
+ * Зависимости модуля quality
12
+ */
13
+ export interface QualityStoreDeps {
14
+ /** Плеер */
15
+ player: IPlayer;
16
+ /** Функция перевода */
17
+ t: (key: Key, params?: Record<string, string>) => string;
18
+ }
19
+ /**
20
+ * Состояние модуля quality
21
+ */
22
+ export interface QualityStoreState {
23
+ /** Доступные качества для рендера */
24
+ availableQualities$: Readable<VideoQualityForRender[]>;
25
+ /** Признак доступности авто-качества */
26
+ isAutoQualityAvailable$: Readable<boolean>;
27
+ }
28
+ /**
29
+ * Результат создания quality store
30
+ */
31
+ export interface QualityStore {
32
+ state: QualityStoreState;
33
+ }
34
+ /**
35
+ * Создаёт quality store
36
+ */
37
+ export declare const createQualityStore: (deps: QualityStoreDeps) => QualityStore;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Quality Store Token
3
+ */
4
+ import { InjectionToken } from "@vkontakte/videoplayer-shared";
5
+ import type { QualityStore } from "./qualityStore.store";
6
+ export declare const QUALITY_STORE_TOKEN: InjectionToken<QualityStore>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Subtitles Store Module
3
+ *
4
+ * Экспорты модуля субтитров.
5
+ */
6
+ export type { SubtitlesStoreState, SubtitlesStoreInternalActions, SubtitlesStoreExternalActions, SubtitlesStore, Deps as SubtitlesStoreDeps } from "./subtitlesStore.store";
7
+ export { createSubtitlesStore } from "./subtitlesStore.store";
8
+ export { subtitlesModule } from "./subtitlesStore.module";
9
+ export { SUBTITLES_STORE_TOKEN } from "./subtitlesStore.token";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Subtitles Store Module
3
+ *
4
+ * Композиция модуля через Dependency Injection.
5
+ */
6
+ import { type SubtitlesStore } from "./subtitlesStore.store";
7
+ import type { Module } from "../utils";
8
+ export declare const subtitlesModule: Module<SubtitlesStore>;
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Subtitles Store Module
3
+ *
4
+ * Управляет состоянием субтитров: выбор, отображение, скачивание и парсинг.
5
+ */
6
+ import type { Readable, Writable } from "svelte/store";
7
+ import type { IPlayer, ITextTrack } from "@vkontakte/videoplayer-core";
8
+ import type { ISubscription, ITracer } from "@vkontakte/videoplayer-shared";
9
+ import type { AppTracer } from "@vkontakte/videoplayer-shared";
10
+ import { Subject } from "@vkontakte/videoplayer-shared";
11
+ import type { VideoSubtitle, VideoSubtitleParsed, AvailableVideoSubtitle } from "../../../types";
12
+ import type { IUIConfig } from "../../../config";
13
+ import type { TSignature } from "../../../translation/types";
14
+ /**
15
+ * Зависимости модуля subtitles
16
+ */
17
+ export interface Deps {
18
+ /** Плеер */
19
+ player: IPlayer;
20
+ /** UI конфиг */
21
+ uiConfig: IUIConfig;
22
+ /** Подписки */
23
+ subscription: ISubscription;
24
+ /** Функция перевода */
25
+ t: TSignature;
26
+ /** Стор языка интерфейса */
27
+ interfaceLanguage$: Readable<string>;
28
+ /** Стор точной позиции */
29
+ positionExact$: Readable<number>;
30
+ /** Стор скорости воспроизведения */
31
+ currentPlaybackRate$: Readable<number>;
32
+ /** Стор playing состояния */
33
+ isPlaying$: Readable<boolean>;
34
+ /** Стор minimal view */
35
+ isMinimalView$: Readable<boolean>;
36
+ /** Стор video id */
37
+ videoId$: Writable<number | undefined>;
38
+ /** Видео элемент */
39
+ getVideoElement: () => HTMLVideoElement | null;
40
+ /** Колбэки */
41
+ callbacks: {
42
+ onSubtitleOn?: (lang: string, id: string) => void;
43
+ onSubtitleOff?: () => void;
44
+ onAvailableSubtitlesChanged?: (subtitles: AvailableVideoSubtitle[]) => void;
45
+ };
46
+ /** Функция для получения сервиса статистики */
47
+ getStatisticsService?: () => {
48
+ oneStat?: {
49
+ logError: (params: {
50
+ errorType: string;
51
+ fatal: boolean;
52
+ }) => void;
53
+ };
54
+ } | undefined;
55
+ /** Функция для получения AppTracer для error reporting */
56
+ getAppTracer?: () => AppTracer | undefined;
57
+ /** Tracer для логирования */
58
+ tracer: ITracer;
59
+ }
60
+ /**
61
+ * Состояние модуля subtitles
62
+ */
63
+ export interface SubtitlesStoreState {
64
+ /** Текущие выбранные субтитры */
65
+ currentSubtitle$: Readable<Omit<VideoSubtitle, "selected">>;
66
+ /** Доступные текстовые треки */
67
+ availableTextTracks$: Readable<ITextTrack[]>;
68
+ /** Список доступных субтитров для UI */
69
+ availableSubtitlesList$: Readable<VideoSubtitle[]>;
70
+ /** Текущие субтитры для отображения */
71
+ currentSubtitleCaptions$: Readable<VideoSubtitleParsed["texts"]>;
72
+ /** Видимость авто-субтитров */
73
+ isAutoSubtitleCaptionVisible$: Writable<boolean>;
74
+ }
75
+ /**
76
+ * Экшены модуля subtitles для внутреннего использования
77
+ */
78
+ export interface SubtitlesStoreInternalActions {
79
+ /** Установить субтитры */
80
+ setSubtitle: (subtitle: VideoSubtitle | undefined, external: boolean) => void;
81
+ /** Переключить субтитры */
82
+ toggleSubtitle: (external: boolean) => void;
83
+ /** Включить субтитры */
84
+ subtitleOn: (external: boolean, id?: string) => void;
85
+ /** Выключить субтитры */
86
+ subtitleOff: (external: boolean) => void;
87
+ /** Установить форсированный язык субтитров */
88
+ setForcedSubtitlesLanguage: (language: string) => void;
89
+ /** Обновить доступные субтитры */
90
+ updateAvailableSubtitles: () => void;
91
+ }
92
+ /**
93
+ * Экшены модуля subtitles для внешнего использования
94
+ */
95
+ export interface SubtitlesStoreExternalActions {
96
+ /** Установить субтитры */
97
+ setSubtitle: (subtitle: VideoSubtitle | undefined) => void;
98
+ /** Переключить субтитры */
99
+ toggleSubtitle: () => void;
100
+ /**
101
+ * Изменить субтитры
102
+ */
103
+ changeSubtitle: (enabled: boolean, id?: string) => void;
104
+ }
105
+ /**
106
+ * Результат создания subtitles store
107
+ */
108
+ export interface SubtitlesStore {
109
+ /** Состояние */
110
+ state: SubtitlesStoreState;
111
+ /** Экшены для внутреннего использования */
112
+ actions: SubtitlesStoreInternalActions;
113
+ /** Экшены для внешнего использования */
114
+ externalActions: SubtitlesStoreExternalActions;
115
+ /** События для статистики */
116
+ events: {
117
+ actionSetSubtitle$: Subject<string>;
118
+ actionSubtitlesSwitched$: Subject<{
119
+ enabled: boolean;
120
+ lang: string;
121
+ auto: boolean;
122
+ }>;
123
+ };
124
+ /** Очистка ресурсов */
125
+ destroy(): void;
126
+ }
127
+ /**
128
+ * Создаёт subtitles store
129
+ */
130
+ export declare const createSubtitlesStore: (deps: Deps) => SubtitlesStore;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Subtitles Store Token
3
+ */
4
+ import { InjectionToken } from "@vkontakte/videoplayer-shared";
5
+ import type { SubtitlesStore } from "./subtitlesStore.store";
6
+ export declare const SUBTITLES_STORE_TOKEN: InjectionToken<SubtitlesStore>;
@@ -3,4 +3,4 @@ export type Module<T> = {
3
3
  token: InjectionToken<T>;
4
4
  factory: (container: IDIContainer) => T;
5
5
  };
6
- export declare const registerModules: <T extends any[]>(container: IDIContainer, modules: { [K in keyof T] : Module<T[K]> }) => void;
6
+ export declare const registerModules: <T extends any[]>(container: IDIContainer, modules: { [K in keyof T]: Module<T[K]> }) => void;
@@ -1,11 +1,11 @@
1
1
  import type { ChromecastState, IAudioStream, IConfig as ICoreInitVideoConfig, IExternalTextTrack, IOptionalTuningConfig, IPlayer, ISources, ITextTrack, IVideoStream, PlaybackRate, PlaybackState, VideoFormat } from "@vkontakte/videoplayer-core";
2
2
  import type { InteractiveRange } from "@vkontakte/videoplayer-interactive";
3
- import type { AppTracer, IError, ILogger, InterfaceLanguage, InternalsExposure, IRectangle, IValueObservable, QualityLimits, VideoQuality } from "@vkontakte/videoplayer-shared";
3
+ import type { AppTracer, IError, ILogger, InterfaceLanguage, InternalsExposure, IRectangle, ISubject, IValueObservable, IValueSubject, QualityLimits, VideoQuality } from "@vkontakte/videoplayer-shared";
4
4
  import type { SeekAction, ThinOneStat } from "@vkontakte/videoplayer-statistics";
5
5
  import type { Readable, Writable } from "svelte/store";
6
- import type { AdditionalButtonDeprecated, AdsPlaybackState, ControlBlocksRefs, ControlsKeys, HotKeyMapData, IAnnotationsApi, IControlInfo, IDisabledControls, IInteractiveData, IPictureInPictureApi, IPlayerControlsRef, IPlayerPhase, ITimelinePreviewThumbsData, IVideoEpisode, IVKVideoPlayerCallbacks, IVKVideoPlayerUICallbacks, PlaybackStateRealistic, Position, Size, VideoPlaybackRate, VideoPlayerView, VideoQualityForRender, VideoQualityUI, VideoSubtitle, VideoSubtitleParsed } from "../types";
6
+ import type { AdditionalButtonDeprecated, AdsPlaybackState, ControlBlocksRefs, ControlsKeys, HotKeyMapData, IAnnotationsApi, IControlInfo, IDisabledControls, IInteractiveData, IPictureInPictureApi, IPlayerControlsRef, IPlayerPhase, ITimelinePreviewThumbsData, IVideoEpisode, IVKVideoPlayerCallbacks, IVKVideoPlayerUICallbacks, Position, Size, VideoPlaybackRate, VideoPlayerView, VideoQualityForRender, VideoQualityUI, VideoSubtitle, VideoSubtitleParsed } from "../types";
7
7
  import type { AdmanWrapper } from "../components/Ads/admanWrapper";
8
- import type { Key, LanguageConfig } from "../translation/types";
8
+ import type { Key } from "../translation/types";
9
9
  import type { QualitySettingsAppliesTo } from "../utils/userSettings";
10
10
  import type { GridTypes, PlayPrevChapterDisabledTooltipKey } from "../constans";
11
11
  import type { AdditionalButton, AdditionalDesktopControlPanelButton } from "../components/Controls/types";
@@ -29,7 +29,7 @@ export interface IAdsStateValues {
29
29
  secondsToWatchBeforeSkip: number;
30
30
  postrollPassed: boolean;
31
31
  }
32
- export type IAdsState = { [K in keyof IAdsStateValues] : Writable<IAdsStateValues[K]> };
32
+ export type IAdsState = { [K in keyof IAdsStateValues]: Writable<IAdsStateValues[K]> };
33
33
  export interface IUIState {
34
34
  t: (key: Key, params?: Record<string, string>) => string;
35
35
  isMinimalView$: Writable<boolean>;
@@ -42,7 +42,7 @@ export interface IUIState {
42
42
  * Определяет, могут ли вообще контролы быть показаны.
43
43
  */
44
44
  isControlsAvailable: Writable<boolean>;
45
- controlBlocks: { [key in keyof Required<ControlBlocksRefs>] : Writable<IControlInfo | undefined> };
45
+ controlBlocks: { [key in keyof Required<ControlBlocksRefs>]: Writable<IControlInfo | undefined> };
46
46
  touched: Writable<boolean>;
47
47
  controls: {
48
48
  prevButton: Writable<IControlInfo | undefined>;
@@ -62,6 +62,7 @@ export interface IUIState {
62
62
  fullscreen: Writable<IControlInfo | undefined>;
63
63
  chromecast: Writable<IControlInfo | undefined>;
64
64
  pip: Writable<IControlInfo | undefined>;
65
+ qoe: Writable<IControlInfo | undefined>;
65
66
  "theater-mode-button": Writable<IControlInfo | undefined>;
66
67
  vkLogo: Writable<IControlInfo | undefined>;
67
68
  interactiveTimeIndicator: Writable<IControlInfo | undefined>;
@@ -153,7 +154,7 @@ export interface IPlayerState {
153
154
  positionWithScrubbing$: Readable<number>;
154
155
  duration$: Readable<number>;
155
156
  playbackState$: Readable<PlaybackState | undefined>;
156
- playbackStateRealistic$: Readable<PlaybackStateRealistic | undefined>;
157
+ isBuffering$: Readable<boolean>;
157
158
  isPlaying$: Readable<boolean>;
158
159
  isLoaderVisible: Readable<boolean>;
159
160
  bufferedProgress$: Readable<number>;
@@ -272,8 +273,7 @@ export interface IStoreInternalActions {
272
273
  holdCamera(): void;
273
274
  releaseCamera(): void;
274
275
  downloadVideo: () => void;
275
- addLanguage: (config: LanguageConfig) => void;
276
- setLanguage: (language: InterfaceLanguage | string) => void;
276
+ setLanguage: (language: InterfaceLanguage | string) => Promise<void>;
277
277
  nextMovie: (movieId: number) => void;
278
278
  correctSeekTimeToInteractive: (time: number) => number;
279
279
  replayInteractive?: () => void;
@@ -334,18 +334,25 @@ export interface IStoreInitVideoConfig extends ICoreInitVideoConfig {
334
334
  canDownload?: boolean;
335
335
  previewThumbsData?: ITimelinePreviewThumbsData;
336
336
  subtitles?: Omit<IExternalTextTrack, "type">[];
337
- subtitlesForcedLanguage?: string;
338
337
  unitedVideoId?: number;
339
338
  videoEpisodes?: IVideoEpisode[];
340
339
  }
340
+ export interface IStoreEvents {
341
+ actionRewind$: ISubject<void>;
342
+ actionSeek$: IValueSubject<SeekAction | ThinOneStat.ActionSeekType>;
343
+ actionQuality$: ISubject<ThinOneStat.ActionQualityType>;
344
+ nextMovie$: ISubject<number>;
345
+ }
341
346
  export interface IStore {
342
347
  initVideo: (config: IStoreInitVideoConfig) => void;
343
348
  videoId$: Writable<number | undefined>;
344
349
  playerPhase: IPlayerPhase;
345
350
  interfaceLanguage$: Readable<InterfaceLanguage | string>;
351
+ interfaceLanguageUpdated$: ISubject<void>;
346
352
  isCyrillicRelatedInterface$: Readable<boolean>;
347
353
  interactiveData?: IInteractiveData;
348
- vsid$: Readable<string | undefined>;
354
+ vsid$: Writable<string | undefined>;
355
+ events: IStoreEvents;
349
356
  state: IPlayerState;
350
357
  ui: IUIState;
351
358
  ads: IAdsState;
@@ -360,7 +367,6 @@ export interface IStore {
360
367
  initOnFinishedCallback: VoidFunction;
361
368
  resetAdsState: VoidFunction;
362
369
  updateAdmanWrapperSubscriptions: VoidFunction;
363
- updateStatisticsSubscriptions: VoidFunction;
364
370
  updateAppTracerSubscriptions: VoidFunction;
365
371
  updateTracerSubscriptions: VoidFunction;
366
372
  getLogger: () => ILogger;
@@ -6,3 +6,4 @@ export type LanguageConfig = {
6
6
  fallback: InterfaceLanguage;
7
7
  pack: LanguagePack;
8
8
  };
9
+ export type TSignature = (key: Key, params?: Record<string, string>) => string;
@@ -11,7 +11,9 @@ import type { IUIStatistics } from "../services/statistics";
11
11
  import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from "../components/Menus/subMenuTabs/types";
12
12
  import type { AdditionalDesktopControlPanelButton } from "../components/Controls/types";
13
13
  import type { AdmanInitParams } from "./ads";
14
+ import type { IQoeButtonOnlyConfig, IQoeCallbacks, IQoeConfig } from "./qoe";
14
15
  export type { AdmanInitParams, AdsParams, IAdmanInitParamsExternalApi } from "./ads";
16
+ export * from "./qoe";
15
17
  export declare const enum UIType {
16
18
  DESKTOP = "desktop",
17
19
  MOBILE = "mobile"
@@ -179,6 +181,7 @@ export interface IVKVideoPlayerCallbacks {
179
181
  onClosed?: (adsSection: AdsSection) => void;
180
182
  onError?: (message: string) => void;
181
183
  };
184
+ qoe?: IQoeCallbacks;
182
185
  }
183
186
  export interface IVKVideoPlayerUICallbacks {
184
187
  onStarted?: (isMuted: boolean) => void;
@@ -331,6 +334,7 @@ export interface IVKVideoPlayerConfig {
331
334
  mediascopePixels?: MediascopePixelTypes.Pixel[];
332
335
  getVideoDeeplink?: (timestamp: number) => string;
333
336
  apptracerUserId?: string | number;
337
+ qoe?: IQoeConfig | IQoeButtonOnlyConfig;
334
338
  }
335
339
  /**
336
340
  * Поля, которые можно обновить, сохранив итстанс плеера
@@ -377,6 +381,7 @@ export interface IPlayerControlsRef {
377
381
  interactiveTimeIndicator?: HTMLElement;
378
382
  timeline?: HTMLElement;
379
383
  autoplayNextToggle?: HTMLButtonElement;
384
+ qoe?: HTMLElement;
380
385
  }
381
386
  export interface IPlayerDesktopControlsWidth {
382
387
  prevButton: number;
@@ -624,7 +629,3 @@ export interface Caption {
624
629
  value: string;
625
630
  }
626
631
  export type NotificationId = "slow_video";
627
- export declare enum PlaybackStateExtended {
628
- BUFFERING = "buffering"
629
- }
630
- export type PlaybackStateRealistic = PlaybackState | PlaybackStateExtended;
@@ -0,0 +1,65 @@
1
+ import type { RecursivePartial, SafeAny } from "@vkontakte/videoplayer-shared";
2
+ import type { QoeClosePollReason } from "../store/modules/qoeStore/types";
3
+ export type QoeQuestionType = "star_rating" | "checkboxes_open";
4
+ export interface IQoeQuestionBase {
5
+ id: number;
6
+ statement: string;
7
+ type: QoeQuestionType;
8
+ }
9
+ export interface IQoeQuestionStarRating extends IQoeQuestionBase {
10
+ type: "star_rating";
11
+ rating_max: number;
12
+ }
13
+ export interface IQoeQuestionOption {
14
+ index: number;
15
+ text: string;
16
+ is_open?: boolean;
17
+ }
18
+ export interface IQoeQuestionCheckboxesOpen extends IQoeQuestionBase {
19
+ type: "checkboxes_open";
20
+ options: IQoeQuestionOption[];
21
+ }
22
+ export type IQoeQuestion = IQoeQuestionStarRating | IQoeQuestionCheckboxesOpen;
23
+ export type QoePollTranslationKeys = "button_back" | "button_continue" | "button_send" | "poll_step_caption" | "text_answer_placeholder" | "player_button_tooltip" | "star_labels";
24
+ export type QoePollTranslations = Record<QoePollTranslationKeys, string>;
25
+ export interface IQoePoll {
26
+ questions: IQoeQuestion[];
27
+ completionMessage?: string;
28
+ translations: QoePollTranslations;
29
+ }
30
+ export interface IQoeAnswer {
31
+ questionId: number;
32
+ numeric: number[];
33
+ text?: string;
34
+ }
35
+ export interface IQoeResult {
36
+ answers: IQoeAnswer[];
37
+ }
38
+ export type QoeStartedHandler = VoidFunction;
39
+ export type QoeClosedHandler = (reason: QoeClosePollReason, result?: IQoeResult) => void;
40
+ export type QoeCompleteHandler = (result: IQoeResult) => void;
41
+ export interface IQoeCallbacks {
42
+ onStarted?: QoeStartedHandler;
43
+ onClosed?: QoeClosedHandler;
44
+ onComplete?: QoeCompleteHandler;
45
+ }
46
+ export interface IQoeConfig {
47
+ poll: IQoePoll;
48
+ /**
49
+ * Таймаут автоматического закрытия в конце
50
+ * @default 3000
51
+ */
52
+ closeDelay?: number;
53
+ }
54
+ export interface IQoeButtonOnlyConfig {
55
+ buttonOnly: true;
56
+ translations: RecursivePartial<QoePollTranslations>;
57
+ }
58
+ export declare const isQoeButtonOnlyConfig: (candidate: SafeAny) => candidate is IQoeButtonOnlyConfig;
59
+ export declare const isQoeConfig: (candidate: SafeAny) => candidate is IQoeConfig;
60
+ export declare const isStarRatingQuestion: (candidate: SafeAny) => candidate is IQoeQuestionStarRating;
61
+ export declare const isCheckboxesOpenQuestion: (candidate: SafeAny) => candidate is IQoeQuestionCheckboxesOpen;
62
+ export interface QoeStoreFactoryDeps {
63
+ config?: IQoeConfig | IQoeButtonOnlyConfig;
64
+ callbacks?: IQoeCallbacks;
65
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Базовая санитизация SVG для защиты от XSS.
3
+ * Удаляет опасные паттерны: script-теги, event handlers, javascript: URLs.
4
+ */
5
+ export declare function sanitizeSvg(svg: string | undefined): string;