import HlsJs from 'hls.js'; interface ITopNotifier { cleanCount(): void; } interface IWallInitProps { wall_oid?: number; public_link?: string; loc?: string; owner?: { id: number; name: string; photo: string; }; wall_tpl: { profileData: [profileId: number, photo: string, href: string, name: string]; ownerData: [ownerId: number, photo: string, href: string, name: string]; }; only_official?: boolean; } interface IWall { init: (props: IWallInitProps) => void; votingUpdateFull: (_: string, e: string) => void; initReplyEditable: (replyBox: HTMLElement, replyField: HTMLElement, postId: string) => void; showEditReply: ( postId: string, e?: unknown, o?: boolean, i?: boolean, focus?: boolean, onInited?: () => void, ) => void; [key: string | symbol]: any; } interface Iajax { enabled: boolean; post(url: string, obj: any, func?: any): any; promisifiedPost(url: string, obj: Record): Promise; [key: string | symbol]: any; } interface AudioPlayerAds { _isAllowed: (e: unknown) => { type: number; }; } interface IAudioPlayer { ads: AudioPlayerAds; getCurrentAudio: () => any[] | null; getCurrentAudioLs: () => any[] | null; setStatusExportInfo: (audio: any[] | null, isPaused?: boolean) => void; on: (unk1: any, type: "update" | any, callback: (event: any) => void) => () => void; play: () => void; pause: () => void; playPrev: () => void; playNext: () => void; isPlaying: () => boolean; toggleAudio: (audioNode: HTMLElement, event: Event) => void; _impl: { type: string; _currentAudioEl: { audioElement: HTMLAudioElement; }; }; playNextByButton: () => void; playPrevByButton: () => void; pauseByButton: () => void; playByButton: () => void; } interface IAudioPlayerUI { lyrics: { open: (v: { audio: any[] }) => unknown; modal: { open: (audio: any[]) => unknown; mount: (audio: any[]) => unknown; }; }; } interface AudioMainArtist { /** * Artist ID */ id?: string; /** * Artist name */ name: string; } interface AudioObject { hashes?: string; id: number; owner_id: number; ownerId: number; fullId: string; title: string; subTitle: string; performer: string; mainArtists: AudioMainArtist[] | string; featArtists: string; authorLink: string; duration: number; lyrics: 1 | 0; url: string; context: string; extra: string; accessKey: string; addHash: string; editHash: string; actionHash: string; deleteHash: string; replaceHash: string; urlHash: string; restoreHash: string; canEdit: boolean; canDelete: boolean; flags: number; isOriginalSound: boolean; hasLyrics: boolean; isLongPerformer: boolean; isClaimed: boolean; isFromQueue: boolean; isExplicit: boolean; isUMA: boolean; isReplaceable: boolean; canAdd: boolean; showInfo: boolean; coverUrl_s: string; coverUrl_p: string; coverUrl_l: string; hasTrackPage: boolean; trackPageId: string; ads: { duration: number; content_id: string; puid22: number; account_age_type: number; _SITEID: number; vk_id: number; ver: number; }; album: [number, number, string]; albumId: number; albumPart: number; trackCode: string; restrictionStatus: number; chartInfo: boolean; adminUrl: string; umaQueryUrl: string; [key: string]: any; } interface AudioLayer { _initSection?: string; _els?: { layerPlace: HTMLElement; topNotaBtn: HTMLElement; topNotaBtnGroup: HTMLElement; topPlayBtn: HTMLButtonElement; container?: HTMLElement; tooltip: { show: () => void; }; }; } interface IAudioUtils { onRowOver: (audioNode: HTMLElement, event: MouseEvent) => unknown; onRowOver_vkn: (audioNode: HTMLElement, event: MouseEvent) => unknown; audioTupleToAudioObject: (audio: any[] | null) => AudioObject | null; getLayer: () => AudioLayer; [key: string]: any; } interface MessageBoxObject { setControlsText: (html: string) => void; guid: number; boxLayoutNode: HTMLElement; bodyNode: HTMLElement; controlsTextNode: HTMLDivElement; titleWrap: { olddisplay: string; }; btns: { ok: HTMLButtonElement[]; cancel: HTMLButtonElement[]; }; preventHideLastWithCheck: boolean; setOptions: (params: { [key: string]: string | number }) => void; hide: () => void; show: () => void; showProgress: () => void; content: (html: string) => void; addButton: (title: string, callback: () => void) => void; updateBoxCoords: () => void; } interface IBoxQueue { _boxes: MessageBoxObject[]; curBox: number; count: () => number; hideAll: () => void; hideBGClick: () => void; hideLast: () => void; hideLastCheck: () => void; _hide: (boxId: number) => void; _show: (boxId: number) => void; } type ColorSchemeMode = "dark" | "light" | "auto"; interface IColorScheme { subscribe(callback: () => void): () => void; setScheme(isDark: boolean): void; currentMode: Mode; isExecuted: boolean; isModeSavingAllowed: boolean; isSchemeSavingAllowed: boolean; schemesMap: { bright_light: string; space_gray: string; }; currentIsDark: boolean; setMode(mode: Mode, isVkn?: boolean): void; applyScheme(element: HTMLElement, mode: "space_gray" | "vkcom_light"): void; } interface MVPlayer { type: string; author_id: number; vid: number; } type PVCurPhotoSizeArray = [string, number, number]; interface ICur { videoInlinePlayer: { container: HTMLElement; vars: MVPlayer; }; viewAsBox?: () => void; pid: number; oid: number; pvListId: string; pvIndex: number; pvShown: boolean; pvPhoto: HTMLDivElement; pvMoreActionsTooltip: { _opts: { delay: number; offset: number[]; type: number; id: string; cls: string; width: null | number; appendToParent: boolean; autoAdjustToViewport: boolean; autoShow: boolean; autoHide: boolean; noHideOnClick: boolean; arrowSize: string; customShow: boolean; align: string; withCloseButton: boolean; forceSide: string; elClassWhenShown: string; content: string; defaultSide: string; }; _arrowSize: number; _visTO: boolean; _sto: boolean; _hto: boolean; _reTimeout: boolean; _isShown: boolean; }; gftbxWasScroll?: number; pvCurPhoto?: { id: string; base: string; commcount: number; commshown: number; reply_form: string; reply_options: { rmedia_types: string[][]; }; date: string; tags: number[]; album: string; author: string; author_photo: string; author_href: string; shares: number; likes_tpl: string; rotate_hash: string; profile_data: { useNewForm: string; photo: string; }; peType: number; peHash: string; actions: { tag: 1 | 0; edit: 1 | 0; pe: boolean; place: boolean; del: 1 | 0; rotate: 1 | 0; comm: 1 | 0; share: boolean; prof: 1; move: boolean; cover: boolean; }; desc: string; hash: string; attached_tags: { max_tags_per_object: number; hash: string; }; x_src: string; x_: PVCurPhotoSizeArray; y_src: string; y_: PVCurPhotoSizeArray; z_src: string; z_: PVCurPhotoSizeArray; }; chooseMedia: (type: string, data: string, params: any) => void; editing: string; lastAddMedia: { menu?: { menuNode?: HTMLElement; }; chooseMedia: (type: string, attach: string, options: any) => void; checkURL: (url: string, maxCharacters: number, obj: object) => void; onChange: any; }; menuSettings: { [key: string]: { [key: string]: 1 | 0 } }; imClassicInterface: boolean; module: string; peer: number; gid: number; moreFrom?: string; storyLayer?: { activeStory: { authorImg: HTMLImageElement; contStickers: HTMLDivElement; curPreviewUrl: string; story: { data: { id: number; owner_id: number; raw_id: string; } & ({ type: "photo"; photo_url: string } | { type: "video"; video_url: string }); photo?: HTMLElement; video?: HTMLElement; }; data: { id: string; authorId: string; story: { raw_id: string; }; }; actionButtons: HTMLDivElement; }; stories: HTMLElement; }; pvBottomActions?: HTMLDivElement; owner?: { id: number; name: string; photo: string; }; lang?: Record; // vuv videoFilter_notsafe?: HTMLElement; searchText?: string; searchInputEl?: HTMLElement; // posting wall_tpl?: IWallInitProps["wall_tpl"]; _back?: { hide?: (() => void)[]; show?: (() => void)[]; }; options?: { post_hash?: string; wall_tpl?: IWallInitProps["wall_tpl"]; suggesting?: boolean; }; wallType?: string; postSent?: boolean; donutAttachesApproved?: boolean; pgStart?: unknown; wallPostCb: () => void; onWallSendPost?: () => void; } interface ElementTooltipOpts { align?: string; appendTo?: HTMLElement; appendToParent?: boolean; arrowSize?: string; autoAdjustToViewport?: boolean; autoHide?: boolean; autoShow?: boolean; bottomGap?: number; cls: string; content: HTMLElement; id: string; noHideOnClick?: boolean; show: () => void; } interface IElementTooltip { prototype: { updatePosition: () => void; _ttel: HTMLElement; _opts?: ElementTooltipOpts; show: () => void; }; } interface IVK { platform?: string; ads_rotate_interval: number; al: number; id: number; sex: 0 | 1 | 2; intnat: boolean; host: string; __domain: string; loginDomain: string; logoutUrl: string; lang: number; statsMeta: { platform: string; st: boolean; time: number; hash: string; reloadVersion: number; }; loaderNavSection: string; version: boolean; stDomains: number; stDomain: string; navDomain: string; navPostfix: string; wsTransport: string; stExcludedMasks: string[]; zero: boolean; contlen: number; loginscheme: "https" | "http"; navPrefix: string; dt: number; fs: number; ts: number; tz: number; vcost: number; time: number[]; sampleUser: number; spentLastSendTS: number; a11y: number; statusExportHash: string; audioAdsConfig: { enabled: boolean; sections: string[]; day_limit_reached: boolean; sign: string; }; longViewTestGroup: null; cma: number; lpConfig: { enabled: number; key: string; ts: number; url: string; lpstat: number; sseUrl: string; id: number; }; audioInlinePlayerTpl: string; pe: Record; isCallsDevEnv: boolean; started: number; balance: string; pvbig: number; body_class: string; isVideoStandalone?: boolean; } interface MeConvoMessage { kind: "Node"; item: { kind: "Normal"; cmid: number; randomId: number; peerId: number; authorId: number; chunks: { kind: string; text: string; }[]; isOut: bigint; isSilent: boolean; isImportant: boolean; isPlayed: boolean; isUnavailable: boolean; sentAt: number; isPinned: boolean; expireTTL?: number; }; } interface MEConvoMember { canKick: boolean; isMessageRequest: boolean; isRestrictedToWrite: boolean; joinDate: number; peerId: number; } interface MEConvo { push: { mode: string; }; acl?: { canChangeInfo: boolean; canChangeInviteLink: boolean; canChangePin: boolean; canInvite: boolean; canPromoteUsers: boolean; canSeeInviteLink: boolean; canModerate: boolean; canCopyChat: boolean; canCall: boolean; canUseMassMentions: boolean; canChangeServiceType: boolean; canChangeStyle: boolean; canSendReactions: boolean; }; peerId: number; ownerId: number; isCommunityChat: boolean; isDonut: boolean; members?: { count: number; members: Map; memberIds: Set; invitedIds: Set; incognitoMembers: Map; adminIds: Set; }; history: { confirmed: MeConvoMessage[]; }; unreadCount: number; unreadReactions: Map; } interface MEOrganiserFolder { unreadCount: number; unreadUnmutedCount: number; all: { peerIds: unknown; boundaryMinorId: null; hasMore: boolean; }; unread: { peerIds: unknown; boundaryMinorId: null; hasMore: boolean; }; hasSublist: boolean; type: "default"; id: number; name: string; } interface MEUserKind { imageStatus?: { name: string; images: { url: string; width: number; height: number; }[]; }; kind: "User"; id: number; firstName: string; firstNameGen: string; firstNameAcc: string; lastName: string; lastNameGen: string; lastNameAcc: string; screenName: string; photoId: number; isVerified: boolean; isBlacklisted: boolean; isBlacklistedByMe: boolean; isProfileClosed: boolean; isDeactivated: boolean; canCall: boolean; canChangeFriendship: boolean; canInviteToChats: boolean; canMessage: boolean; hasDefaultPhoto: boolean; followersCount: number; bdate: string; phone: string; photo?: { baseUrl?: string; photo50?: string; photo100?: string; photo200?: string; }; } interface MeChatKind { kind: "Chat"; id: number; title: string; hasDefaultPhoto: boolean; canCall: boolean; photo?: { baseUrl?: string; photo50?: string; photo100?: string; photo200?: string; }; } interface MEGroupKind { kind: "Group"; id: number; type: string; name: string; screenName: string; activity: string; memberCount: number; isDeactivated: boolean; isVerified: boolean; isClosed: boolean; canMessage: boolean; canChangeMembership: boolean; isBlacklistedByMe: boolean; site: string; adminLevel: number; photo?: { baseUrl?: string; photo50?: string; photo100?: string; photo200?: string; }; } interface METhemeStyle { id: string; appearanceId: string; backgroundId: string; title: string; sortId: number; updateTime: number; } interface MEContextState { VKCOMRightColumnConvos: { isVisible: boolean; }; videoMessageShapes: Map; themeStyles: Map; peers: Map; organisers: { filters: { all?: MEOrganiserFolder; }; folders?: MEOrganiserFolder[]; }; viewer: { id: number; settings: { themeStyleId: string; }; }; convos: Map; ownerId: number; } interface IMECommonContext { store: { getState(): MEContextState; featureFlags: { [feature: string]: boolean | number; }; dispatch: (event: any) => void; subscribe: (callback: (state: MEContextState) => void) => () => void; }; browserEnv: { lang: { use(key: string): string; }; api: { fetch(method: string, options: Record): Promise; }; vkIntegration?: boolean; }; engine: { fetchMaster(url: string, options: Record, signal: AbortSignal): Promise; [key: string]: any; }; [key: string]: any; } interface NavGoLoc { 0?: string; sel?: string; msgid?: number; section?: string; source?: string | number; cmid?: string; /** * модалки */ z?: string; /** * профиль в мессенджере */ rp?: string; /** * пост в модалке */ w?: string; } interface NavGoLocProps extends NavGoLoc { act?: string; z?: string; modal?: string; rp?: string; invite_link?: string; invite_chat_id?: string; chat?: string; } interface INav { removeNavigationStartListener: (callback: (locStr: string) => void) => void; subscribeOnModuleEvaluated: (callback: () => void, once?: boolean) => void; unsubscribeOnModuleEvaluated: (callback: () => void) => void; strLoc: string; toStr(string: NavGoLocProps): string; fromStr(string: string): NavGoLocProps; objLoc: NavGoLocProps; setLoc(loc: NavGoLocProps): void; go( loc: NavGoLoc | string, ev?: string | React.MouseEvent["nativeEvent"] | null | Event, opts?: Record, ): void; change: ( loc: NavGoLoc, ev?: string | React.MouseEvent["nativeEvent"] | null, opts?: Record, ) => void; onLocationChange: (handler: (locStr: string) => unknown) => () => void; addNavigationStartListener: (handler: (locStr: string) => unknown) => () => void; /** * Доступно только в mvk */ fv_link?: string; } interface IPhotoview { MIN_WIDTH: number; MIN_HEIGHT: number; PE_MIN_WIDTH: number; PE_MIN_HEIGHT: number; SIDE_COLUMN_WIDTH: number; SIDE_MIN_GAP: number; VERTICAL_MIN_GAP: number; BOTTOM_BAR_HEIGHT: number; SIDE_NAV_PANELS_MAX_WIDTH: number; SIDE_NAV_PANELS_MIN_WIDTH: number; LEFT_RIGHT_NAV_RATIO: number; blank: string; cacheSize: 3; allSizes: ["x", "y", "z", "w"]; PE_V1: number; PE_V2: number; PE_V3: number; doShow: () => void; show: (id?: string, index?: number) => void; [key: string]: any; } interface IUIActionsMenu { show(element: HTMLElement, idk?: unknown, options?: { delay?: number }): void; hide(element: HTMLElement, idk?: unknown, options?: { delay?: number }): void; keyToggle(element: HTMLElement | undefined, event: React.MouseEvent | Event): void; } interface IVideoInitializer { initPlayer: (videoBoxWrap: HTMLElement, type: string, players: MVPlayer[]) => unknown; vk: (videoBoxWrap: HTMLElement, player: MVPlayer) => unknown; unionPlayer: (videoBoxWrap: HTMLElement, player: MVPlayer) => unknown; } interface IVKApiLoginResponse { access_token: string; expires: number; logout_hash: string; user_id: number; } interface IVKApi { api( method: string, params: Record, m?: { grouping?: boolean; accessToken?: string; version?: string; appId?: string; }, signal?: { signal?: AbortSignal; }, ): Promise; login(method: string, params: Record): Promise; } interface IStories { show( id: string, data?: { fromEl?: HTMLElement; }, ): void; [key: string]: any; } declare global { var Hls: typeof HlsJs | undefined; var TopNotifier: ITopNotifier; var Wall: IWall; var ajax: Iajax; var ap: IAudioPlayer; var AudioPlayerUI: new (props?: unknown) => IAudioPlayerUI; var audioPlayerUI: IAudioPlayerUI; var AudioUtils: IAudioUtils; var boxQueue: IBoxQueue; var Calls: Record; var colorScheme: IColorScheme; var cur: ICur; var ElementTooltip: IElementTooltip; var vk: IVK; var getAudioPlayer: () => IAudioPlayer; var MECommonContext: IMECommonContext; var MECommunityCommonContext: IMECommonContext; var nav: INav; var Photoview: IPhotoview; var uiActionsMenu: IUIActionsMenu; var VideoInitializer: IVideoInitializer; var vkApi: IVKApi; var Stories: IStories; } export type { AudioLayer, AudioMainArtist, AudioObject, ColorSchemeMode, ElementTooltipOpts, IAudioPlayer, IAudioPlayerUI, IAudioUtils, IBoxQueue, IColorScheme, ICur, IElementTooltip, IMECommonContext, INav, IPhotoview, IStories, ITopNotifier, IUIActionsMenu, IVK, IVKApi, IVKApiLoginResponse, IVideoInitializer, IWall, IWallInitProps, Iajax, MEContextState, MEConvo, MEConvoMember, MEGroupKind, MEOrganiserFolder, METhemeStyle, MEUserKind, MVPlayer, MeChatKind, MeConvoMessage, MessageBoxObject, PVCurPhotoSizeArray };