import type { EventBus } from '../../event-bus/Types';
import type { AdExtension } from '../base/AdExtension';
import type { AdIconHorizontalPosition, AdIconVerticalPosition } from '../base/AdIconPosition';
import type { AdResource } from '../base/AdResource';
import type { AdType } from '../base/AdType';
import type { BaseAdPodState } from '../base/BaseAdPodState';
import type { BaseAdState } from '../base/BaseAdState';
import type { AdvertisingEventMap } from './AdvertisingEvents';
export type AdTagConfig = {
    type: AdType;
    url: string;
};
export type PreloadConfig = {
    adManifestPreloadOffset?: number;
    adSourcePreloadOffset?: number;
};
export type AdConfig = {
    id?: string;
    tag: AdTagConfig;
    position?: number | string;
    preloadConfig?: PreloadConfig;
};
export type ClickThrough = {
    readonly url: string;
    reportClicked(): void;
};
export type CompanionAd = {
    readonly id: string;
    readonly width: number;
    readonly height: number;
    readonly resource: AdResource;
    readonly altText?: string;
    readonly clickThrough?: ClickThrough;
    reportShown(): void;
};
export type AdIcon = {
    readonly program: string;
    readonly width: number;
    readonly height: number;
    readonly xPosition: number | AdIconHorizontalPosition;
    readonly yPosition: number | AdIconVerticalPosition;
    readonly offset?: number;
    readonly duration?: number;
    readonly resource: AdResource;
    readonly clickThrough?: ClickThrough;
};
type AdBase = {
    readonly id: string;
    readonly externalAdId: string;
    readonly skipDelay: number;
    readonly state: BaseAdState;
    readonly position: number;
    readonly isLinear: boolean;
    readonly error?: Error;
    readonly clickThrough?: ClickThrough;
    readonly companions: readonly CompanionAd[];
    readonly icons: readonly AdIcon[];
    readonly extensions: readonly AdExtension[];
    readonly canPause: boolean;
    readonly canSkip: boolean;
    readonly canSetVolume: boolean;
    readonly canExpand: boolean;
    readonly hasTimeline: boolean;
};
type CanPause = {
    readonly canPause: true;
    readonly paused: boolean;
    play(): void;
    pause(): void;
};
type CannotPause = {
    readonly canPause: false;
};
type CanSkip = {
    readonly canSkip: true;
    skip(): void;
};
type CannotSkip = {
    readonly canSkip: false;
};
type CanSetVolume = {
    readonly canSetVolume: true;
    volume: number;
};
type CannotSetVolume = {
    readonly canSetVolume: false;
};
type CanExpand = {
    readonly canExpand: true;
    expanded: boolean;
};
type CannotExpand = {
    readonly canExpand: false;
};
type HasTimeline = {
    readonly hasTimeline: true;
    readonly duration: number;
    readonly currentTime: number;
};
type NoTimeline = {
    readonly hasTimeline: false;
};
export type Ad = AdBase & (CanPause | CannotPause) & (CanSkip | CannotSkip) & (CanSetVolume | CannotSetVolume) & (CanExpand | CannotExpand) & (HasTimeline | NoTimeline);
export type PausableAd = Ad & CanPause;
export type SkippableAd = Ad & CanSkip;
export type VolumeControllableAd = Ad & CanSetVolume;
export type ExpandableAd = Ad & CanExpand;
export type TimedAd = Ad & HasTimeline;
export type AdPod = {
    readonly id: string;
    readonly position: number;
    readonly ads: Ad[];
    readonly state: BaseAdPodState;
};
export declare enum AdBreakState {
    Scheduled = "scheduled",
    Playing = "playing",
    Error = "error",
    Completed = "completed"
}
export type AdBreak = {
    readonly id: string;
    readonly position: number;
    readonly state: AdBreakState;
    readonly adPods: AdPod[];
};
export type ContentSourceAdvertisingApi = {
    readonly isAd: false;
    readonly isLinearAdActive: boolean;
    schedule(config: AdConfig): AdPod;
    discard(adPodOrAdBreak: AdPod | AdBreak): void;
    list(): AdBreak[];
    getActiveAdBreak(): AdBreak | undefined;
    getActiveAdPod(): AdPod | undefined;
    getActiveAd(): Ad | undefined;
};
type AdSourceAdvertisingApiBase = {
    readonly isAd: true;
    readonly skipDelay: number;
    readonly id: string;
    readonly externalAdId: string;
};
export type AdSourceAdvertisingApi = AdSourceAdvertisingApiBase & (CanSkip | CannotSkip);
export type AdvertisingApi = {
    ads: ContentSourceAdvertisingApi | AdSourceAdvertisingApi;
    events: EventBus<AdvertisingEventMap>;
};
export {};
