interface OmConfiguration {
    /**
     * Partner name string.
     * Defaults to null
     */
    partnerName: string | null;
    /**
     * Partner version string in a semver format.
     * Defaults to null
     */
    partnerVersion: string | null;
    /**
     * Preferred access mode string.
     * As of October 2021, the creative access mode is translated to full by the OM manager,
     * per session client requirements, and will appear
     * as full in the OM ad session call data.
     * Defaults to 'limited'
     */
    accessMode: 'limited' | 'domain' | 'creative' | 'full';
}
interface SsaiConfiguration {
    /**
     * If true, the countdown timer and Learn More click through overlays will not be shown while ads are playing.
     * Defaults to `false`
     */
    hideOverlays: boolean;
    /**
     * The number of milliseconds after which an XHR to fetch a VMAP will time out.
     * Defaults to `45000`
     */
    timeout: number;
    /**
     * If true, request the video source with HLS discontinuities or DASH multiperiod.
     * Only valid for VOD SSAI.
     * Defaults to `true`
     */
    enableDiscontinuities: boolean;
    /**
     * If true (and the necessary Open Measurement SDK scripts are embedded),
     * the plugin will use values from the omParams object to start an OM manager
     * and create a new OM session client.
     * Defaults to `false`
     */
    enableOm: boolean;
    /**
     * An object describing the required parameters for starting an
     * Open Measurement session client and OM ad features.
     */
    omParams: OmConfiguration;
    /**
     * An object containing the parameters for replacing arbitrary values in the VMAP source URL.
     * See: {@link https://apis.support.brightcove.com/ssai/getting-started/video-cloud-ssai-ad-config-api.html#URL_variables}
     * Object keys can have any name. The name of this variable must match
     * the VMAP source URL param string or else it will not be replaced.
     * Defaults to an empty object
     */
    vmapURLParams: object;
}

/**
 * A plain object representing metadata for a single tracking event.
 */
interface AdTrackingEvent {
    ids: Array<string>;
    limit: number;
    time: number;
    urls: Array<string>;
}
/**
 * A plain object representing all {@link AdTrackingEvent} objects for a linear ad's
 * primary creative.
 */
interface LinearAdTrackingEvents {
    creativeView: AdTrackingEvent;
    start: AdTrackingEvent;
    firstQuartile: AdTrackingEvent;
    midpoint: AdTrackingEvent;
    thirdQuartile: AdTrackingEvent;
    complete: AdTrackingEvent;
    mute: AdTrackingEvent;
    unmute: AdTrackingEvent;
    pause: AdTrackingEvent;
    rewind: AdTrackingEvent;
    resume: AdTrackingEvent;
    fullscreen: AdTrackingEvent;
    exitFullscreen: AdTrackingEvent;
    expand: AdTrackingEvent;
    collapse: AdTrackingEvent;
    acceptInvitationLinear: AdTrackingEvent;
    closeLinear: AdTrackingEvent;
    skip: AdTrackingEvent;
    progress: AdTrackingEvent;
    click: AdTrackingEvent;
}
/**
 * A plain object representing all {@link AdTrackingEvent} objects for a linear ad's
 * companion creatives.
 */
interface CompanionAdTrackingEvents {
    creativeView: AdTrackingEvent;
    click: AdTrackingEvent;
}
/**
 * Represents a single linear ad, synonymous with a VAST `Ad` element with a
 * single `Linear` creative. It may include any number of companion creatives,
 * as well.
 *
 * A linear ad is always contained within a linear
 * ad roll (represented by
 * {@link LinearAdRoll}).
 */
interface LinearAd {
    adSystem(): string;
    adTitle(): string;
    advertiser(): string;
    description(): string;
    error(): string;
    adParameters(): string;
    absoluteEndTime(): number;
    absoluteStartTime(): number;
    ad(): Record<string, unknown>;
    clickThroughUrl(): string;
    companions(): Array<Record<string, unknown>>;
    primaryCreative(): Record<string, unknown>;
    duration(): number;
    skipOffset(): number;
    trackingEvents(): LinearAdTrackingEvents;
    companionTrackingEvents(): CompanionAdTrackingEvents;
    isSlate(): boolean;
    isPending(): boolean;
    update(ad: Record<string, unknown>): LinearAd;
    populate(ad: Record<string, unknown>): void;
    updateTiming(time: number): void;
}
/**
 * Represents a single block of one or more ads that plays at a specific time
 * in a specific order.
 *
 * This is also referred to (elsewhere) as an ad pod.
 */
interface LinearAdRoll {
    updateTimimg(): void;
    get(i: number): LinearAd;
    indexOf(ad: LinearAd): number;
    length(): number;
    first(): LinearAd | null;
    last(): LinearAd | null;
    isPreRoll(): boolean;
    isMidRoll(): boolean;
    isPostRoll(): boolean;
    update(adBreaks: Array<Record<string, unknown>>, adIndex: number): LinearAd;
    clientOptions(ops: Record<string, unknown>): Record<string, unknown>;
    absoluteStartTime(): number;
    absoluteEndTime(): number;
    duration(): number;
    startTimeOffset(): number;
    timeOffset(): number;
    type(): number;
    linearAds(): Array<LinearAd>;
}
/**
 * A timeline state object is an object with a specific interface that
 * details the playback state of an SSAI stream at any point in the absolute
 * timeline.
 *
 * The "absolute time" refers to a point in the complete timeline of a stream
 * (with both ads and content included). The term "content time" refers to the
 * time relative to the current content (either ad or content).
 */
interface TimelineState {
    /**
     * The absolute time in the stream.
     */
    absoluteTime: number;
    /**
     * The absolute duration of the stream.
     */
    absoluteDuration: number;
    /**
     * The time in the stream relative either to the current linear ad or
     * to the content itself.
     */
    relativeTime: number;
    /**
     * The duration of the current linear ad or the content itself.
     */
    relativeDuration: number;
    linearAdRoll: LinearAdRoll | null;
    linearAd: LinearAd | null;
}
interface SsaiIntegration {
    /**
     * Seek to any point in a linear ad or content, whichever is currently playing.
     */
    seekInRelativeTime(t: number, preventAdSkips?: boolean): void;
    /**
     * Get the duration of a linear ad or content, whichever is currently playing.
     */
    getRelativeDuration(): number;
    /**
     * Get the current LinearAd.
     */
    getCurrentLinearAd(): LinearAd | null;
    /**
     * Get the TimelineState object relative to the current linear ad or content.
     */
    getRelativeTimelineState(): TimelineState | null;
    /** @internal */
    updateConfiguration(ssaiConfiguration: SsaiConfiguration, prev: SsaiConfiguration): void;
    /** @internal */
    dispose(): void;
}

type SsaiIntegrationFactory = new (...args: Array<unknown>) => SsaiIntegration;

export type { SsaiIntegrationFactory };
