/// <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 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<HTMLArcgisArcadeEditorElement> {
  onarcgisDiagnosticsChange?: EventHandler<HTMLArcgisArcadeEditorElement["arcgisDiagnosticsChange"]>;
  onarcgisScriptChange?: EventHandler<HTMLArcgisArcadeEditorElement["arcgisScriptChange"]>;
}

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

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

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

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