
import { r as DataGridHandle } from "./ScreenshotDataGrid-CeuGj_hE.js";
import * as react56 from "react";
import { ReactNode, Ref } from "react";

//#region src/components/result/types.d.ts
/**
 * Ref types supported by ResultView components
 */
type ResultViewRef = DataGridHandle | HTMLDivElement;
/**
 * Screenshot wrapper types
 */
type ScreenshotWrapperType = "grid" | "box";
/**
 * Warning display styles for the toolbar area.
 *
 * - 'alert': MUI Alert with severity="warning" (default)
 * - 'amber': Amber-colored inline warning with icon (matches QueryResultView pattern)
 */
type WarningStyle = "alert" | "amber";
/**
 * Base props for all ResultView components
 */
interface ResultViewProps<TViewOptions = unknown> {
  run: unknown;
  viewOptions?: TViewOptions;
  onViewOptionsChanged?: (options: TViewOptions) => void;
}
/**
 * Configuration for the createResultView factory
 */
interface ResultViewConfig<TRun, TViewOptions = unknown, _TRef extends ResultViewRef = DataGridHandle> {
  displayName: string;
  typeGuard: (run: unknown) => run is TRun;
  expectedRunType: string;
  screenshotWrapper: ScreenshotWrapperType;
  transformData: (run: TRun, options: ResultViewTransformOptions<TViewOptions>) => ResultViewData | null;
  emptyState?: ReactNode | string;
  conditionalEmptyState?: (run: TRun, viewOptions?: TViewOptions) => ReactNode | null;
}
/**
 * Options passed to transformData
 */
interface ResultViewTransformOptions<TViewOptions> {
  viewOptions?: TViewOptions;
  onViewOptionsChanged?: (options: TViewOptions) => void;
  /**
   * Callback when user wants to add run to checklist.
   * Passed through from component props.
   */
  onAddToChecklist?: (run: unknown) => void;
}
/**
 * Result of transformData
 */
interface ResultViewData {
  columns?: unknown[];
  rows?: unknown[];
  content?: ReactNode;
  isEmpty?: boolean;
  /**
   * Custom empty message to show when isEmpty is true.
   * When provided along with toolbar/warnings, shows toolbar above this message.
   * Enables "toolbar-in-empty-state" pattern for components like ValueDiffDetailResultView.
   */
  emptyMessage?: ReactNode;
  header?: ReactNode;
  footer?: ReactNode;
  /**
   * Toolbar controls to render above the content.
   * Renders on the right side of the toolbar area.
   */
  toolbar?: ReactNode;
  /**
   * Warning messages to display in the toolbar area.
   * Renders as alert chips on the left side.
   */
  warnings?: string[];
  /**
   * Style for rendering warnings.
   * - 'alert' (default): MUI Alert with severity="warning"
   * - 'amber': Amber-colored inline warning with icon (like QueryResultView)
   */
  warningStyle?: WarningStyle;
  renderNull?: boolean;
  /**
   * Default column options for grid wrapper.
   * Passed to ScreenshotDataGrid's defaultColumnOptions prop.
   */
  defaultColumnOptions?: {
    resizable?: boolean;
    maxWidth?: number;
    minWidth?: number;
  };
  /**
   * Custom message for grid's empty rows state (when rows array exists but is empty).
   * Passed to EmptyRowsRenderer in ScreenshotDataGrid.
   */
  noRowsMessage?: string;
}
/**
 * Props for factory-created ResultView components
 */
interface CreatedResultViewProps<TViewOptions = unknown> extends ResultViewProps<TViewOptions> {
  ref?: Ref<ResultViewRef>;
  /**
   * Callback when user wants to add run to checklist.
   * Used by QueryResultView.
   */
  onAddToChecklist?: (run: unknown) => void;
}
//#endregion
//#region src/components/result/createResultView.d.ts
/**
 * Factory function to create type-safe ResultView components.
 *
 * @remarks
 * Reduces boilerplate by handling:
 * - Type guard validation with consistent error messages
 * - forwardRef setup for screenshot capture
 * - Dark/light theme handling
 * - Empty state rendering
 *
 * @typeParam TRun - Run payload type validated by the type guard.
 * @typeParam TViewOptions - Optional view options shape used by the view.
 * @typeParam TRef - Ref type exposed by the view (defaults to DataGridHandle).
 *
 * @example
 * ```tsx
 * export const RowCountResultView = createResultView({
 *   displayName: "RowCountResultView",
 *   typeGuard: isRowCountRun,
 *   expectedRunType: "row_count",
 *   screenshotWrapper: "grid",
 *   transformData: (run) => ({
 *     columns: toRowCountGrid(run).columns,
 *     rows: toRowCountGrid(run).rows,
 *   }),
 * });
 * ```
 */
declare function createResultView<TRun, TViewOptions = unknown, TRef extends ResultViewRef = DataGridHandle>(config: ResultViewConfig<TRun, TViewOptions>): react56.ForwardRefExoticComponent<Omit<CreatedResultViewProps<TViewOptions>, "ref"> & react56.RefAttributes<TRef>>;
//#endregion
export { ResultViewProps as a, ScreenshotWrapperType as c, ResultViewData as i, CreatedResultViewProps as n, ResultViewRef as o, ResultViewConfig as r, ResultViewTransformOptions as s, createResultView as t };
//# sourceMappingURL=index-Cuz7hTgv.d.ts.map