@vkontakte/videoplayer 1.1.110-dev.b26d838aa.0 → 1.1.110
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/es2015.cjs +15 -15
- package/es2015.esm.js +11 -11
- package/esnext.cjs +15 -15
- package/esnext.esm.js +15 -15
- package/evergreen.esm.js +15 -15
- package/package.json +5 -5
- package/types/VKVideoPlayer/index.svelte.d.ts +5 -0
- package/types/components/Ads/admanWrapper.d.ts +1 -0
- package/types/components/Ads/types.d.ts +1 -0
- package/types/components/Menus/utils/getCurrentQualityDisplayValue.d.ts +1 -2
- package/types/config.d.ts +9 -0
- package/types/index.d.ts +1 -1
- package/types/services/mobileFullscreenReplacement.d.ts +14 -0
- package/types/store/index.d.ts +1 -1
- package/types/store/types.d.ts +3 -0
- package/types/translation/types.d.ts +1 -1
- package/types/types/index.d.ts +0 -8
- package/types/components/Menus/externalSettingsMenu.d.ts +0 -3
- package/types/types/externalSettingsMenu.d.ts +0 -55
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer",
|
|
3
|
-
"version": "1.1.110
|
|
3
|
+
"version": "1.1.110",
|
|
4
4
|
"author": "vk.ru",
|
|
5
5
|
"description": "Videoplayer based on the vk.ru platform",
|
|
6
6
|
"homepage": "https://vk.ru",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@adtech/rbadman": "2.2.57",
|
|
46
|
-
"@vkontakte/videoplayer-core": "2.0.179
|
|
47
|
-
"@vkontakte/videoplayer-interactive": "1.0.85
|
|
48
|
-
"@vkontakte/videoplayer-shared": "1.0.108
|
|
49
|
-
"@vkontakte/videoplayer-statistics": "1.0.125
|
|
46
|
+
"@vkontakte/videoplayer-core": "2.0.179",
|
|
47
|
+
"@vkontakte/videoplayer-interactive": "1.0.85",
|
|
48
|
+
"@vkontakte/videoplayer-shared": "1.0.108",
|
|
49
|
+
"@vkontakte/videoplayer-statistics": "1.0.125"
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -7,6 +7,7 @@ import type { PlaybackRate } from "@vkontakte/videoplayer-core";
|
|
|
7
7
|
import { type IStatContext } from "@vkontakte/videoplayer-statistics";
|
|
8
8
|
import { ThinOneStat } from "@vkontakte/videoplayer-statistics";
|
|
9
9
|
import { AnnotationsApi } from "../utils/webAPI/annotationsApi/annotationsApi";
|
|
10
|
+
import { type MobileFullscreenReplacement, type MobileFullscreenReplacementFields } from "../services/mobileFullscreenReplacement";
|
|
10
11
|
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem, MenuItemHighlight, RootMenuId } from "../components/Menus/subMenuTabs/types";
|
|
11
12
|
import type { AdditionalButton } from "../components/Controls/types";
|
|
12
13
|
import { SlotsApi } from "../utils/webAPI/slotsApi";
|
|
@@ -48,6 +49,7 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
48
49
|
private readonly interactiveSubscription;
|
|
49
50
|
annotationsApi: AnnotationsApi | undefined;
|
|
50
51
|
slotsApi: SlotsApi | undefined;
|
|
52
|
+
private readonly mobileFullscreenReplacement;
|
|
51
53
|
private focusManager;
|
|
52
54
|
private prevIsid;
|
|
53
55
|
private isInited;
|
|
@@ -193,6 +195,9 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
193
195
|
updateAdditionalButton(itemId: string, fields: Partial<Omit<AdditionalButton, "id" | "type">>): void;
|
|
194
196
|
addAdditionalButton(newButton: AdditionalButton): void;
|
|
195
197
|
removeAdditionalButton(itemId: string): void;
|
|
198
|
+
registerMobileFullscreenReplacement(replacement: MobileFullscreenReplacement): boolean;
|
|
199
|
+
updateMobileFullscreenReplacement(id: string, fields: MobileFullscreenReplacementFields): boolean;
|
|
200
|
+
unregisterMobileFullscreenReplacement(id: string): boolean;
|
|
196
201
|
updateStatContext(statContext: Partial<IStatContext | ThinOneStat.IStatContext>): void;
|
|
197
202
|
handleTimerNextVideo(state: boolean): void;
|
|
198
203
|
togglePictureInPicture(): void;
|
|
@@ -9,9 +9,8 @@ type CurrentQualityParams = {
|
|
|
9
9
|
isAutoQualityEnabled: boolean | undefined;
|
|
10
10
|
quality: VideoQuality | undefined;
|
|
11
11
|
availableQualities: VideoQualityForRender[];
|
|
12
|
-
autoQualityVariant?: "short" | "long";
|
|
13
12
|
};
|
|
14
|
-
export declare const getCurrentQualityDisplayValue: ({ quality, availableQualities, isAutoQualityEnabled
|
|
13
|
+
export declare const getCurrentQualityDisplayValue: ({ quality, availableQualities, isAutoQualityEnabled }: CurrentQualityParams) => string;
|
|
15
14
|
type QualityWithPrefixParams = {
|
|
16
15
|
quality: VideoQuality | undefined;
|
|
17
16
|
availableQualities: VideoQualityForRender[];
|
package/types/config.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ export interface IAdsConfig {
|
|
|
54
54
|
*/
|
|
55
55
|
preserveMutedState: boolean;
|
|
56
56
|
stopAdmanOnSwitch: boolean;
|
|
57
|
+
pauseAdmanOnSwitch: boolean;
|
|
57
58
|
/**
|
|
58
59
|
* Валидировать данные баннера перед стартом рекламы.
|
|
59
60
|
* Если true — проверяется validateBannerData (сейчас: duration > 0).
|
|
@@ -177,6 +178,14 @@ export interface IUIConfig {
|
|
|
177
178
|
tracerResumeOnFormatSwitch: boolean;
|
|
178
179
|
tracerResumeOnFatalError: boolean;
|
|
179
180
|
tracerSpanOnRecoverableError: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Принудительно резюмит трейсер, если в рамках одной видеосессии (vsid)
|
|
183
|
+
* количество фатальных ошибок NoFormats превысило limit.
|
|
184
|
+
*/
|
|
185
|
+
multipleNoFormatsTelemetry: {
|
|
186
|
+
enabled: boolean;
|
|
187
|
+
limit: number;
|
|
188
|
+
};
|
|
180
189
|
apptracer: IAppTracerConfig;
|
|
181
190
|
/**
|
|
182
191
|
* Токен apptracer-сервиса.
|
package/types/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { VERSION } from "./env";
|
|
|
8
8
|
export declare const registerPlayerWebComponent: () => void;
|
|
9
9
|
export { type AdditionalSettingsMenuItem, MenuItemType, type AdditionalClickSettingsMenuItem, type AdditionalSwitchSettingsMenuItem, type AdditionalContextMenuItem, RootMenuId, SubMenuId, SETTINGS_MENU_ID } from "./components/Menus/subMenuTabs/types";
|
|
10
10
|
export { type AdditionalButton, ControlButtonType } from "./components/Controls/types";
|
|
11
|
-
export type {
|
|
11
|
+
export type { MobileFullscreenReplacement, MobileFullscreenReplacementFields } from "./services/mobileFullscreenReplacement";
|
|
12
12
|
export type { VKVideoPlayer, IVKVideoPlayerConfig, IUpdatableVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, AdsParams, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek, LanguagePack, LanguageConfig, Milliseconds, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, QualityLimits, IAdsConfig, IVideoEpisode, IDpipConfig, IQoeConfig, IQoeButtonOnlyConfig, IQoePoll, IQoeResult, IQoeQuestion, IQoeCallbacks, QoePollTranslations, ISDKConfig, VideoPlayerView, IAdmanInitParamsExternalApi, VKLogoType };
|
|
13
13
|
export { GridTypes } from "./constans";
|
|
14
14
|
export { PlayerPhase } from "./types";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Readable } from "svelte/store";
|
|
2
|
+
export interface MobileFullscreenReplacement {
|
|
3
|
+
id: string;
|
|
4
|
+
active: boolean;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
}
|
|
7
|
+
export type MobileFullscreenReplacementFields = Partial<Omit<MobileFullscreenReplacement, "id">>;
|
|
8
|
+
export declare class MobileFullscreenReplacementRegistry {
|
|
9
|
+
private readonly replacement$;
|
|
10
|
+
get state$(): Readable<MobileFullscreenReplacement | null>;
|
|
11
|
+
register({ id, active, onClick }: MobileFullscreenReplacement): boolean;
|
|
12
|
+
update(id: string, fields: MobileFullscreenReplacementFields): boolean;
|
|
13
|
+
unregister(id: string): boolean;
|
|
14
|
+
}
|
package/types/store/index.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export type { IStore, IAdsState, IUIState, EnrichedStore } from "./types";
|
|
|
4
4
|
* Store приложения.
|
|
5
5
|
* Если будет слишком большим - можно разделить его на модули
|
|
6
6
|
*/
|
|
7
|
-
export declare const createStore: ({ initialVideoId, isTouch, isLiveCatchUpMode, isAudioDisabled, canDownload, callbacks, webApi, previewThumbsData: initialPreviewThumbsData, uiConfig, coreConfig, player: playerInstance, disabledControls, isInteractive, interactiveRanges$, isInteractiveTime$, replayInteractive, stopPlayer, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, additionalContextMenuItems, playPrevVideo, playNextVideo, onVideoChanged, looped, getStatisticsService, internalsExposure, playerView, playerId, metaConfig, statisticsConfig, getAppTracer, getAdmanWrapper, logger, adsEnabled, rootTracer, tracer }: IStoreParams) => IStore;
|
|
7
|
+
export declare const createStore: ({ initialVideoId, isTouch, isLiveCatchUpMode, isAudioDisabled, canDownload, callbacks, webApi, previewThumbsData: initialPreviewThumbsData, uiConfig, coreConfig, player: playerInstance, disabledControls, isInteractive, interactiveRanges$, isInteractiveTime$, replayInteractive, stopPlayer, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, additionalContextMenuItems, mobileFullscreenReplacement$, playPrevVideo, playNextVideo, onVideoChanged, looped, getStatisticsService, internalsExposure, playerView, playerId, metaConfig, statisticsConfig, getAppTracer, getAdmanWrapper, logger, adsEnabled, rootTracer, tracer }: IStoreParams) => IStore;
|
package/types/store/types.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type { SlotsApi } from "../utils/webAPI/slotsApi";
|
|
|
13
13
|
import type { FocusManager } from "../utils/webAPI/focusManager";
|
|
14
14
|
import type { ISDKConfig, IUIConfig } from "../config";
|
|
15
15
|
import type { IUIStatistics } from "../services/statistics";
|
|
16
|
+
import type { MobileFullscreenReplacement } from "../services/mobileFullscreenReplacement";
|
|
16
17
|
import type { ICompositionResult } from "./composition";
|
|
17
18
|
export interface SetQualityInfo {
|
|
18
19
|
appliesTo?: QualitySettingsAppliesTo;
|
|
@@ -77,6 +78,7 @@ export interface IUIState {
|
|
|
77
78
|
};
|
|
78
79
|
isFullscreen: Writable<boolean>;
|
|
79
80
|
isFullscreenOpenedByKeyboard: Writable<boolean>;
|
|
81
|
+
mobileFullscreenReplacement$: Readable<MobileFullscreenReplacement | null>;
|
|
80
82
|
rotateAlpha: Writable<number>;
|
|
81
83
|
isAutoplay: Writable<boolean>;
|
|
82
84
|
debugPanelVisible: Writable<boolean>;
|
|
@@ -302,6 +304,7 @@ export interface IStoreParams {
|
|
|
302
304
|
playPrevChapterDisabledTooltip: PlayPrevChapterDisabledTooltipKey;
|
|
303
305
|
additionalButtons: Array<AdditionalButtonDeprecated | AdditionalDesktopControlPanelButton>;
|
|
304
306
|
additionalContextMenuItems: AdditionalContextMenuItem[];
|
|
307
|
+
mobileFullscreenReplacement$: Readable<MobileFullscreenReplacement | null>;
|
|
305
308
|
playPrevVideo: () => void;
|
|
306
309
|
playNextVideo: () => void;
|
|
307
310
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InterfaceLanguage } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
export type Key = "auto_quality_invariant" | "auto_quality" | "
|
|
2
|
+
export type Key = "auto_quality_invariant" | "auto_quality" | "menu_quality" | "menu_playback_rate" | "menu_traffic_saving" | "menu_report" | "menu_pip" | "menu_pip_close" | "menu_copy_video_link" | "menu_copy_video_link_with_timestamp" | "menu_video_rotate" | "menu_video_loop_on" | "menu_video_loop_off" | "menu_chromecast" | "menu_copy_debug" | "menu_save_debug" | "menu_debug_overlay" | "menu_copy_embed_code" | "pip_dummy_title" | "submenu_traffic_saving" | "submenu_quality" | "submenu_playback_rate" | "submenu_settings" | "submenu_audio_languages" | "auto_quality_option" | "playing_ads" | "skip_ads_now" | "skip_ads_after" | "visit_advertiser" | "aria_timeline" | "aria_timeline_value" | "doubletap_seek_step" | "playback_rate_1" | "playback_rate" | "video360" | "subtitles_caption" | "subtitles_auto" | "subtitles_off" | "subtitles_auto_caption" | "subtitles_turn_on" | "subtitles_turn_off" | "traffic_saving_off" | "traffic_saving_on" | "traffic_saving_helper_text" | "tooltip_previous" | "tooltip_restart" | "tooltip_play" | "tooltip_pause" | "tooltip_next" | "tooltip_button_disabled" | "tooltip_interactive_go_back" | "tooltip_interactive_go_back_disabled" | "tooltip_interactive_go_back_disabled_first" | "tooltip_interactive_go_back_disabled_limit" | "tooltip_chapter_without_interactive" | "tooltip_interactive_of_chapter_completed" | "tooltip_interactive_seek" | "tooltip_interactive_graph_off" | "tooltip_interactive_graph_on" | "tooltip_live" | "tooltip_episodes" | "tooltip_volume" | "tooltip_volume_muted" | "tooltip_sound_unavailable" | "tooltip_settings_on" | "tooltip_subtitles_off" | "tooltip_settings_off" | "tooltip_subtitles_on" | "tooltip_fullscreen_off" | "tooltip_fullscreen_on" | "tooltip_chromecast_off" | "tooltip_chromecast_on" | "tooltip_episode_finished" | "tooltip_episode_unfinished" | "tooltip_disabled_when_interactive" | "tooltip_disabled_when_graph_on" | "tooltip_interactive_interaction_time_indicator" | "tooltip_vk_logo" | "tooltip_vk_video_logo" | "tooltip_autoplay_off" | "tooltip_autoplay_on" | "tooltip_context_menu_open" | "tooltip_context_menu_close" | "download_video_caption" | "hotkey_helper_current_volume" | "hotkey_map_modal_title" | "hotkey_map_modal_close_btn_text" | "hotkey_map_group_title_common" | "hotkey_map_group_title_playback" | "hotkey_map_group_title_subtitles" | "hotkey_map_group_title_episodes" | "hotkey_map_item_mute_description" | "hotkey_map_item_mute_value" | "hotkey_map_item_volume_down_description" | "hotkey_map_item_volume_down_value" | "hotkey_map_item_volume_up_description" | "hotkey_map_item_volume_up_value" | "hotkey_map_item_pip_description" | "hotkey_map_item_pip_value" | "hotkey_map_item_full_screen_description" | "hotkey_map_item_full_screen_value" | "hotkey_map_item_show_context_menu_description" | "hotkey_map_item_show_context_menu_value" | "hotkey_map_item_show_hotkey_map_description" | "hotkey_map_item_show_hotkey_map_value" | "hotkey_map_item_play_toggle_description" | "hotkey_map_item_play_toggle_value" | "hotkey_map_item_seek_backward_description" | "hotkey_map_item_seek_backward_value" | "hotkey_map_item_seek_forward_description" | "hotkey_map_item_seek_forward_value" | "hotkey_map_item_fast_seek_backward_description" | "hotkey_map_item_fast_seek_backward_value" | "hotkey_map_item_fast_seek_forward_description" | "hotkey_map_item_fast_seek_forward_value" | "hotkey_map_item_rate_down_description" | "hotkey_map_item_rate_down_value" | "hotkey_map_item_rate_up_description" | "hotkey_map_item_rate_up_value" | "hotkey_map_item_prev_frame_description" | "hotkey_map_item_prev_frame_value" | "hotkey_map_item_next_frame_description" | "hotkey_map_item_next_frame_value" | "hotkey_map_item_jump_seek_description" | "hotkey_map_item_jump_seek_value" | "hotkey_map_item_subtitles_toggle_description" | "hotkey_map_item_subtitles_toggle_value" | "hotkey_map_item_prev_episode_description" | "hotkey_map_item_prev_episode_pc_value" | "hotkey_map_item_prev_episode_mac_value" | "hotkey_map_item_next_episode_description" | "hotkey_map_item_next_episode_pc_value" | "hotkey_map_item_next_episode_mac_value" | "hotkey_map_item_next_video_description" | "hotkey_map_item_next_video_value" | "hotkey_map_item_prev_video_description" | "hotkey_map_item_prev_video_value" | "waiting_live_day_value" | "waiting_live_hour_value" | "waiting_live_minute_value" | "waiting_live_second_value" | "waiting_live_colon" | "waiting_live_upcoming_title" | "waiting_live_timer_title" | "waiting_live_recover_title" | "waiting_record_title" | "aria_label_submenu_traffic_saving" | "aria_label_submenu_back" | "aria_label_menu_quality" | "aria_label_menu_rate" | "aria_label_menu_subtitle" | "aria_label_menu_download" | "aria_label_new_tab_alert" | "aria_label_menu_debug_overlay" | "aria_label_menu_rotate" | "aria_label_menu_loop" | "aria_label_debug_panel" | "aria_label_context_menu" | "aria_label_video_player" | "aria_label_spherical_control" | "aria_label_menu_audio_languages" | "aria_label_settings" | "aria_label_autoplay" | "menu_audio_languages" | "audio_stream_display_language_label" | "audio_stream_display_language_label_index" | "audio_stream_display_label_index" | "audio_stream_display_language_index" | "audio_stream_display_unknown" | "audio_channels_5_1" | "audio_channels_stereo" | "end_screen_next_video" | "end_screen_recommended_video" | "other_quality" | "high_quality" | "high_quality_description" | "auto_quality_limit" | "traffic_saving_quality" | "traffic_saving_quality_description" | "quality_applience" | "quality_applience_action" | "default_quality_for_any_video" | "slow_video_notification_button" | "slow_video_notification_force_description" | "slow_video_notification_suggest_description" | "double_forward_label" | "preview_track_notification_text" | "preview_track_close_tooltip";
|
|
3
3
|
export type LanguagePack = Record<Key, string>;
|
|
4
4
|
export type LanguageConfig = {
|
|
5
5
|
language: string;
|
package/types/types/index.d.ts
CHANGED
|
@@ -12,10 +12,8 @@ import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from "../c
|
|
|
12
12
|
import type { AdditionalDesktopControlPanelButton } from "../components/Controls/types";
|
|
13
13
|
import type { AdmanInitParams } from "./ads";
|
|
14
14
|
import type { IQoeButtonOnlyConfig, IQoeCallbacks, IQoeConfig } from "./qoe";
|
|
15
|
-
import type { ExternalSettingsMenuParams } from "./externalSettingsMenu";
|
|
16
15
|
export type { AdmanInitParams, AdsParams, IAdmanInitParamsExternalApi } from "./ads";
|
|
17
16
|
export * from "./qoe";
|
|
18
|
-
export * from "./externalSettingsMenu";
|
|
19
17
|
export declare const enum UIType {
|
|
20
18
|
DESKTOP = "desktop",
|
|
21
19
|
MOBILE = "mobile"
|
|
@@ -109,7 +107,6 @@ export interface IVKVideoPlayerCallbacks {
|
|
|
109
107
|
onDevNullLog?: (entry: DevNullEntry) => void;
|
|
110
108
|
onTitleClicked?: () => void;
|
|
111
109
|
onRichSeekActiveChanged?: (active: boolean) => void;
|
|
112
|
-
onSettingsMenuClosed?: () => void;
|
|
113
110
|
uiInfo?: {
|
|
114
111
|
onUpcomingLiveViewStateChanged?: (value: IUpcomingLiveViewControlInfo) => void;
|
|
115
112
|
onControlsVisibleChanged?: (value?: boolean) => void;
|
|
@@ -339,11 +336,6 @@ export interface IVKVideoPlayerConfig {
|
|
|
339
336
|
getVideoDeeplink?: (timestamp: number) => string;
|
|
340
337
|
apptracerUserId?: string | number;
|
|
341
338
|
qoe?: IQoeConfig | IQoeButtonOnlyConfig;
|
|
342
|
-
/**
|
|
343
|
-
* Рендерит меню настроек плеера во внешнем приложении вместо встроенного.
|
|
344
|
-
* Вызывается при открытии меню настроек; состав меню и субменю совпадает со встроенным.
|
|
345
|
-
*/
|
|
346
|
-
renderExternalMenu?: (params: ExternalSettingsMenuParams) => void;
|
|
347
339
|
}
|
|
348
340
|
/**
|
|
349
341
|
* Поля, которые можно обновить, сохранив итстанс плеера
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { PlaybackRate } from "@vkontakte/videoplayer-core";
|
|
2
|
-
import type { VideoQualityUI } from "./index";
|
|
3
|
-
import type { SubMenuId } from "../components/Menus/subMenuTabs/types";
|
|
4
|
-
export interface ExternalSettingsMenuController {
|
|
5
|
-
setQuality: (quality: VideoQualityUI) => void;
|
|
6
|
-
setTrafficSavingEnabled: VoidFunction;
|
|
7
|
-
setHighQualityEnabled: VoidFunction;
|
|
8
|
-
setAudioStream: (id: string) => void;
|
|
9
|
-
setPlaybackRate: (rate: PlaybackRate) => void;
|
|
10
|
-
setSubtitle: (value: string) => void;
|
|
11
|
-
reportProblem: VoidFunction;
|
|
12
|
-
copyDebugData: VoidFunction;
|
|
13
|
-
close: VoidFunction;
|
|
14
|
-
}
|
|
15
|
-
export interface ExternalSettingsOpenSubmenuItem {
|
|
16
|
-
label: string;
|
|
17
|
-
selected?: boolean;
|
|
18
|
-
submenuId: SubMenuId;
|
|
19
|
-
description?: string;
|
|
20
|
-
}
|
|
21
|
-
type NoArgsKeys = { [K in keyof ExternalSettingsMenuController]: Parameters<ExternalSettingsMenuController[K]> extends [] ? K : never }[keyof ExternalSettingsMenuController];
|
|
22
|
-
type WithArgsKeys = Exclude<keyof ExternalSettingsMenuController, NoArgsKeys>;
|
|
23
|
-
type Base = {
|
|
24
|
-
description?: string;
|
|
25
|
-
label: string;
|
|
26
|
-
selected?: boolean;
|
|
27
|
-
};
|
|
28
|
-
export type ExternalSettingsActionItem = { [K in NoArgsKeys]: Base & {
|
|
29
|
-
method: K;
|
|
30
|
-
args?: never;
|
|
31
|
-
} }[NoArgsKeys] | { [K in WithArgsKeys]: Base & {
|
|
32
|
-
method: K;
|
|
33
|
-
args: Parameters<ExternalSettingsMenuController[K]>;
|
|
34
|
-
} }[WithArgsKeys];
|
|
35
|
-
export interface ExternalSettingsMenuHeader {
|
|
36
|
-
text: string;
|
|
37
|
-
interpolate?: {
|
|
38
|
-
key: string;
|
|
39
|
-
action: ExternalSettingsOpenSubmenuItem | ExternalSettingsActionItem;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
export type ExternalSettingsMenuItem = ExternalSettingsOpenSubmenuItem | ExternalSettingsActionItem;
|
|
43
|
-
export type ExternalSettingsSubMenu = {
|
|
44
|
-
id: string;
|
|
45
|
-
header?: ExternalSettingsMenuHeader;
|
|
46
|
-
items: ExternalSettingsMenuItem[];
|
|
47
|
-
parentId?: SubMenuId;
|
|
48
|
-
};
|
|
49
|
-
export interface ExternalSettingsMenuParams {
|
|
50
|
-
items: ExternalSettingsMenuItem[];
|
|
51
|
-
submenus: ExternalSettingsSubMenu[];
|
|
52
|
-
supportLink: string;
|
|
53
|
-
controller: ExternalSettingsMenuController;
|
|
54
|
-
}
|
|
55
|
-
export {};
|