UNPKG

@swrve/smarttv-sdk

Version:

Swrve marketing engagement platform SDK for SmartTV OTT devices

60 lines (59 loc) 2.39 kB
import { ISwrveButton, ISwrveCampaign, ISwrveMessage } from "../ISwrveCampaign"; import { IPlatform } from "../../utils/platforms/IPlatform"; import { ISwrveInternalConfig } from "../../Config/ISwrveInternalConfig"; import IDictionary from "../../utils/IDictionary"; import { ResourceManager } from "../../Resources/ResourceManager"; export declare type OnBackButtonClicked = () => void; export declare type OnButtonClicked = (button: ISwrveButton, parentCampaign: ISwrveCampaign, pageId: string, pageName: string) => void; export declare type OnPageViewed = (messageId: number, pageId: number, pageName: string) => void; export declare class SwrveMessageDisplayManager { private screenCenterWidth; private screenCenterHeight; private onBackButtonClickedCallback; private onButtonClickedCallback; private onPageViewedCallback; private isOpen; private justClosed; private focusManager?; private resourceManager?; private normalStyle?; private focusStyle?; private overrideIAMStyle?; private keymap; private currentPageIndex; private currentMessagePages; private sentPageViewEvents; private sentNavigationEvents; private imagesCDN; private scale; private personalizationProperties?; constructor(platform: IPlatform, config?: ISwrveInternalConfig, resourceManager?: ResourceManager); showMessage(message: ISwrveMessage, parentCampaign: ISwrveCampaign, imagesCDN: string, platform: IPlatform, personalizationProperties?: IDictionary<string>): void; onPageViewed(callback: OnPageViewed): void; onButtonClicked(callback: OnButtonClicked): void; onBackButtonClicked(callback: OnBackButtonClicked): void; isIAMShowing(): boolean; getSentPageViewEvents(): number[]; getSentNavigationEvents(): number[]; closeMessage(): void; private onKeydown; private onKeyup; private initListener; private getLandscapeFormat; private createFocusManager; private applyElementStyle; private getFocusStyle; private sanitizeFocusStyle; private appendImages; private appendButtons; private addElement; private handleButton; private createContainer; private changePage; private renderPage; private renderContent; private getCurrentPageId; private getCurrentPageName; private personalizeButton; private personalizeText; }