import type { ErrorCode, HttpRequestType, ModuleName, PlayerEvent, ViewMode, WarningCode } from '../enums/PlayerExports';
import type { Ad, AdBreak, AdConfig } from './AdvertisingConfig';
import type { SubtitleTrack } from './PlayerConfig';
import type { AudioQuality, AudioTrack, PlayerEventBase, Quality, VideoQuality } from './Types';
export interface UserInteractionEvent extends PlayerEventBase {
    issuer?: string;
}
export interface PlaybackEvent extends PlayerEventBase, UserInteractionEvent {
    time: number;
}
export interface SeekEvent extends UserInteractionEvent {
    position: number;
    seekTarget: number;
}
export interface TimeShiftEvent extends UserInteractionEvent {
    position: number;
    target: number;
}
export interface VolumeChangedEvent extends UserInteractionEvent {
    sourceVolume: number;
    targetVolume: number;
}
export interface PlayerResizedEvent extends PlayerEventBase {
    width: string;
    height: string;
}
export interface ErrorEvent extends PlayerEventBase {
    code: ErrorCode;
    name: string;
    message?: string;
    data?: {
        [key: string]: any;
    };
    sourceIdentifier?: string;
    troubleShootLink: string;
}
export interface WarningEvent extends PlayerEventBase {
    code: WarningCode;
    name: string;
    message: string;
    data: {
        [key: string]: any;
    };
}
export interface AudioChangedEvent extends PlaybackEvent {
    sourceAudio: AudioTrack | null;
    targetAudio: AudioTrack;
}
export interface AirplayChangedEvent extends PlaybackEvent {
    airplayEnabled: boolean;
}
export interface AudioTrackEvent extends PlaybackEvent {
    track: AudioTrack;
}
export interface MediaQualityChangeEvent<Q extends Quality> extends PlayerEventBase {
    sourceQuality?: Q | null;
    sourceQualityId: string | null;
    targetQuality?: Q;
    targetQualityId: string;
}
export interface DrmKidErrorEvent extends PlayerEventBase {
    affectedKid: string;
}
export type VideoDownloadQualityChangeEvent = MediaQualityChangeEvent<VideoQuality>;
export type AudioDownloadQualityChangeEvent = MediaQualityChangeEvent<AudioQuality>;
export type VideoDownloadQualityChangedEvent = MediaQualityChangeEvent<VideoQuality>;
export type AudioDownloadQualityChangedEvent = MediaQualityChangeEvent<AudioQuality>;
export interface MediaPlaybackQualityChangeEvent<Q extends Quality> extends PlayerEventBase {
    sourceQuality: Q;
    targetQuality: Q;
}
export type VideoPlaybackQualityChangedEvent = MediaPlaybackQualityChangeEvent<VideoQuality>;
export type AudioPlaybackQualityChangedEvent = MediaPlaybackQualityChangeEvent<AudioQuality>;
export type VideoQualityChangedEvent = MediaQualityChangeEvent<VideoQuality>;
export type AudioQualityChangedEvent = MediaQualityChangeEvent<AudioQuality>;
export interface TimeChangedEvent extends PlaybackEvent {
    relativeTime?: number;
}
export interface SegmentPlaybackEvent extends PlayerEventBase {
    url: string;
    uid: string;
    mimeType: string;
    playbackTime: number;
    wallClockTime: number;
    presentationTimestamp: number;
    duration: number;
    mediaInfo: {
        bitrate?: number;
        sampleRate?: number;
        frameRate?: number;
        width?: number;
        height?: number;
    };
    dateTime?: string;
    representationId: string;
    discontinuitySequenceNumber?: number;
    EXPERIMENTAL?: {
        hlsAttributes?: string[];
    };
}
export interface DurationChangedEvent extends PlayerEventBase {
    from: number;
    to: number;
}
export interface PlaybackSpeedChangedEvent extends PlayerEventBase {
    from: number;
    to: number;
}
export interface PeriodSwitchObject {
    periodId: string;
}
export interface PeriodSwitchedEvent extends PlayerEventBase {
    sourcePeriod: PeriodSwitchObject;
    targetPeriod: PeriodSwitchObject;
}
export declare enum MetadataType {
    CUETAG = "CUETAG",
    DATERANGE = "DATERANGE",
    EVENT_STREAM = "EVENT-STREAM",
    CUSTOM = "CUSTOM",
    SCTE = "SCTE",
    ID3 = "ID3",
    EMSG = "EMSG",
    CAST = "CAST"
}
export interface MetadataEvent extends PlayerEventBase {
    metadataType: MetadataType;
    metadata: object;
    start?: number;
    end?: number;
}
export type MetadataChangedEvent = MetadataEvent;
export interface MetadataParsedEvent extends MetadataEvent {
    data: object;
    periodId?: string;
}
export interface AdaptationEvent extends PlayerEventBase {
    representationID: string;
}
export type VideoAdaptationEvent = AdaptationEvent;
export type AudioAdaptationEvent = AdaptationEvent;
export interface DownloadFinishedEvent extends PlayerEventBase {
    httpStatus: number;
    success: boolean;
    url: string;
    downloadTime: number;
    size: number;
    attempt: number;
    maxAttempts: number;
    downloadType: HttpRequestType;
    timeToFirstByte: number;
    mimeType: string;
}
export interface SegmentRequestFinishedEvent extends PlayerEventBase {
    httpStatus: number;
    success: boolean;
    downloadTime: number;
    size: number;
    duration: number;
    mimeType: string;
    uid: string;
    isInit: boolean;
}
export interface DownloadTiming {
    downloadTime: number;
    timeToFirstByte?: number;
}
export interface AdBreakEvent extends PlayerEventBase {
    adBreak: AdBreak;
}
export interface AdManifestLoadedEvent extends AdBreakEvent {
    adConfig: AdConfig;
    downloadTiming: DownloadTiming;
}
export interface AdEvent extends PlayerEventBase {
    ad: Ad;
}
export declare enum AdQuartile {
    FIRST_QUARTILE = "firstQuartile",
    MIDPOINT = "midpoint",
    THIRD_QUARTILE = "thirdQuartile"
}
export interface AdQuartileEvent extends PlayerEventBase {
    quartile: AdQuartile;
}
export interface AdClickedEvent extends PlayerEventBase {
    clickThroughUrl: string;
}
export interface AdInteractionEvent extends PlayerEventBase {
    id?: string;
    interactionType: AdInteractionType;
}
export declare enum AdInteractionType {
    Vpaid = "vpaid"
}
export interface AdLinearityChangedEvent extends PlayerEventBase {
    isLinear: boolean;
}
export interface CastAvailableEvent extends PlayerEventBase {
    receiverAvailable: boolean;
}
export interface CastWaitingForDeviceEvent extends PlayerEventBase {
    castPayload: {
        currentTime: number;
        deviceName: string;
        timestamp: number;
        type: string;
    };
}
export interface CastStartedEvent extends PlayerEventBase {
    deviceName: string;
    resuming: boolean;
}
export interface SubtitleEvent extends PlayerEventBase {
    subtitle: SubtitleTrack;
}
export interface MediaQualityEvent<Q extends Quality> extends PlayerEventBase {
    quality: Q;
}
export type AudioQualityEvent = MediaQualityEvent<AudioQuality>;
export type VideoQualityEvent = MediaQualityEvent<VideoQuality>;
export interface VRStereoChangedEvent extends PlayerEventBase {
    stereo: boolean;
}
export interface ViewingDirection {
    yaw: number;
    pitch: number;
    roll: number;
}
export interface VRViewingDirectionChangeEvent extends PlayerEventBase {
    direction: ViewingDirection;
}
export type VRViewingDirectionChangedEvent = VRViewingDirectionChangeEvent;
export interface SubtitleCueEvent extends PlayerEventBase {
    subtitleId: string;
    start: number;
    end: number;
    text: string;
    html?: string;
    image?: string;
    region?: string;
    regionStyle?: string;
    position?: SubtitleCuePosition;
    vtt?: VTTProperties;
}
export interface VTTRegionProperties {
    id: string;
    width: number;
    lines: number;
    regionAnchorX: number;
    regionAnchorY: number;
    viewportAnchorX: number;
    viewportAnchorY: number;
    scroll: 'up' | '';
}
export interface VTTProperties {
    id?: string;
    region?: VTTRegionProperties;
    vertical: 'rl' | 'lr' | '';
    line: number | string;
    lineAlign: 'start' | 'center' | 'end';
    snapToLines: boolean;
    size: number;
    align: 'left' | 'start' | 'center' | 'middle' | 'end' | 'right';
    position: number | 'auto';
    positionAlign: 'line-left' | 'center' | 'line-right' | 'auto';
}
export interface SubtitleCuePosition {
    row: number;
    column: number;
}
export interface SubtitleCueParsedEvent extends SubtitleCueEvent {
    periodId: string;
}
export interface ViewModeChangedEvent extends PlayerEventBase {
    from: ViewMode;
    to: ViewMode;
    legacy: boolean;
}
export interface ModuleReadyEvent extends PlayerEventBase {
    name: ModuleName;
}
export interface TargetLatencyChangedEvent extends PlayerEventBase {
    from: number;
    to: number;
}
export declare enum LatencyMode {
    Idle = "idle",
    Catchup = "catchup",
    Fallback = "fallback",
    Suspended = "suspended"
}
export interface LatencyModeChangedEvent extends PlayerEventBase {
    from: LatencyMode;
    to: LatencyMode;
}
export interface LicenseValidatedEvent extends PlayerEventBase {
    data: {
        [key: string]: any;
    };
}
export interface DrmLicenseAddedEvent extends PlayerEventBase {
    license: DrmLicense;
}
export interface AspectRatioChangedEvent extends PlayerEventBase {
    from: number;
    to: number;
}
export interface NumberOfColorsChangedEvent extends PlayerEventBase {
    from: number;
    to: number;
}
export interface DrmLicense {
    id: string;
    keySystemString: string;
    keyIds: string[];
}
export type OptionalEventBaseProperties<EventData extends PlayerEventBase> = Pick<EventData, Exclude<keyof EventData, keyof PlayerEventBase>> & Partial<PlayerEventBase>;
export interface PlayerEventMap {
    [PlayerEvent.AdBreakFinished]: AdBreakEvent;
    [PlayerEvent.AdBreakStarted]: AdBreakEvent;
    [PlayerEvent.AdClicked]: AdClickedEvent;
    [PlayerEvent.AdError]: ErrorEvent;
    [PlayerEvent.AdFinished]: AdEvent;
    [PlayerEvent.AdInteraction]: AdInteractionEvent;
    [PlayerEvent.AdLinearityChanged]: AdLinearityChangedEvent;
    [PlayerEvent.AdManifestLoaded]: AdManifestLoadedEvent;
    [PlayerEvent.AdQuartile]: AdQuartileEvent;
    [PlayerEvent.AdSkipped]: AdEvent;
    [PlayerEvent.AdStarted]: AdEvent;
    [PlayerEvent.AirplayAvailable]: PlayerEventBase;
    [PlayerEvent.AirplayChanged]: AirplayChangedEvent;
    [PlayerEvent.AspectRatioChanged]: AspectRatioChangedEvent;
    [PlayerEvent.AudioAdaptation]: AudioAdaptationEvent;
    [PlayerEvent.AudioAdded]: AudioTrackEvent;
    [PlayerEvent.AudioChanged]: AudioChangedEvent;
    [PlayerEvent.AudioDownloadQualityChange]: AudioDownloadQualityChangeEvent;
    [PlayerEvent.AudioDownloadQualityChanged]: AudioDownloadQualityChangedEvent;
    [PlayerEvent.AudioPlaybackQualityChanged]: AudioPlaybackQualityChangedEvent;
    [PlayerEvent.AudioQualityAdded]: AudioQualityEvent;
    [PlayerEvent.AudioQualityChanged]: AudioQualityChangedEvent;
    [PlayerEvent.AudioQualityRemoved]: AudioQualityEvent;
    [PlayerEvent.AudioRemoved]: AudioTrackEvent;
    [PlayerEvent.CastAvailable]: CastAvailableEvent;
    [PlayerEvent.CastStart]: PlayerEventBase;
    [PlayerEvent.CastStarted]: CastStartedEvent;
    [PlayerEvent.CastStopped]: PlayerEventBase;
    [PlayerEvent.CastWaitingForDevice]: CastWaitingForDeviceEvent;
    [PlayerEvent.CueEnter]: SubtitleCueEvent;
    [PlayerEvent.CueExit]: SubtitleCueEvent;
    [PlayerEvent.CueParsed]: SubtitleCueParsedEvent;
    [PlayerEvent.CueUpdate]: SubtitleCueEvent;
    [PlayerEvent.DVRWindowExceeded]: PlayerEventBase;
    [PlayerEvent.Destroy]: PlayerEventBase;
    [PlayerEvent.DownloadFinished]: DownloadFinishedEvent;
    [PlayerEvent.DrmLicenseAdded]: DrmLicenseAddedEvent;
    [PlayerEvent.DurationChanged]: DurationChangedEvent;
    [PlayerEvent.Error]: ErrorEvent;
    [PlayerEvent.LatencyModeChanged]: LatencyModeChangedEvent;
    [PlayerEvent.LicenseValidated]: LicenseValidatedEvent;
    [PlayerEvent.Metadata]: MetadataEvent;
    [PlayerEvent.MetadataChanged]: MetadataChangedEvent;
    [PlayerEvent.MetadataParsed]: MetadataParsedEvent;
    [PlayerEvent.ModuleReady]: ModuleReadyEvent;
    [PlayerEvent.Muted]: UserInteractionEvent;
    [PlayerEvent.NumberOfColorsChanged]: NumberOfColorsChangedEvent;
    [PlayerEvent.OverlayAdStarted]: AdEvent;
    [PlayerEvent.Paused]: PlaybackEvent;
    [PlayerEvent.PeriodSwitch]: PlayerEventBase;
    [PlayerEvent.PeriodSwitched]: PeriodSwitchedEvent;
    [PlayerEvent.Play]: PlaybackEvent;
    [PlayerEvent.PlaybackFinished]: PlaybackEvent;
    [PlayerEvent.PlaybackSpeedChanged]: PlaybackSpeedChangedEvent;
    [PlayerEvent.PlayerResized]: PlayerResizedEvent;
    [PlayerEvent.Playing]: PlaybackEvent;
    [PlayerEvent.Ready]: PlayerEventBase;
    [PlayerEvent.Seek]: SeekEvent;
    [PlayerEvent.Seeked]: PlayerEventBase;
    [PlayerEvent.SegmentPlayback]: SegmentPlaybackEvent;
    [PlayerEvent.SegmentRequestFinished]: SegmentRequestFinishedEvent;
    [PlayerEvent.ShowAirplayTargetPicker]: PlayerEventBase;
    [PlayerEvent.SourceLoaded]: PlayerEventBase;
    [PlayerEvent.SourceUnloaded]: PlayerEventBase;
    [PlayerEvent.StallEnded]: PlayerEventBase;
    [PlayerEvent.StallStarted]: PlayerEventBase;
    [PlayerEvent.SubtitleAdded]: SubtitleEvent;
    [PlayerEvent.SubtitleDisable]: SubtitleEvent;
    [PlayerEvent.SubtitleDisabled]: SubtitleEvent;
    [PlayerEvent.SubtitleEnable]: SubtitleEvent;
    [PlayerEvent.SubtitleEnabled]: SubtitleEvent;
    [PlayerEvent.SubtitleRemoved]: SubtitleEvent;
    [PlayerEvent.TargetLatencyChanged]: TargetLatencyChangedEvent;
    [PlayerEvent.TimeChanged]: PlaybackEvent;
    [PlayerEvent.TimeShift]: TimeShiftEvent;
    [PlayerEvent.TimeShifted]: TimeShiftEvent;
    [PlayerEvent.Unmuted]: UserInteractionEvent;
    [PlayerEvent.VRStereoChanged]: VRStereoChangedEvent;
    [PlayerEvent.VRViewingDirectionChange]: VRViewingDirectionChangeEvent;
    [PlayerEvent.VRViewingDirectionChanged]: VRViewingDirectionChangedEvent;
    [PlayerEvent.VideoAdaptation]: VideoAdaptationEvent;
    [PlayerEvent.VideoDownloadQualityChange]: VideoDownloadQualityChangeEvent;
    [PlayerEvent.VideoDownloadQualityChanged]: VideoDownloadQualityChangedEvent;
    [PlayerEvent.VideoPlaybackQualityChanged]: VideoPlaybackQualityChangedEvent;
    [PlayerEvent.VideoQualityAdded]: VideoQualityEvent;
    [PlayerEvent.VideoQualityChanged]: VideoQualityChangedEvent;
    [PlayerEvent.VideoQualityRemoved]: VideoQualityEvent;
    [PlayerEvent.ViewModeChanged]: ViewModeChangedEvent;
    [PlayerEvent.VolumeChanged]: VolumeChangedEvent;
    [PlayerEvent.Warning]: WarningEvent;
}
