import type { ApiManager } from '../../../../framework-types/api-manager/ApiManager';
import type { ContextHaving } from '../../../../framework-types/execution-context/Types';
import type { Constants, SubtitleFormatType } from '../../core/Constants';
import type { StreamTimelineAtom } from '../../core/state/stream-timeline/StreamTimelineMapAtom';
import type { CoreEffects, CoreExportNames, CoreStateAtoms } from '../../core/Types';
import type { CoreUtils } from '../../core/utils/Types';
import type { DataExportNames } from '../../data/Types';
import type { extendEventBusTypes } from '../../event-bus/EventBus';
import type { EventBase, EventBus, EventBusExportNames } from '../../event-bus/Types';
import type { SourceStateAtom } from '../../source/atoms/SourceStateAtom';
import type { SourceExportNames } from '../../source/Types';
import type { SourcesApiExportNames } from '../../sources-api/Types';
import type { StreamDataStructureSegments } from '../../stream-data-structure/segment/Exports';
import type { StreamDataStructureSelectionGroups } from '../../stream-data-structure/selection-group/Exports';
import type { StreamDataStructureTracks } from '../../stream-data-structure/track/Exports';
import type { StreamingState } from '../../streaming/Types';
import type { ContextWithState } from '../../Types';
import type { SubtitleCueAtom } from '../subtitle-base/SubtitleCueAtom';
import type { SubtitleCueMapAtom } from '../subtitle-base/SubtitleCueMapAtom';
import type { SubtitleBaseExportNames } from '../subtitle-base/Types';
export type SubtitleApiDependencies = {
    [CoreExportNames.CoreEffects]: CoreEffects;
    [CoreExportNames.CoreStateAtoms]: CoreStateAtoms;
    [CoreExportNames.Utils]: CoreUtils;
    [CoreExportNames.Constants]: Constants;
    [DataExportNames.StreamTimeline]: StreamTimelineAtom;
    [EventBusExportNames.ExtendEventBusTypes]: typeof extendEventBusTypes;
    [SourceExportNames.SourceState]: SourceStateAtom;
    [SourcesApiExportNames.SourceApiManager]: ApiManager<SubtitleSourceApi>;
    [SourcesApiExportNames.SourceEventBus]: EventBus<SubtitleEventMap>;
    [SubtitleBaseExportNames.SubtitleCueMapAtom]: SubtitleCueMapAtom;
} & StreamDataStructureSelectionGroups & StreamDataStructureTracks & StreamDataStructureSegments & StreamingState;
export declare enum SubtitleApiExportNames {
    SubtitleEvent = "subtitle-api-event"
}
export type SubtitleApiExports = {
    [SubtitleApiExportNames.SubtitleEvent]: typeof SubtitleEvent;
};
export type SubtitleApiContext = ContextHaving<SubtitleApiDependencies, SubtitleApiExports, ContextWithState>;
export type SubtitleTrack = {
    id: string;
    uri?: string;
    formatType: SubtitleFormatType;
    external: boolean;
    fragmented: boolean;
    language: string;
    enabled: boolean;
    label: string;
};
export type SubtitleApi = {
    readonly list: SubtitleTrack[];
    activate(id: string, disableOthers?: boolean): boolean;
    activate(track: SubtitleTrack, disableOthers?: boolean): boolean;
    activate(toActivate: SubtitleTrack | string, disableOthers?: boolean): boolean;
    deactivate(id: string): boolean;
    deactivate(track: SubtitleTrack): boolean;
    deactivate(toDeactivate: SubtitleTrack | string): boolean;
    add(track: {
        language: string;
        url: string;
        label: string;
    }): SubtitleTrack;
    remove(id: string): boolean;
    remove(track: SubtitleTrack): boolean;
    remove(toRemove: SubtitleTrack | string): boolean;
};
export type SubtitleSourceApi = {
    subtitles: SubtitleApi;
};
export declare enum SubtitleEvent {
    TrackAvailable = "subtitle-track-available",
    TrackUnavailable = "subtitle-track-unavailable",
    TrackActivated = "subtitle-track-activated",
    TrackDeactivated = "subtitle-track-deactivated",
    CueParsed = "subtitle-cue-parsed",
    CueEnter = "subtitle-cue-enter",
    CueExit = "subtitle-cue-exit"
}
export interface TrackEvent extends EventBase {
    track: SubtitleTrack;
}
export interface CueEvent extends TrackEvent {
    cue: SubtitleCueAtom;
}
export interface CueParsedEvent extends TrackEvent {
    cues: SubtitleCueAtom[];
}
export type SubtitleEventMap = {
    [SubtitleEvent.TrackAvailable]: TrackEvent;
    [SubtitleEvent.TrackUnavailable]: TrackEvent;
    [SubtitleEvent.TrackActivated]: TrackEvent;
    [SubtitleEvent.TrackDeactivated]: TrackEvent;
    [SubtitleEvent.CueParsed]: CueParsedEvent;
    [SubtitleEvent.CueEnter]: CueEvent;
    [SubtitleEvent.CueExit]: CueEvent;
};
