import { ContextMixinInterface } from "./ContextMixin.js";
import { RenderToVideoOptions } from "../preview/renderTimegroupToVideo.types.js";
import "./EFFitScale.js";
import * as lit8 from "lit";
import { LitElement, PropertyValueMap } from "lit";
import * as lit_html8 from "lit-html";
import * as lit_html_directives_ref_js2 from "lit-html/directives/ref.js";

//#region src/gui/EFWorkbench.d.ts
declare const EFWorkbench_base: (new (...args: any[]) => ContextMixinInterface) & typeof LitElement;
declare class EFWorkbench extends EFWorkbench_base {
  #private;
  static styles: lit8.CSSResult[];
  rendering: boolean;
  private panZoomTransform;
  private isExporting;
  private exportProgress;
  private exportStatus;
  private previewSettings;
  private renderMode;
  private presentationMode;
  private previewResolutionScale;
  private exportOptions;
  private exportAbortController;
  private previewIsLoading;
  private isPlaying;
  private isScrubbing;
  private isAtRest;
  /**
   * Current adaptive resolution scale (only used when previewResolutionScale === "auto")
   */
  private currentAdaptiveScale;
  /**
   * Playback stats for display (FPS, dropped frames, etc.)
   * Mirrors previewSettings.showStats for direct access
   */
  private showStats;
  /**
   * Theme mode: 'light', 'dark', or 'system'
   */
  private themeMode;
  /**
   * Always-on render statistics collection for canvas mode.
   * Collects data regardless of whether stats are visible.
   */
  private renderStats;
  /**
   * Media query for system theme preference
   */
  private systemThemeMediaQuery;
  private systemThemeListener;
  /**
   * DOM mode stats strategy (has its own animation loop).
   * Only active in DOM mode.
   */
  private domStatsStrategy;
  /**
   * Reference for tracking scrubbing state from EFScrubber.
   * Pass this to <ef-scrubber isScrubbingRef={...}> to enable motion detection.
   */
  readonly isScrubbingRef: {
    current: boolean;
  };
  private restDebounceTimer;
  private playingCheckInterval;
  private adaptiveTracker;
  private savePanZoomDebounceTimer;
  private canvasPreviewRef;
  private canvasPreviewResult;
  private canvasAnimationFrame;
  private boundHandleTransformChanged;
  focusOverlay: lit_html_directives_ref_js2.Ref<HTMLDivElement>;
  handleStageWheel(event: WheelEvent): void;
  connectedCallback(): void;
  disconnectedCallback(): void;
  protected firstUpdated(): void;
  private lastCanvasZoom;
  private zoomReinitTimeout;
  private handleTransformChanged;
  private getTimegroup;
  /**
   * Get the root timegroup ID for localStorage key generation.
   * Returns null if no root timegroup is found or it has no ID.
   */
  private getRootTimegroupId;
  /**
   * Get localStorage key for preview pan/zoom state.
   */
  private getPreviewPanZoomStorageKey;
  /**
   * Save preview pan/zoom to localStorage.
   */
  private savePreviewPanZoom;
  /**
   * Restore preview pan/zoom from localStorage.
   */
  private restorePreviewPanZoom;
  /**
   * Debounced save of preview pan/zoom to avoid excessive localStorage writes.
   */
  private debouncedSavePreviewPanZoom;
  /**
   * Start polling for motion state (playing/scrubbing).
   * We use polling because:
   * - Playing state comes from timegroup's playbackController
   * - Scrubbing state comes from isScrubbingRef (set by EFScrubber)
   */
  private startMotionStateTracking;
  private stopMotionStateTracking;
  /**
   * Update motion state by checking timegroup and scrubbing ref.
   */
  private updateMotionState;
  /**
   * Pause or unpause the canvas overlay components (EFCanvas, SelectionOverlay)
   * to avoid layout-thrashing during playback.
   */
  private setOverlaysPaused;
  /**
   * Called when motion starts (playing or scrubbing began).
   */
  private handleMotionStart;
  /**
   * Called when motion stops (not playing and not scrubbing).
   * Starts a debounce timer before transitioning to rest state.
   */
  private handleMotionStop;
  /**
   * Called after debounce period when we're confirmed to be at rest.
   */
  private transitionToRest;
  /**
   * Get the effective resolution scale based on current mode and motion state.
   * For "auto" mode, returns full resolution at rest, adaptive scale in motion.
   */
  private getEffectiveResolutionScale;
  /**
   * Apply settings when dependencies are ready.
   * Called from updated() hook when settings change or dependencies become available.
   */
  private applySettings;
  private handlePresentationModeChange;
  private initDomMode;
  private stopDomMode;
  /**
   * Get the resolution scale for canvas rendering (for fixed scale modes).
   *
   * Logic:
   * - Get actual displayed size from getBoundingClientRect()
   * - For "Full": render at displayed size (1:1 pixel mapping)
   * - For other settings: render at that % of displayed size
   * - Never exceed composition size (100%)
   *
   * Note: For "auto" mode, use getEffectiveResolutionScale() instead.
   */
  private getResolutionScale;
  private initCanvasMode;
  private stopCanvasMode;
  private updateCanvasTransform;
  initCanvasRenderer(): Promise<{
    canvas: HTMLCanvasElement;
    refresh: () => Promise<void>;
  } | null>;
  /** Start video export with progress tracking */
  startExport(options?: RenderToVideoOptions): Promise<void>;
  /** Cancel the current export */
  cancelExport(): void;
  private positionPopover;
  private handleSettingsPopoverToggle;
  private handleExportPopoverToggle;
  private handleStartExport;
  private updateExportOption;
  private formatTime;
  private handleCancelClick;
  private handleRenderModeChange;
  private handleShowStatsToggle;
  private handleShowThumbnailTimestampsToggle;
  /**
   * Get initial theme from localStorage or default to 'dark'
   */
  private getInitialTheme;
  /**
   * Cycle through theme modes: light → dark → system → light
   */
  private handleThemeToggle;
  /**
   * Apply the current theme to the document and host element
   */
  private applyTheme;
  /**
   * Reset and fit the preview to show all content centered.
   * Finds the pan-zoom element and calls fitToContent() on it.
   */
  private handleFitToContent;
  private renderSettingsPopover;
  private renderExportPopover;
  private renderExportProgressPopover;
  private renderToolbar;
  update(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
  updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
  drawOverlays: () => void;
  private renderPlaybackStats;
  render(): lit_html8.TemplateResult<1>;
}
declare global {
  interface HTMLElementTagNameMap {
    "ef-workbench": EFWorkbench;
  }
}
//#endregion
export { EFWorkbench };
//# sourceMappingURL=EFWorkbench.d.ts.map