interface ImaClientSideConfiguration {
    /**
     * The URL of the IMA3 SDK.
     * Defaults to `'${protocol}//imasdk.googleapis.com/js/sdkloader/ima3.js'`.
     */
    sdkUrl: string;
    /**
     * The URL of the ad server to make requests to during playback.
     * Defaults to `'${protocol}//pubads.g.doubleclick.net/gampad/ads?sz=400x300&iu=%2F6062%2Fiab_vast_samples&ciu_szs=300x250%2C728x90&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&correlator=[timestamp]&cust_params=iab_vast_samples%3Dlinear'`.
     */
    serverUrl: string;
    /**
     * When to request ads: during player load ('onload'), during playback ('onplay'),
     * ondemand ('ondemand'), cuechange ('oncue').
     * Defaults to `'onload'`.
     */
    requestMode: 'onload' | 'onplay' | 'ondemand' | 'oncue';
    /**
     * Abandon ads that finish loading after they have timed out.
     * Defaults to `true`.
     */
    hardTimeouts: boolean;
    /**
     * Show Brightcove player custom controls for VPAID ads. They may or may not work.
     * Defaults to `false`.
     */
    showVpaidControls: boolean;
    /**
     * Specifies the alternative video ad click element. Leave this undefined to let the IMA SDK handle clicks.
     * More details are available in the parameter documentation for the IMA SDK `AdDisplayContainer`.
     * Defaults to `undefined`.
     */
    clickTrackingElement: HTMLElement | undefined;
    /**
     * Controls postrollTimeout setting in videojs-contrib-ads. If provided, overrides any value set for timeout.
     * Default Value: same as timeout.
     */
    postRollTimeout: number;
    /**
     * Controls prerollTimeout setting in videojs-contrib-ads. If provided, overrides any value set for timeout.
     * Default Value: same as timeout.
     */
    preRollTimeout: number;
    /**
     * Enables Video Cloud ad cue points being used to trigger ads.
     * Default Value: `false`.
     */
    useMediaCuePoints: boolean;
    /**
     * Specify VPAID 2 mode in the IMA HTML5 SDK. If none is provided, uses the SDK's default, which is currently ENABLED.
     * Default Value: `undefined`.
     */
    vpaidMode: string;
}

declare enum CompanionBackfillMode {
    ALWAYS = "ALWAYS",
    ON_MASTER_AD = "ON_MASTER_AD"
}
declare enum VpaidMode {
    DISABLED = "DISABLED",
    ENABLED = "ENABLED",
    INSECURE = "INSECURE"
}
declare enum ViewMode {
    NORMAL = "NORMAL",
    FULLSCREEN = "FULLSCREEN",
    THUMBNAIL = "THUMBNAIL"
}
declare enum CreativeType {
    IMAGE = "IMAGE",
    FLASH = "FLASH",
    ALL = "ALL"
}
declare enum ResourceType {
    HTML = "HTML",
    IFRAME = "IFRAME",
    STATIC = "STATIC",
    ALL = "ALL"
}
declare enum SizeCriteria {
    IGNORE = "IGNORE",
    SELECT_EXACT_MATCH = "SELECT_EXACT_MATCH",
    SELECT_NEAR_MATCH = "SELECT_NEAR_MATCH",
    SELECT_FLUID = "SELECT_FLUID"
}
/**
 * See: {@link https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.ImaSdkSettings}
 */
interface ImaSdkSettings {
    getCompanionBackfill(): CompanionBackfillMode;
    getDisableCustomPlaybackForIOS10Plus(): boolean;
    getFeatureFlags(): Record<string, unknown>;
    getLocale(): string;
    getNumRedirects(): number;
    getPlayerType(): string;
    getPlayerVersion(): string;
    getPpid(): string | null;
    isCookiesEnabled(): boolean;
    setAutoPlayAdBreaks(autoPlayAdBreaks: boolean): void;
    setCompanionBackfill(mode: CompanionBackfillMode): void;
    setCookiesEnabled(cookiesEnabled: boolean): void;
    setDisableCustomPlaybackForIOS10Plus(disable: boolean): void;
    setFeatureFlags(featureFlags: Record<string, unknown>): void;
    setLocale(locale: string): void;
    setNumRedirects(numRedirects: number): void;
    setPlayerType(playerType: string): void;
    setPlayerVersion(playerVersion: string): void;
    setPpid(ppid: string): void;
    setSessionId(sessionId: string): void;
    setVpaidAllowed(allowVpaid: boolean): void;
    setVpaidMode(vpaidMode: VpaidMode): void;
}
/**
 * See: {@link https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdsRequest}
 */
interface AdsRequest {
    adTagUrl: string;
    adsResponse?: string | Document | null;
    contentDuration?: number | null;
    contentKeywords?: Array<string> | null;
    contentTitle?: string | null;
    forceNonLinearFullSlot: boolean;
    linearAdSlotWidth: number;
    linearAdSlotHeight: number;
    liveStreamPrefetchSeconds: number;
    nonLinearAdSlotWidth: number;
    nonLinearAdSlotHeight: number;
    omidAccessModeRules: Record<string, string>;
    pageUrl?: string | null;
    vastLoadTimeout?: number;
    setAdWillAutoPlay(autoPlay: boolean): void;
    setAdWillPlayMuted(muted: boolean): void;
    setContinuousPlayback(continuousPlayback: boolean): void;
}
/**
 * See: {@link https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdsRenderingSettings}
 */
interface AdsRenderingSettings {
    autoAlign?: boolean;
    bitrate?: number;
    enablePreloading?: boolean;
    loadVideoTimeout?: number;
    mimeTypes?: Array<string> | null;
    playAdsAfterTime?: number;
    restoreCustomPlaybackStateOnAdBreakComplete?: boolean;
    uiElements?: Array<string> | null;
    useStyledLinearAds?: boolean;
    useStyledNonLinearAds?: boolean;
}
/**
 * See: {@link https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdPodInfo}
 */
interface AdPodInfo {
    getAdPosition(): number;
    getIsBumper(): boolean;
    getMaxDuration(): number;
    getPodIndex(): number;
    getTimeOffset(): number;
    getTotalAds(): number;
}
/**
 * See: {@link https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.CompanionAdSelectionSettings}
 */
interface CompanionAdSelectionSettings {
    adSlotIds: Array<string>;
    creativeType: CreativeType;
    nearMatchPercent: number;
    resourceType: ResourceType;
    sizeCriteria: SizeCriteria;
}
/**
 * See: {@link https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.CompanionAd}
 */
interface CompanionAd {
    getAdSlotId(): string | null;
    getContent(): string;
    getContentType(): string | null;
    getHeight(): number;
    getWidth(): number;
}
/**
 * See: {@link https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.UniversalAdIdInfo}
 */
interface UniversalAdIdInfo {
    getAdIdRegistry(): string;
    getAdIdValue(): string;
}
/**
 * See: {@link https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdDisplayContainer}
 */
interface AdDisplayContainer {
    destroy(): void;
    initialize(): void;
}
/**
 * See: {@link https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdsLoader}
 */
interface AdsLoader {
    contentComplete(): void;
    destroy(): void;
    getSettings(): ImaSdkSettings;
    getVersion(): string;
    requestAds(adsRequest: AdsRequest, userRequestContext?: NonNullable<unknown>): void;
}
/**
 * See: {@link https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdsManager}
 */
interface AdsManager {
    collapse(): void;
    configureAdsManager(content: NonNullable<unknown>, adsRenderingSettings?: AdsRenderingSettings): void;
    destroy(): void;
    discardAdBreak(): void;
    expand(): void;
    focus(): void;
    getAdSkippableState(): boolean;
    getCuePoints(): Array<number>;
    getRemainingTime(): number;
    getVolume(): number;
    init(width: number, height: number, viewMode: ViewMode, videoElement?: HTMLVideoElement): void;
    isCustomClickTrackingUsed(): boolean;
    isCustomPlaybackUsed(): boolean;
    pause(): void;
    resize(width: number, height: number, viewMode: ViewMode): void;
    resume(): void;
    setVolume(volume: number): void;
    skip(): void;
    start(): void;
    stop(): void;
    updateAdsRenderingSettings(adsRenderingSettings: AdsRenderingSettings): void;
}
/**
 * See: {@link https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.Ad}
 */
interface Ad {
    getAdId(): string;
    getAdPodInfo(): AdPodInfo;
    getAdSystem(): string;
    getAdvertiserName(): string;
    getApiFramework(): string | null;
    getCompanionAds(width: number, height: number, settings?: CompanionAdSelectionSettings): Array<CompanionAd>;
    getContentType(): string;
    getCreativeAdId(): string;
    getCreativeId(): string;
    getDealId(): string;
    getDescription(): string;
    getDuration(): number;
    getHeight(): number;
    getMediaUrl(): string | null;
    getMinSuggestedDuration(): number;
    getSkipTimeOffset(): number;
    getSurveyUrl(): string | null;
    getTitle(): string;
    getTraffickingParameters(): Record<string, string>;
    getTraffickingParametersString(): string;
    getUiElements(): Array<string>;
    getUniversalAdIdRegistry(): string;
    getUniversalAdIdValue(): string;
    getUniversalAdIds(): Array<UniversalAdIdInfo>;
    getVastMediaBitrate(): number;
    getVastMediaHeight(): number;
    getVastMediaWidth(): number;
    getWidth(): number;
    getWrapperAdIds(): Array<string>;
    getWrapperAdSystems(): Array<string>;
    getWrapperCreativeIds(): Array<string>;
    isLinear(): boolean;
}
interface ImaClientSideIntegration {
    /**
     * Get the active AdDisplayContainer instance
     */
    adDisplayContainer(): AdDisplayContainer | null;
    /**
     * Replace macro variables in a provided url. For list of supported macros, please see:
     * {@link https://player.support.brightcove.com/plugins/advertising-ima3-plugin.html#Ad_macros_and_the_serverUrl}
     */
    adMacroReplacement(url: string): string;
    /**
     * Get the active AdsLoader instance
     */
    adsLoader(): AdsLoader | null;
    /**
     * Get the active AdsManager instance
     */
    adsManager(): AdsManager | null;
    /**
     * Request an ad
     */
    adRequest(adRequestUrl: string): void;
    /**
     * Get the active Ad instance
     */
    currentAd(): Ad | null;
    /**
     * Get whether the current ad is a VPAID ad
     */
    isVpaid(): boolean;
    /**
     * Set various parameters that control the rendering of ads.
     */
    setAdsRenderingSettings(adsRenderingSettings: AdsRenderingSettings): void;
    /** @internal */
    updateConfiguration(imaClientSideConfiguration: ImaClientSideConfiguration, prev: ImaClientSideConfiguration): void;
    /** @internal */
    dispose(): void;
}

type ImaClientSideIntegrationFactory = new (...args: Array<unknown>) => ImaClientSideIntegration;

export type { ImaClientSideIntegrationFactory };
