@vkontakte/videoplayer 1.1.86 → 1.1.87-dev.04ce2cd1.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 (110) hide show
  1. package/es2015.cjs +423 -56
  2. package/es2015.esm.js +423 -56
  3. package/es2018.cjs +423 -56
  4. package/es2018.esm.js +423 -56
  5. package/es2024.cjs +423 -56
  6. package/es2024.esm.js +423 -56
  7. package/esnext.cjs +423 -56
  8. package/esnext.esm.js +423 -56
  9. package/evergreen.esm.js +423 -56
  10. package/package.json +5 -5
  11. package/types/VKVideoPlayer/HTMLElement.d.ts +1 -1
  12. package/types/VKVideoPlayer/index.svelte.d.ts +173 -173
  13. package/types/components/Ads/admanWrapper.d.ts +79 -75
  14. package/types/components/Ads/types.d.ts +27 -27
  15. package/types/components/Controls/contants/desktopButtonsLeftIds.d.ts +8 -8
  16. package/types/components/Controls/contants/desktopButtonsLeftWeights.d.ts +2 -4
  17. package/types/components/Controls/contants/desktopButtonsRightIds.d.ts +8 -8
  18. package/types/components/Controls/contants/desktopButtonsRightWeights.d.ts +2 -4
  19. package/types/components/Controls/types.d.ts +27 -27
  20. package/types/components/Controls/utils/isInnerButtonGuard.d.ts +1 -1
  21. package/types/components/Icons/constants.d.ts +5 -5
  22. package/types/components/Icons/utils.d.ts +1 -1
  23. package/types/components/Menus/constants/contextMenuItemIds.d.ts +10 -10
  24. package/types/components/Menus/constants/contextMenuItemWeights.d.ts +2 -4
  25. package/types/components/Menus/constants/index.d.ts +4 -4
  26. package/types/components/Menus/constants/openSubMenuItemsIds.d.ts +1 -1
  27. package/types/components/Menus/constants/settingsMenuItemIds.d.ts +10 -10
  28. package/types/components/Menus/constants/settingsMenuItemWeights.d.ts +2 -4
  29. package/types/components/Menus/constants/subMenuIds.d.ts +6 -6
  30. package/types/components/Menus/subMenuTabs/rootMenuItems.d.ts +26 -26
  31. package/types/components/Menus/subMenuTabs/sharedMenuItems.d.ts +7 -7
  32. package/types/components/Menus/subMenuTabs/subMenuItems.d.ts +4 -10
  33. package/types/components/Menus/subMenuTabs/types.d.ts +108 -108
  34. package/types/components/Menus/subMenuTabs/utils.d.ts +2 -2
  35. package/types/components/Menus/types.d.ts +64 -61
  36. package/types/components/Menus/utils/getCurrentQualityDisplayValue.d.ts +12 -12
  37. package/types/components/Menus/utils/getQualityIcon.d.ts +2 -2
  38. package/types/components/Menus/utils/getSubMenusStack.svelte.d.ts +7 -7
  39. package/types/components/Menus/utils/menuNavigation.d.ts +5 -5
  40. package/types/components/Root/types.d.ts +79 -79
  41. package/types/components/Root/utils.d.ts +2 -2
  42. package/types/components/Timeline/PreviewTrack/useTransitionToPreviewTrack.svelte.d.ts +15 -15
  43. package/types/components/Timeline/consts.d.ts +2 -2
  44. package/types/components/shared/interpolateUtils.d.ts +2 -2
  45. package/types/config.d.ts +270 -260
  46. package/types/constans/controls.d.ts +21 -21
  47. package/types/constans/grid.d.ts +9 -9
  48. package/types/constans/index.d.ts +8 -8
  49. package/types/constans/interactives.d.ts +4 -4
  50. package/types/constans/keyboard.d.ts +43 -48
  51. package/types/index.d.ts +16 -16
  52. package/types/services/statistics.d.ts +13 -13
  53. package/types/store/index.d.ts +391 -391
  54. package/types/store/micro/base.d.ts +6 -6
  55. package/types/store/micro/fakeIsPlaying.d.ts +8 -10
  56. package/types/store/micro/graphIsOpened.d.ts +11 -13
  57. package/types/store/micro/index.d.ts +1 -1
  58. package/types/store/micro/interactiveControlsOpacity.d.ts +8 -10
  59. package/types/store/micro/notifications.d.ts +7 -10
  60. package/types/store/micro/pictureInPicture.d.ts +6 -9
  61. package/types/store/micro/seekToInteractiveDisabledTooltip.d.ts +8 -7
  62. package/types/store/micro/showInteractiveTimeIndicatorTooltip.d.ts +13 -12
  63. package/types/store/utils.d.ts +36 -36
  64. package/types/translation/index.d.ts +2 -2
  65. package/types/translation/labels.d.ts +1 -1
  66. package/types/translation/packs/en.d.ts +1 -1
  67. package/types/translation/packs/ru.d.ts +1 -1
  68. package/types/translation/types.d.ts +5 -5
  69. package/types/types/index.d.ts +534 -516
  70. package/types/types/svg.d.d.ts +5 -0
  71. package/types/utils/CaptionsPrepared.d.ts +15 -15
  72. package/types/utils/WebVttParser.d.ts +11 -11
  73. package/types/utils/attachments/defferedDisableByCondition.d.ts +3 -3
  74. package/types/utils/changeVolume.d.ts +6 -6
  75. package/types/utils/elementHelpers.d.ts +2 -2
  76. package/types/utils/findCurrentSubtltlePhrase.d.ts +1 -1
  77. package/types/utils/fullscreen.d.ts +14 -14
  78. package/types/utils/getActualEpisode.d.ts +7 -7
  79. package/types/utils/getControlInfo.d.ts +5 -7
  80. package/types/utils/getHotKeyMapData.d.ts +1 -1
  81. package/types/utils/grid.d.ts +1 -1
  82. package/types/utils/hooks/useIosSafariFullscreen.d.ts +2 -2
  83. package/types/utils/hooks/useIosSafariFullscreenSubtitles.d.ts +3 -3
  84. package/types/utils/keyboardHandleCases.d.ts +1 -1
  85. package/types/utils/notificationShowManager.d.ts +7 -6
  86. package/types/utils/roundFps.d.ts +1 -1
  87. package/types/utils/sanitizeHtml.d.ts +3 -3
  88. package/types/utils/sorts.d.ts +2 -2
  89. package/types/utils/stack/index.d.ts +7 -7
  90. package/types/utils/stack/node.d.ts +3 -3
  91. package/types/utils/subtitles.d.ts +8 -8
  92. package/types/utils/timeout.d.ts +2 -2
  93. package/types/utils/updatePlayerControlBlocks.d.ts +2 -2
  94. package/types/utils/updatePlayerControlsInfo.d.ts +2 -2
  95. package/types/utils/userSettings.d.ts +26 -21
  96. package/types/utils/videoConfig.d.ts +6 -2
  97. package/types/utils/volumeChange.d.ts +1 -1
  98. package/types/utils/webAPI/annotationsApi/annotationsApi.d.ts +31 -31
  99. package/types/utils/webAPI/annotationsApi/errors.d.ts +1 -1
  100. package/types/utils/webAPI/focusLock.d.ts +30 -30
  101. package/types/utils/webAPI/focusManager.d.ts +15 -15
  102. package/types/utils/webAPI/language.d.ts +1 -1
  103. package/types/utils/webAPI/mediaSessionApi.d.ts +14 -14
  104. package/types/utils/webAPI/pictureInPictureApi/documentPictureInPictureApi.svelte.d.ts +41 -41
  105. package/types/utils/webAPI/pictureInPictureApi/factory.d.ts +2 -2
  106. package/types/utils/webAPI/pictureInPictureApi/index.d.ts +4 -4
  107. package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApi.d.ts +46 -46
  108. package/types/utils/webAPI/pictureInPictureApi/types.d.ts +4 -4
  109. package/types/utils/webAPI/pictureInPictureApi/utils.d.ts +3 -3
  110. package/types/utils/webAPI/slotsApi.d.ts +41 -41
@@ -1,10 +1,10 @@
1
1
  export declare enum DesktopButtonsRightIds {
2
- LOGO = "vkLogo",
3
- AUTOPLAY_NEXT = "autoplayNext",
4
- VOLUME = "volume",
5
- SUBTITLES = "subtitles",
6
- SETTINGS = "settings",
7
- CONTEXT = "context",
8
- FULLSCREEN = "fullscreen",
9
- CHROMECAST = "chromecast"
2
+ LOGO = "vkLogo",
3
+ AUTOPLAY_NEXT = "autoplayNext",
4
+ VOLUME = "volume",
5
+ SUBTITLES = "subtitles",
6
+ SETTINGS = "settings",
7
+ CONTEXT = "context",
8
+ FULLSCREEN = "fullscreen",
9
+ CHROMECAST = "chromecast"
10
10
  }
@@ -1,4 +1,2 @@
1
- import { DesktopButtonsRightIds } from './desktopButtonsRightIds';
2
- export declare const desktopButtonsRightWeights: {
3
- [key in DesktopButtonsRightIds]: number;
4
- };
1
+ import { DesktopButtonsRightIds } from "./desktopButtonsRightIds";
2
+ export declare const desktopButtonsRightWeights: { [key in DesktopButtonsRightIds] : number };
@@ -1,41 +1,41 @@
1
- import { GridTypes } from '../../constans';
2
- import type { TmpComponentType } from '../../types/tmp';
1
+ import type { GridTypes } from "../../constans";
2
+ import type { TmpComponentType } from "../../types/tmp";
3
3
  export declare enum ControlButtonType {
4
- DESKTOP_CONTROL_PANEL_LEFT = "desktop-control-panel-left",
5
- DESKTOP_CONTROL_PANEL_RIGHT = "desktop-control-panel-right"
4
+ DESKTOP_CONTROL_PANEL_LEFT = "desktop-control-panel-left",
5
+ DESKTOP_CONTROL_PANEL_RIGHT = "desktop-control-panel-right"
6
6
  }
7
7
  interface BaseButton {
8
- id: string;
9
- weight: number;
10
- disabled?: boolean;
8
+ id: string;
9
+ weight: number;
10
+ disabled?: boolean;
11
11
  }
12
12
  interface BaseInnerButton extends BaseButton {
13
- buttonComponent: TmpComponentType;
14
- buttonComponentProps?: Record<string, unknown>;
15
- ariaKeyShortCut?: string;
16
- ariaExpanded?: boolean;
13
+ buttonComponent: TmpComponentType;
14
+ buttonComponentProps?: Record<string, unknown>;
15
+ ariaKeyShortCut?: string;
16
+ ariaExpanded?: boolean;
17
17
  }
18
18
  interface BaseAdditionalButton extends BaseButton {
19
- icon: string;
20
- testId?: string;
21
- onClick?: () => void;
22
- ariaLabel: string;
19
+ icon: string;
20
+ testId?: string;
21
+ onClick?: () => void;
22
+ ariaLabel: string;
23
23
  }
24
24
  export interface DesktopControlPanelButton extends BaseInnerButton {
25
- type: ControlButtonType.DESKTOP_CONTROL_PANEL_LEFT | ControlButtonType.DESKTOP_CONTROL_PANEL_RIGHT;
26
- tooltipEnabled?: boolean;
27
- mouseEnter?: () => void;
28
- mouseLeave?: () => void;
29
- tooltipText?: string;
30
- disabledTooltipContent?: string;
31
- className?: string;
25
+ type: ControlButtonType.DESKTOP_CONTROL_PANEL_LEFT | ControlButtonType.DESKTOP_CONTROL_PANEL_RIGHT;
26
+ tooltipEnabled?: boolean;
27
+ mouseEnter?: () => void;
28
+ mouseLeave?: () => void;
29
+ tooltipText?: string;
30
+ disabledTooltipContent?: string;
31
+ className?: string;
32
32
  }
33
33
  export interface AdditionalDesktopControlPanelButton extends BaseAdditionalButton {
34
- type: ControlButtonType.DESKTOP_CONTROL_PANEL_RIGHT;
35
- tooltipText?: string;
36
- disabledTooltipContent?: string;
37
- hideOnDesktopGridTypes?: GridTypes[];
38
- disableMouseupTooltipShow?: boolean;
34
+ type: ControlButtonType.DESKTOP_CONTROL_PANEL_RIGHT;
35
+ tooltipText?: string;
36
+ disabledTooltipContent?: string;
37
+ hideOnDesktopGridTypes?: GridTypes[];
38
+ disableMouseupTooltipShow?: boolean;
39
39
  }
40
40
  export type AdditionalButton = AdditionalDesktopControlPanelButton;
41
41
  export {};
@@ -1,2 +1,2 @@
1
- import type { AdditionalDesktopControlPanelButton, DesktopControlPanelButton } from '../types';
1
+ import type { AdditionalDesktopControlPanelButton, DesktopControlPanelButton } from "../types";
2
2
  export declare const isInnerButtonGuard: (btn: DesktopControlPanelButton | AdditionalDesktopControlPanelButton) => btn is DesktopControlPanelButton;
@@ -1,8 +1,8 @@
1
1
  export declare enum IconSize {
2
- XS = "12",
3
- S = "16",
4
- M = "24",
5
- ML = "32",
6
- L = "48"
2
+ XS = "12",
3
+ S = "16",
4
+ M = "24",
5
+ ML = "32",
6
+ L = "48"
7
7
  }
8
8
  export declare const DEFAULT_ICON_COLOR = "var(--btn-color, #fff)";
@@ -1,2 +1,2 @@
1
- import type { IconSize } from './constants';
1
+ import type { IconSize } from "./constants";
2
2
  export declare const getSizeStyle: (size: IconSize) => string;
@@ -1,12 +1,12 @@
1
1
  export declare enum ContextMenuItemIds {
2
- COPY_LINK = "copy-link",
3
- COPY_LINK_TIMESTAMP = "copy-link-timestamp",
4
- COPY_EMBED_CODE = "copy-embed-code",
5
- PIP = "pip",
6
- VIDEO_LOOP = "video-loop",
7
- ROTATE = "rotate",
8
- REPORT = "report",
9
- SAVE_DEBUG = "save-debug",
10
- SAVE_TRACE = "save-trace",
11
- DEBUG_INFO = "debug-info"
2
+ COPY_LINK = "copy-link",
3
+ COPY_LINK_TIMESTAMP = "copy-link-timestamp",
4
+ COPY_EMBED_CODE = "copy-embed-code",
5
+ PIP = "pip",
6
+ VIDEO_LOOP = "video-loop",
7
+ ROTATE = "rotate",
8
+ REPORT = "report",
9
+ SAVE_DEBUG = "save-debug",
10
+ SAVE_TRACE = "save-trace",
11
+ DEBUG_INFO = "debug-info"
12
12
  }
@@ -1,4 +1,2 @@
1
- import { ContextMenuItemIds } from './contextMenuItemIds';
2
- export declare const contextMenuItemWeights: {
3
- [key in ContextMenuItemIds]: number;
4
- };
1
+ import { ContextMenuItemIds } from "./contextMenuItemIds";
2
+ export declare const contextMenuItemWeights: { [key in ContextMenuItemIds] : number };
@@ -1,4 +1,4 @@
1
- export * from './settingsMenuItemWeights';
2
- export * from './settingsMenuItemIds';
3
- export * from './defaultSubMenuMinWidth';
4
- export * from './topOffset';
1
+ export * from "./settingsMenuItemWeights";
2
+ export * from "./settingsMenuItemIds";
3
+ export * from "./defaultSubMenuMinWidth";
4
+ export * from "./topOffset";
@@ -1,3 +1,3 @@
1
1
  export declare enum OpenSubMenuItemsIds {
2
- QUALITY_DETAIL = "quality-detail-sub"
2
+ QUALITY_DETAIL = "quality-detail-sub"
3
3
  }
@@ -1,12 +1,12 @@
1
1
  export declare enum SettingsMenuItemIds {
2
- QUALITY = "quality-settings",
3
- AUDIO_TRACKS = "audio-language-settings",
4
- PLAYBACK_RATE = "playback-rate-settings",
5
- SUBTITLES = "subtitles-settings",
6
- TRAFFIC_SAVING = "traffic-saving-settings",
7
- DOWNLOAD = "download",
8
- REPORT = "report",
9
- COPY_DATA = "copy-data",
10
- SAVE_TRACE_INFO = "save-trace-info",
11
- DEBUG_INFO = "debug-info"
2
+ QUALITY = "quality-settings",
3
+ AUDIO_TRACKS = "audio-language-settings",
4
+ PLAYBACK_RATE = "playback-rate-settings",
5
+ SUBTITLES = "subtitles-settings",
6
+ TRAFFIC_SAVING = "traffic-saving-settings",
7
+ DOWNLOAD = "download",
8
+ REPORT = "report",
9
+ COPY_DATA = "copy-data",
10
+ SAVE_TRACE_INFO = "save-trace-info",
11
+ DEBUG_INFO = "debug-info"
12
12
  }
@@ -1,4 +1,2 @@
1
- import { SettingsMenuItemIds } from './settingsMenuItemIds';
2
- export declare const settingsMenuItemWeights: {
3
- [key in SettingsMenuItemIds]: number;
4
- };
1
+ import { SettingsMenuItemIds } from "./settingsMenuItemIds";
2
+ export declare const settingsMenuItemWeights: { [key in SettingsMenuItemIds] : number };
@@ -1,8 +1,8 @@
1
1
  export declare enum SubMenuIds {
2
- QUALITY = "quality-sub",
3
- QUALITY_DETAIL = "quality-detail-sub",
4
- DEFAULT_QUALITY_APPLIANCE = "default_quality_applies_to_sub",
5
- AUDIO_TRACKS = "audio-language-sub",
6
- PLAYBACK_RATE = "playback-rate-sub",
7
- SUBTITLES = "subtitles-sub"
2
+ QUALITY = "quality-sub",
3
+ QUALITY_DETAIL = "quality-detail-sub",
4
+ DEFAULT_QUALITY_APPLIANCE = "default_quality_applies_to_sub",
5
+ AUDIO_TRACKS = "audio-language-sub",
6
+ PLAYBACK_RATE = "playback-rate-sub",
7
+ SUBTITLES = "subtitles-sub"
8
8
  }
@@ -1,34 +1,34 @@
1
- import { RootMenuId, type SettingsMenuItem } from './types';
2
- import { type VideoPlaybackRate, type VideoSubtitle } from '../../../types';
3
- import type { IAudioStream, PlaybackRate, VideoQuality } from '@vkontakte/videoplayer-core';
4
- import type { QualitySettingsAppliesTo } from '../../../utils/userSettings';
1
+ import { RootMenuId, type SettingsMenuItem } from "./types";
2
+ import { type VideoPlaybackRate, type VideoSubtitle } from "../../../types";
3
+ import type { IAudioStream, PlaybackRate, VideoQuality } from "@vkontakte/videoplayer-core";
4
+ import type { QualitySettingsAppliesTo } from "../../../utils/userSettings";
5
5
  export type Context = {
6
- currentPlaybackRate: number;
7
- availablePlaybackRates: VideoPlaybackRate[];
8
- selectPlaybackRate: (playbackRate: PlaybackRate) => void;
9
- trafficSavingEnabled: boolean;
10
- toggleTrafficSaving: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
11
- currentQuality: VideoQuality;
12
- isAutoQualityEnabled: boolean;
13
- isMobile: boolean;
14
- currentAudioStream: IAudioStream | undefined;
15
- availableAudioStreams: IAudioStream[];
16
- qualityDetailsSubMenuEnabled: boolean;
17
- currentSubtitle: Omit<VideoSubtitle, 'selected'>;
18
- onDownloadClick: () => void;
19
- onReportProblemClick: () => void;
20
- onCopyDataClick: () => void;
21
- onSaveTraceDataClick: () => void;
22
- toggleShowDebugInfo: () => void;
6
+ currentPlaybackRate: number;
7
+ availablePlaybackRates: VideoPlaybackRate[];
8
+ selectPlaybackRate: (playbackRate: PlaybackRate) => void;
9
+ trafficSavingEnabled: boolean;
10
+ toggleTrafficSaving: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
11
+ currentQuality: VideoQuality;
12
+ isAutoQualityEnabled: boolean;
13
+ isMobile: boolean;
14
+ currentAudioStream: IAudioStream | undefined;
15
+ availableAudioStreams: IAudioStream[];
16
+ qualityDetailsSubMenuEnabled: boolean;
17
+ currentSubtitle: Omit<VideoSubtitle, "selected">;
18
+ onDownloadClick: () => void;
19
+ onReportProblemClick: () => void;
20
+ onCopyDataClick: () => void;
21
+ onSaveTraceDataClick: () => void;
22
+ toggleShowDebugInfo: () => void;
23
23
  };
24
24
  /**
25
- * Мапа элементов меню, которые показываются на первом уровне.
26
- */
25
+ * Мапа элементов меню, которые показываются на первом уровне.
26
+ */
27
27
  export declare const RootMenuItemMap: Record<RootMenuId, (context: Context) => SettingsMenuItem>;
28
28
  type Params = {
29
- items: RootMenuId[];
30
- context: Context;
31
- additionalSettingsMenuItems: SettingsMenuItem[];
29
+ items: RootMenuId[];
30
+ context: Context;
31
+ additionalSettingsMenuItems: SettingsMenuItem[];
32
32
  };
33
33
  export declare const getRootMenuItems: ({ items, context, additionalSettingsMenuItems }: Params) => SettingsMenuItem[];
34
34
  export {};
@@ -1,14 +1,14 @@
1
- import { type Context, type SubMenuItem } from './types';
2
- import type { QualitySettingsAppliesTo } from 'packages/ui/src/utils/userSettings';
1
+ import { type Context, type SubMenuItem } from "./types";
2
+ import type { QualitySettingsAppliesTo } from "../../../utils/userSettings";
3
3
  export type QualityHandler = (params: {
4
- labelWithQuality: boolean;
5
- appliesTo: QualitySettingsAppliesTo;
6
- selected: boolean;
4
+ labelWithQuality: boolean;
5
+ appliesTo: QualitySettingsAppliesTo;
6
+ selected: boolean;
7
7
  }, context: Context) => SubMenuItem;
8
8
  type DefaultHandler = (context: Context) => SubMenuItem;
9
9
  /**
10
- * В данном файле определяем элементы меню, которые могут использоваться в разных подменю.
11
- */
10
+ * В данном файле определяем элементы меню, которые могут использоваться в разных подменю.
11
+ */
12
12
  export declare const getMenuItemForAnotherQuality: DefaultHandler;
13
13
  export declare const getMenuItemForAutoQuality: QualityHandler;
14
14
  export declare const getMenuItemForQualityApplience: DefaultHandler;
@@ -1,13 +1,7 @@
1
- import { SubMenuId, type Context } from './types';
1
+ import { SubMenuId, type Context, type SubMenuData } from "./types";
2
2
  type Params = {
3
- subMenuId: SubMenuId | null;
4
- context: Context;
3
+ subMenuId: SubMenuId | null;
4
+ context: Context;
5
5
  };
6
- export declare const getSubMenuData: ({ subMenuId, context }: Params) => {
7
- title: string;
8
- closeSettingsMenu?: () => void;
9
- items: import("./types").SubMenuItem[];
10
- id: SubMenuId;
11
- minWidth?: number;
12
- }[];
6
+ export declare const getSubMenuData: ({ subMenuId, context }: Params) => ReturnType<SubMenuData>[];
13
7
  export {};
@@ -1,151 +1,151 @@
1
- import type { UIType, VideoPlaybackRate, VideoQualityForRender, VideoQualityUI, VideoSubtitle } from '../../../types';
2
- import type { IAudioStream, PlaybackRate, VideoQuality } from '@vkontakte/videoplayer-core';
3
- import type { QualitySettingsAppliesTo } from '../../../utils/userSettings';
4
- import type { TmpComponentType } from 'packages/ui/src/types/tmp';
1
+ import type { UIType, VideoPlaybackRate, VideoQualityForRender, VideoQualityUI, VideoSubtitle } from "../../../types";
2
+ import type { IAudioStream, PlaybackRate, VideoQuality } from "@vkontakte/videoplayer-core";
3
+ import type { QualitySettingsAppliesTo } from "../../../utils/userSettings";
4
+ import type { TmpComponentType } from "../../../types/tmp";
5
5
  export declare enum SharedSubMenuItemId {
6
- QUALITY_OTHER = "quality-other-settings",
7
- QUALITY_AUTO = "quality-auto",
8
- QUALITY_APPLIANCE = "quality-appliance-settings",
9
- QUALITY_HIGH = "quality-high",
10
- QUALITY_TRAFFIC_SAVING = "quality-traffic-saving"
6
+ QUALITY_OTHER = "quality-other-settings",
7
+ QUALITY_AUTO = "quality-auto",
8
+ QUALITY_APPLIANCE = "quality-appliance-settings",
9
+ QUALITY_HIGH = "quality-high",
10
+ QUALITY_TRAFFIC_SAVING = "quality-traffic-saving"
11
11
  }
12
12
  export declare enum SubMenuId {
13
- PLAYBACK_RATE = "playback-rate",
14
- QUALITY_SETTINGS = "quality-settings",
15
- QUALITY_OTHER_SETTINGS = "quality-other-settings",
16
- QUALITY_APPLIANCE = "quality-appliance",
17
- AUDIO_TRACKS = "audio-tracks",
18
- SUBTITLES = "subtitles"
13
+ PLAYBACK_RATE = "playback-rate",
14
+ QUALITY_SETTINGS = "quality-settings",
15
+ QUALITY_OTHER_SETTINGS = "quality-other-settings",
16
+ QUALITY_APPLIANCE = "quality-appliance",
17
+ AUDIO_TRACKS = "audio-tracks",
18
+ SUBTITLES = "subtitles"
19
19
  }
20
20
  export declare enum RootMenuId {
21
- QUALITY_SETTINGS = "quality-settings",
22
- TRAFFIC_SAVING_SWITCH = "traffic-saving-switch",
23
- AUDIO_TRACKS = "audio-tracks-settings",
24
- PLAYBACK_RATE = "playback-rate-settings",
25
- SUBTITLES = "subtitles-settings",
26
- DOWNLOAD = "download",
27
- SHOW_SUPPORT = "show-support",
28
- COPY_DATA = "copy-data",
29
- SAVE_TRACE_INFO = "save-trace-info",
30
- DEBUG_INFO = "debug-info"
21
+ QUALITY_SETTINGS = "quality-settings",
22
+ TRAFFIC_SAVING_SWITCH = "traffic-saving-switch",
23
+ AUDIO_TRACKS = "audio-tracks-settings",
24
+ PLAYBACK_RATE = "playback-rate-settings",
25
+ SUBTITLES = "subtitles-settings",
26
+ DOWNLOAD = "download",
27
+ SHOW_SUPPORT = "show-support",
28
+ COPY_DATA = "copy-data",
29
+ SAVE_TRACE_INFO = "save-trace-info",
30
+ DEBUG_INFO = "debug-info"
31
31
  }
32
32
  export type Context = {
33
- closeSettingsMenu: () => void;
34
- isMobile: boolean;
35
- /**
36
- * Скорость.
37
- */
38
- availablePlaybackRates: VideoPlaybackRate[];
39
- selectPlaybackRate: (playbackRate: PlaybackRate) => void;
40
- /**
41
- * Качество.
42
- */
43
- selectQuality: (quality: VideoQualityUI, appliesTo: QualitySettingsAppliesTo) => void;
44
- isAutoQualityEnabled: boolean;
45
- isAutoQualityAvailable: boolean;
46
- highQualityEnabled: boolean;
47
- toggleHighQuality: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
48
- trafficSavingEnabled: boolean;
49
- toggleTrafficSaving: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
50
- currentQuality: VideoQuality;
51
- availableQualities: VideoQualityForRender[];
52
- /**
53
- * Звуковые дорожки.
54
- */
55
- availableAudioStreams: IAudioStream[];
56
- selectAudioLanguage: (stream: IAudioStream) => void;
57
- currentAudioStream: IAudioStream | undefined;
58
- /**
59
- * Субтитры
60
- */
61
- availableSubtitlesList: VideoSubtitle[];
62
- selectSubtitle: (subtitle: VideoSubtitle) => void;
33
+ closeSettingsMenu: () => void;
34
+ isMobile: boolean;
35
+ /**
36
+ * Скорость.
37
+ */
38
+ availablePlaybackRates: VideoPlaybackRate[];
39
+ selectPlaybackRate: (playbackRate: PlaybackRate) => void;
40
+ /**
41
+ * Качество.
42
+ */
43
+ selectQuality: (quality: VideoQualityUI, appliesTo: QualitySettingsAppliesTo) => void;
44
+ isAutoQualityEnabled: boolean;
45
+ isAutoQualityAvailable: boolean;
46
+ highQualityEnabled: boolean;
47
+ toggleHighQuality: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
48
+ trafficSavingEnabled: boolean;
49
+ toggleTrafficSaving: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
50
+ currentQuality: VideoQuality;
51
+ availableQualities: VideoQualityForRender[];
52
+ /**
53
+ * Звуковые дорожки.
54
+ */
55
+ availableAudioStreams: IAudioStream[];
56
+ selectAudioLanguage: (stream: IAudioStream) => void;
57
+ currentAudioStream: IAudioStream | undefined;
58
+ /**
59
+ * Субтитры
60
+ */
61
+ availableSubtitlesList: VideoSubtitle[];
62
+ selectSubtitle: (subtitle: VideoSubtitle) => void;
63
63
  };
64
64
  export type SubMenuData = (context: Context) => {
65
- title: string;
66
- closeSettingsMenu?: () => void;
67
- items: SubMenuItem[];
68
- id: SubMenuId;
69
- minWidth?: number;
65
+ title: string;
66
+ closeSettingsMenu?: () => void;
67
+ items: SubMenuItem[];
68
+ id: SubMenuId;
69
+ minWidth?: number;
70
70
  };
71
71
  export type SubMenuItem = SubMenuItemOpenSubMenu | SubMenuItemSelect;
72
72
  type BaseSubMenuItem<U = any> = {
73
- selected?: boolean;
74
- valueComponent?: TmpComponentType;
75
- valueComponentParams?: {
76
- [key: string]: U;
77
- };
78
- bottomBordered?: boolean;
79
- label?: string;
80
- sublabel?: string;
81
- ariaLabel?: string;
82
- dataTestid?: string;
73
+ selected?: boolean;
74
+ valueComponent?: TmpComponentType;
75
+ valueComponentParams?: {
76
+ [key: string]: U;
77
+ };
78
+ bottomBordered?: boolean;
79
+ label?: string;
80
+ sublabel?: string;
81
+ ariaLabel?: string;
82
+ dataTestid?: string;
83
83
  };
84
84
  export type SubMenuItemOpenSubMenu = {
85
- type: SubMenuItemType.OPEN_SUB_MENU;
86
- children: SubMenuId;
87
- id: SharedSubMenuItemId;
85
+ type: SubMenuItemType.OPEN_SUB_MENU;
86
+ children: SubMenuId;
87
+ id: SharedSubMenuItemId;
88
88
  } & BaseSubMenuItem;
89
89
  export type SubMenuItemSelect<T = any> = {
90
- type: SubMenuItemType.SELECT_VALUE;
91
- value: T;
92
- dataValue?: T | keyof T;
93
- selectItem: (value: T) => void;
90
+ type: SubMenuItemType.SELECT_VALUE;
91
+ value: T;
92
+ dataValue?: T | keyof T;
93
+ selectItem: (value: T) => void;
94
94
  } & BaseSubMenuItem;
95
95
  interface BaseMenuItem<Id> {
96
- id: Id;
97
- weight: number;
98
- ariaLabel?: string;
99
- label: string;
96
+ id: Id;
97
+ weight: number;
98
+ ariaLabel?: string;
99
+ label: string;
100
100
  }
101
101
  export type IconPropsType = {
102
- [key: string]: any;
102
+ [key: string]: any;
103
103
  };
104
104
  interface BaseSettingsMenuItem extends BaseMenuItem<RootMenuId> {
105
- icon: TmpComponentType;
106
- iconProps?: IconPropsType;
107
- isHiddenFor?: UIType[];
105
+ icon: TmpComponentType;
106
+ iconProps?: IconPropsType;
107
+ isHiddenFor?: UIType[];
108
108
  }
109
109
  export declare enum MenuItemType {
110
- OPEN_SUB_MENU = "OPEN_SUB_MENU",
111
- CLICK = "CLICK",
112
- SWITCH = "SWITCH"
110
+ OPEN_SUB_MENU = "OPEN_SUB_MENU",
111
+ CLICK = "CLICK",
112
+ SWITCH = "SWITCH"
113
113
  }
114
114
  export declare enum SubMenuItemType {
115
- OPEN_SUB_MENU = "OPEN_SUB_MENU",
116
- SELECT_VALUE = "SELECT_VALUE"
115
+ OPEN_SUB_MENU = "OPEN_SUB_MENU",
116
+ SELECT_VALUE = "SELECT_VALUE"
117
117
  }
118
118
  export interface OpenSubMenuSettingsMenuItem extends BaseSettingsMenuItem {
119
- type: MenuItemType.OPEN_SUB_MENU;
120
- value: string;
121
- valueComponent?: TmpComponentType;
122
- children: SubMenuId;
119
+ type: MenuItemType.OPEN_SUB_MENU;
120
+ value: string;
121
+ valueComponent?: TmpComponentType;
122
+ children: SubMenuId;
123
123
  }
124
124
  export interface ClickSettingsMenuItem extends BaseSettingsMenuItem {
125
- type: MenuItemType.CLICK;
126
- onClick: () => void;
125
+ type: MenuItemType.CLICK;
126
+ onClick: () => void;
127
127
  }
128
128
  export interface SwitchSettingsMenuItem extends BaseSettingsMenuItem {
129
- type: MenuItemType.SWITCH;
130
- onClick: (enabled: boolean) => void;
131
- enabled: boolean;
132
- tooltipText?: string;
133
- maxTooltipWidth?: number;
129
+ type: MenuItemType.SWITCH;
130
+ onClick: (enabled: boolean) => void;
131
+ enabled: boolean;
132
+ tooltipText?: string;
133
+ maxTooltipWidth?: number;
134
134
  }
135
- export type AdditionalSwitchSettingsMenuItem = Omit<SwitchSettingsMenuItem, 'icon' | 'onClick'> & {
136
- icon: string;
137
- onChangeEnabled: (enabled: boolean) => void;
135
+ export type AdditionalSwitchSettingsMenuItem = Omit<SwitchSettingsMenuItem, "icon" | "onClick"> & {
136
+ icon: string;
137
+ onChangeEnabled: (enabled: boolean) => void;
138
138
  };
139
- export type AdditionalClickSettingsMenuItem = Omit<SwitchSettingsMenuItem, 'icon'> & {
140
- icon: string;
139
+ export type AdditionalClickSettingsMenuItem = Omit<SwitchSettingsMenuItem, "icon"> & {
140
+ icon: string;
141
141
  };
142
142
  export type SettingsMenuItem = OpenSubMenuSettingsMenuItem | ClickSettingsMenuItem | SwitchSettingsMenuItem;
143
143
  export type AdditionalSettingsMenuItem = AdditionalSwitchSettingsMenuItem | AdditionalClickSettingsMenuItem;
144
144
  export interface ContextMenuItem extends BaseMenuItem<string> {
145
- onClick: () => void;
145
+ onClick: () => void;
146
146
  }
147
147
  export type AdditionalContextMenuItem = ContextMenuItem;
148
148
  export type MenuRefs = {
149
- [key: string]: HTMLUListElement;
149
+ [key: string]: HTMLUListElement;
150
150
  };
151
151
  export {};
@@ -1,3 +1,3 @@
1
- import { type QualitySettingsAppliesTo } from '../../../utils/userSettings';
2
- export declare const getEnrichWithQualityAppliesTo: (appliesTo: QualitySettingsAppliesTo) => <T>(fn: (value: T, appliesTo: QualitySettingsAppliesTo) => void) => (value: T) => void;
1
+ import { type QualitySettingsAppliesTo } from "../../../utils/userSettings";
2
+ export declare const getEnrichWithQualityAppliesTo: (appliesTo: QualitySettingsAppliesTo) => (<T>(fn: (value: T, appliesTo: QualitySettingsAppliesTo) => void) => (value: T) => void);
3
3
  export declare function isDefined<T>(x: T | undefined): x is T;