import { PlaybackController } from "../gui/PlaybackController.js";
import { EFTimegroup } from "./EFTimegroup.js";
import { LitElement, ReactiveController } from "lit";

//#region src/elements/EFTemporal.d.ts

type ContentReadyState = "idle" | "loading" | "ready" | "error";
type ContentChangeReason = "source" | "bounds" | "structure" | "content";
declare class TemporalMixinInterface {
  playbackController?: PlaybackController;
  playing: boolean;
  loop: boolean;
  play(): void;
  pause(): void;
  get hasOwnDuration(): boolean;
  /**
   * Whether the element has a duration set as an attribute.
   */
  get hasExplicitDuration(): boolean;
  get sourceStartMs(): number;
  /**
   * Used to trim the start of the media.
   *
   * This can be set in either seconds or milliseconds.
   *
   * For example, `trimstart="10s"` is equivalent to `trimstart="10000ms"`.
   *
   * @domAttribute "trimstart"
   */
  get trimStartMs(): number | undefined;
  /**
   * Used to trim the end of the media.
   *
   * This can be set in either seconds or milliseconds.
   *
   * For example, `trimend="10s"` is equivalent to `trimend="10000ms"`.
   *
   * @domAttribute "trimend"
   */
  get trimEndMs(): number;
  set trimStartMs(value: number | undefined);
  set trimEndMs(value: number | undefined);
  set trimstart(value: string | undefined);
  set trimend(value: string | undefined);
  /**
   * The source in time of the element.
   *
   * This is an amount of time to trim off the beginning of the media.
   *
   * This can be set in either seconds or milliseconds.
   *
   * For example, `sourcein="10s"` is equivalent to `sourcein="10000ms"`.
   *
   * If the sourcein time is greater than the duration of the media, the media
   * will not be played.
   *
   * If the media is 20 seconds long, and the `sourcein` value is set to `10s`, the
   * media will play for 10 seconds, starting at the 10 second mark.
   *
   * Can be used in conjunction with `sourceout` to create a trimmed media.
   *
   * @domAttribute "sourcein"
   */
  get sourceInMs(): number | undefined;
  /**
   * The source out time of the element.
   *
   * This is the point in time in the media that will be treated as the end of
   * the media.
   *
   * This can be set in either seconds or milliseconds.
   *
   * For example, `sourceout="10s"` is equivalent to `sourceout="10000ms"`.
   *
   * If the sourceout time is greater than the duration of the media, the media
   * will play until the end of the media.
   *
   * If the media is 20 seconds long, and the `sourceout` value is set to `10s`,
   * the media will play for 10 seconds, starting at zero seconds and ending at
   * the 10 second mark.
   *
   * Can be used in conjunction with `sourcein` to create a trimmed media.
   *
   * @domAttribute "sourceout"
   */
  get sourceOutMs(): number | undefined;
  set sourceInMs(value: number | undefined);
  set sourceOutMs(value: number | undefined);
  set sourcein(value: string | undefined);
  set sourceout(value: string | undefined);
  /**
   * @domAttribute "duration"
   */
  get durationMs(): number;
  get explicitDurationMs(): number | undefined;
  get intrinsicDurationMs(): number | undefined;
  /**
   * The start time of the element within its root timegroup in milliseconds.
   *
   * This is an absolute time according to the highest scoped timegroup the media element is contained within.
   *
   * The calculated value will depend on the mode of the timegroup and the offset of the media element.
   *
   * If the parent time group is in `sequence` mode, the start time will be the
   * start time of the previous sibling element plus the previous sibling's duration
   * minus the overlap of the previous sibling and the current sibling.
   *
   * If the parent time group is in `contain` or `fixed` mode, the start time will be
   * the start time of the parent time group plus the offset of the media element.
   */
  get startTimeMs(): number;
  /**
   * The end time of the element within its root timegroup in milliseconds.
   *
   * This is an absolute time according to the highest scoped timegroup the media
   * element is contained within. Computed by adding the media's duration to its
   * start time.
   *
   * If the media element has been trimmed, its end time will be calculated according it
   * its trimmed duration, not its original duration.
   */
  get endTimeMs(): number;
  /**
   * The start time of the element within its parent timegroup in milliseconds.
   *
   * This is a relative time according to the closest timegroup the media element
   * is contained within. Unless the media element has been given any kind of specific offset
   * it is common for this time to be zero.
   */
  get startTimeWithinParentMs(): number;
  /**
   * The current time of the element in milliseconds.
   *
   * This is a relative time according to the closest timegroup the media element
   * is contained within.
   *
   * This is suitable for determining the percentage of the media that has been
   * played.
   */
  get ownCurrentTimeMs(): number;
  /**
   * Set the base local time (ms) used by ownCurrentTimeMs when no playback
   * controller is present. Used by seekForRender() on render clones.
   * @internal
   */
  _setLocalTimeMs(value: number): void;
  /**
   * Element's current time for progress calculation.
   * For timegroups: their timeline currentTimeMs
   * For other temporal elements: their ownCurrentTimeMs
   */
  get currentTimeMs(): number;
  set currentTimeMs(value: number);
  /**
   * The current time of the element in milliseconds, adjusted for trimming.
   *
   * This is suitable for mapping to internal media time codes for audio/video
   * elements.
   *
   * For example, if the media has a `sourcein` value of 10s, when `ownCurrentTimeMs` is 0s,
   * `currentSourceTimeMs` will be 10s.
   *
   *            sourcein=10s     sourceout=10s
   * /         /                /
   * |--------|=================|---------|
   *          ^
   *          |_
   *            currentSourceTimeMs === 10s
   *          |_
   *            ownCurrentTimeMs === 0s
   */
  get currentSourceTimeMs(): number;
  set duration(value: string);
  get duration(): string;
  /**
   * The offset of the element within its parent timegroup in milliseconds.
   *
   * This can be set in either seconds or milliseconds.
   *
   * For example, `offset="10s"` is equivalent to `offset="10000ms"`.
   *
   * This can be used to create a negative or positive offset for the start time of the media.
   *
   * This will change the start time of the media relative to it's otherwise normal start time.
   *
   * The duration of the element, or it's parent, or the start and end time of it's temporal siblings will not
   * be affected by this offset.
   *
   * @domAttribute "offset"
   */
  set offset(value: string);
  get offset(): string;
  /**
   * A convenience property for getting the nearest containing timegroup of the media element.
   */
  parentTimegroup?: EFTimegroup;
  /**
   * A convenience property for getting the root timegroup of the media element.
   */
  rootTimegroup?: EFTimegroup;
  didBecomeRoot(): void;
  didBecomeChild(): void;
  /**
   * The readiness state of this element's content.
   * "idle" — no content / not connected
   * "loading" — async resources are loading
   * "ready" — element can render / extract frames
   * "error" — resource loading failed
   *
   * @domAttribute "content-ready-state"
   */
  contentReadyState: ContentReadyState;
  /**
   * Transition to a new readiness state.
   * Dispatches a non-bubbling `readystatechange` CustomEvent if the state changed.
   */
  setContentReadyState(state: ContentReadyState): void;
  /**
   * Dispatch a non-bubbling `contentchange` CustomEvent.
   * Signals that cached renderable output is stale.
   */
  emitContentChange(reason: ContentChangeReason): void;
  /**
   * Whether this element should auto-transition to "ready" after first update.
   * Override to return false for elements with async loading (EFMedia, EFCaptions).
   */
  shouldAutoReady(): boolean;
  updateComplete: Promise<boolean>;
}
declare const isEFTemporal: (obj: any) => obj is TemporalMixinInterface;
//#endregion
export { TemporalMixinInterface, isEFTemporal };
//# sourceMappingURL=EFTemporal.d.ts.map