import { FrameRenderable, FrameState } from "../preview/FrameController.js";
import { EFSourceMixinInterface } from "./EFSourceMixin.js";
import { TemporalMixinInterface } from "./EFTemporal.js";
import { FetchMixinInterface } from "./FetchMixin.js";
import { AsyncValue } from "./EFMedia.js";
import { EFAudio } from "./EFAudio.js";
import { EFVideo } from "./EFVideo.js";
import * as lit1 from "lit";
import { LitElement, PropertyValueMap } from "lit";
import * as lit_html0 from "lit-html";

//#region src/elements/EFCaptions.d.ts
interface WordSegment {
  text: string;
  start: number;
  end: number;
}
interface Segment {
  start: number;
  end: number;
  text: string;
}
interface Caption {
  segments: Segment[];
  word_segments: WordSegment[];
}
/**
 * Caption active word element - displays the currently spoken word.
 * Uses light DOM for simplicity - parent sets textContent directly.
 */
declare class EFCaptionsActiveWord extends LitElement {
  #private;
  set wordText(text: string);
  get wordText(): string;
  set wordIndex(index: number);
  get wordIndex(): number;
}
/**
 * Caption segment element - displays a full caption segment.
 * Uses light DOM for simplicity - parent sets textContent directly.
 */
declare class EFCaptionsSegment extends LitElement {
  #private;
  set segmentText(text: string);
  get segmentText(): string;
}
/**
 * Caption before-active-word element - displays words before the current word.
 * Uses light DOM for simplicity - parent sets textContent directly.
 */
declare class EFCaptionsBeforeActiveWord extends EFCaptionsSegment {
  set segmentText(text: string);
}
/**
 * Caption after-active-word element - displays words after the current word.
 * Uses light DOM for simplicity - parent sets textContent directly.
 */
declare class EFCaptionsAfterActiveWord extends EFCaptionsSegment {
  set segmentText(text: string);
}
declare const EFCaptions_base: (new (...args: any[]) => EFSourceMixinInterface) & (new (...args: any[]) => TemporalMixinInterface) & (new (...args: any[]) => FetchMixinInterface) & typeof LitElement;
declare class EFCaptions extends EFCaptions_base implements FrameRenderable {
  #private;
  static styles: lit1.CSSResult[];
  targetSelector: string;
  set target(value: string);
  wordStyle: string;
  /**
   * URL or path to a JSON file containing custom captions data.
   * The JSON should conform to the Caption interface with 'segments' and 'word_segments' arrays.
   */
  captionsSrc: string;
  /**
   * Direct captions data object. Takes priority over captions-src and captions-script.
   * Should conform to the Caption interface with 'segments' and 'word_segments' arrays.
   */
  captionsData: Caption | null;
  /**
   * ID of a <script> element containing JSON captions data.
   * The script's textContent should be valid JSON conforming to the Caption interface.
   */
  captionsScript: string;
  activeWordContainers: HTMLCollectionOf<EFCaptionsActiveWord>;
  segmentContainers: HTMLCollectionOf<EFCaptionsSegment>;
  beforeActiveWordContainers: HTMLCollectionOf<EFCaptionsBeforeActiveWord>;
  afterActiveWordContainers: HTMLCollectionOf<EFCaptionsAfterActiveWord>;
  render(): lit_html0.TemplateResult<1>;
  transcriptionsPath(): string | null;
  captionsPath(): string | null;
  /**
   * AsyncValue wrapper for backwards compatibility
   */
  unifiedCaptionsDataTask: AsyncValue<Caption | null>;
  shouldAutoReady(): boolean;
  /**
   * Load captions data from all possible sources
   */
  loadCaptionsData(signal?: AbortSignal): Promise<Caption | null>;
  /**
   * Query readiness state for a given time.
   * @implements FrameRenderable
   */
  getFrameState(_timeMs: number): FrameState;
  /**
   * Async preparation - waits for captions data to load.
   * @implements FrameRenderable
   */
  prepareFrame(_timeMs: number, signal: AbortSignal): Promise<void>;
  /**
   * Synchronous render - updates caption text containers.
   * Sets textContent directly on child elements (light DOM).
   * @implements FrameRenderable
   */
  renderFrame(_timeMs: number): void;
  connectedCallback(): void;
  disconnectedCallback(): void;
  protected updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
  updateTextContainers(): void;
  get targetElement(): EFAudio | EFVideo | null;
  get hasCustomCaptionsData(): boolean;
  get intrinsicDurationMs(): number | undefined;
  get hasOwnDuration(): boolean;
}
declare global {
  interface HTMLElementTagNameMap {
    "ef-captions": EFCaptions;
    "ef-captions-active-word": EFCaptionsActiveWord;
    "ef-captions-segment": EFCaptionsSegment;
    "ef-captions-before-active-word": EFCaptionsBeforeActiveWord;
    "ef-captions-after-active-word": EFCaptionsAfterActiveWord;
  }
}
//#endregion
export { Caption, EFCaptions, EFCaptionsActiveWord, EFCaptionsAfterActiveWord, EFCaptionsBeforeActiveWord, EFCaptionsSegment };
//# sourceMappingURL=EFCaptions.d.ts.map