import { ReactNode } from "react";
import { EditorExtensionConfig } from "@platform-modules/ui-editor";
//#region src/editor-widget/types.d.ts
interface EditorWidgetMediaItem {
  src: string;
  alt: string;
  width?: number;
  height?: number;
}
interface EditorWidgetMediaRenderProps {
  disabled: boolean;
  onSelect(item: EditorWidgetMediaItem): boolean;
}
interface EditorWidgetMediaAdapter {
  extensions: EditorExtensionConfig;
  renderPicker(props: EditorWidgetMediaRenderProps): ReactNode;
}
type EditorWidgetErrorCode = 'invalid_media' | 'media_insert_failed';
interface EditorWidgetError extends Error {
  readonly name: 'EditorWidgetError';
  readonly code: EditorWidgetErrorCode;
}
interface EditorWidgetProps {
  value: string;
  onChange(nextHtml: string): void;
  dir?: 'ltr' | 'rtl';
  readOnly?: boolean;
  ariaLabel: string;
  ariaDescribedBy?: string;
  media?: EditorWidgetMediaAdapter;
  onError?(error: EditorWidgetError): void;
  className?: string;
}
//#endregion
//#region src/editor-widget/EditorWidget.d.ts
declare function EditorWidget({ value, onChange, dir, readOnly, ariaLabel, ariaDescribedBy, media, onError, className }: EditorWidgetProps): import("react").JSX.Element;
//#endregion
//#region src/editor-widget/errors.d.ts
declare function isEditorWidgetError(value: unknown): value is EditorWidgetError;
//#endregion
export { EditorWidget, type EditorWidgetError, type EditorWidgetErrorCode, type EditorWidgetMediaAdapter, type EditorWidgetMediaItem, type EditorWidgetMediaRenderProps, type EditorWidgetProps, isEditorWidgetError };