/// <reference types="../index.d.ts" />
import type { ArcgisArcadeEditor } from "../components/arcgis-arcade-editor/customElement.js";
import type { ArcgisCodeEditor } from "../components/arcgis-code-editor/customElement.js";
import type { CodeEditorShell } from "../components/arcgis-code-editor-shell/customElement.js";
import type { ArcgisCodeViewer } from "../components/arcgis-code-viewer/customElement.js";
import type { ArcgisSqlExpressionEditor } from "../components/arcgis-sql-expression-editor/customElement.js";
import type { h, EventHandler } from "@arcgis/lumina";

interface LuminaArcgisArcadeEditor extends Partial<Pick<ArcgisArcadeEditor, "arcadeAssistant" | "customPanels" | "editorOptions" | "hideDocumentationActions" | "hideSideBar" | "openedSidePanel" | "profile" | "script" | "sideActionBarExpanded" | "snippets" | "suggestions" | "testData">>, h.JSX.HTMLAttributes<ArcgisArcadeEditor> {
  onarcgisDiagnosticsChange?: EventHandler<ArcgisArcadeEditor["arcgisDiagnosticsChange"]>;
  onarcgisScriptChange?: EventHandler<ArcgisArcadeEditor["arcgisScriptChange"]>;
}

interface LuminaArcgisCodeEditor extends Partial<Pick<ArcgisCodeEditor, "editorOptions" | "language" | "modelId" | "value">>, h.JSX.HTMLAttributes<ArcgisCodeEditor> {
  onarcgisSelectionChange?: EventHandler<ArcgisCodeEditor["arcgisSelectionChange"]>;
  onarcgisValueChange?: EventHandler<ArcgisCodeEditor["arcgisValueChange"]>;
}

interface LuminaArcgisCodeEditorShell extends h.JSX.HTMLAttributes<CodeEditorShell> {
}

interface LuminaArcgisCodeViewer extends Partial<Pick<ArcgisCodeViewer, "language" | "round">>, h.JSX.HTMLAttributes<ArcgisCodeViewer> {
}

interface LuminaArcgisSqlExpressionEditor extends Partial<Pick<ArcgisSqlExpressionEditor, "hideSideBar" | "profile" | "script">>, h.JSX.HTMLAttributes<ArcgisSqlExpressionEditor> {
  onarcgisDiagnosticsChange?: EventHandler<ArcgisSqlExpressionEditor["arcgisDiagnosticsChange"]>;
  onarcgisScriptChange?: EventHandler<ArcgisSqlExpressionEditor["arcgisScriptChange"]>;
}

declare module "@arcgis/lumina" {
  export namespace h.JSX {
    interface IntrinsicElements {
      "arcgis-arcade-editor": LuminaArcgisArcadeEditor;
      "arcgis-code-editor": LuminaArcgisCodeEditor;
      "arcgis-code-editor-shell": LuminaArcgisCodeEditorShell;
      "arcgis-code-viewer": LuminaArcgisCodeViewer;
      "arcgis-sql-expression-editor": LuminaArcgisSqlExpressionEditor;
    }
  }
}