/// <reference types="../index.d.ts" />
import type { ArcgisArcadeEditor } from "../components/arcgis-arcade-editor/index.js";
import type { ArcgisCodeEditor } from "../components/arcgis-code-editor/index.js";
import type { ArcgisCodeViewer } from "../components/arcgis-code-viewer/index.js";
import type { ArcgisSqlExpressionEditor } from "../components/arcgis-sql-expression-editor/index.js";
import { JSX as PreactJsx } from "preact";
import type { EventHandler } from "@arcgis/lumina";

/** @deprecated Update to Preact 10.27.2+ or 11+ and consume types/preact file over types/preact10 */
interface PreactArcgisArcadeEditor extends Partial<Pick<ArcgisArcadeEditor, 'arcadeAssistant' | 'customPanels' | 'editorOptions' | 'hideDocumentationActions' | 'hideSideBar' | 'openedSidePanel' | 'profile' | 'script' | 'sideActionBarExpanded' | 'snippets' | 'suggestions' | 'testData'>>, PreactJsx.HTMLAttributes<HTMLArcgisArcadeEditorElement> {
  onarcgisDiagnosticsChange?: EventHandler<HTMLArcgisArcadeEditorElement["arcgisDiagnosticsChange"]>;
  onarcgisScriptChange?: EventHandler<HTMLArcgisArcadeEditorElement["arcgisScriptChange"]>;
}

/** @deprecated Update to Preact 10.27.2+ or 11+ and consume types/preact file over types/preact10 */
interface PreactArcgisCodeEditor extends Partial<Pick<ArcgisCodeEditor, 'editorOptions' | 'language' | 'modelId' | 'value'>>, PreactJsx.HTMLAttributes<HTMLArcgisCodeEditorElement> {
  onarcgisSelectionChange?: EventHandler<HTMLArcgisCodeEditorElement["arcgisSelectionChange"]>;
  onarcgisValueChange?: EventHandler<HTMLArcgisCodeEditorElement["arcgisValueChange"]>;
}

/** @deprecated Update to Preact 10.27.2+ or 11+ and consume types/preact file over types/preact10 */
interface PreactArcgisCodeViewer extends Partial<Pick<ArcgisCodeViewer, 'language' | 'round'>>, PreactJsx.HTMLAttributes<HTMLArcgisCodeViewerElement> {
}

/** @deprecated Update to Preact 10.27.2+ or 11+ and consume types/preact file over types/preact10 */
interface PreactArcgisSqlExpressionEditor extends Partial<Pick<ArcgisSqlExpressionEditor, 'hideSideBar' | 'profile' | 'script'>>, PreactJsx.HTMLAttributes<HTMLArcgisSqlExpressionEditorElement> {
  onarcgisDiagnosticsChange?: EventHandler<HTMLArcgisSqlExpressionEditorElement["arcgisDiagnosticsChange"]>;
  onarcgisScriptChange?: EventHandler<HTMLArcgisSqlExpressionEditorElement["arcgisScriptChange"]>;
}

declare module 'preact' {
  namespace createElement.JSX {
    interface IntrinsicElements {
      "arcgis-arcade-editor": PreactArcgisArcadeEditor;
      "arcgis-code-editor": PreactArcgisCodeEditor;
      "arcgis-code-viewer": PreactArcgisCodeViewer;
      "arcgis-sql-expression-editor": PreactArcgisSqlExpressionEditor;
    }
  }
  namespace h.JSX {
    interface IntrinsicElements {
      "arcgis-arcade-editor": PreactArcgisArcadeEditor;
      "arcgis-code-editor": PreactArcgisCodeEditor;
      "arcgis-code-viewer": PreactArcgisCodeViewer;
      "arcgis-sql-expression-editor": PreactArcgisSqlExpressionEditor;
    }
  }
}