import { IAppRouter, ToPlugin } from "../../shared/src/plugin.js";
import { SQLTypeMarker } from "../../shared/src/sql/types.js";
import { Plugin } from "../../plugin/plugin.js";
import { IAnalyticsConfig } from "./types.js";
import { PluginManifest } from "../../registry/types.js";
import { WorkspaceClient } from "@databricks/sdk-experimental";
import express from "express";

//#region src/plugins/analytics/analytics.d.ts
declare class AnalyticsPlugin extends Plugin {
  name: string;
  /** Plugin manifest declaring metadata and resource requirements */
  static manifest: PluginManifest;
  protected static description: string;
  protected config: IAnalyticsConfig;
  private SQLClient;
  private queryProcessor;
  constructor(config: IAnalyticsConfig);
  injectRoutes(router: IAppRouter): void;
  /**
   * Handle Arrow data download requests.
   * When called via asUser(req), uses the user's Databricks credentials.
   */
  _handleArrowRoute(req: express.Request, res: express.Response): Promise<void>;
  /**
   * Handle SQL query execution requests.
   * When called via asUser(req), uses the user's Databricks credentials.
   */
  _handleQueryRoute(req: express.Request, res: express.Response): Promise<void>;
  /**
   * Execute a SQL query using the current execution context.
   *
   * When called directly: uses service principal credentials.
   * When called via asUser(req).query(...): uses user's credentials.
   *
   * @example
   * ```typescript
   * // Service principal execution
   * const result = await analytics.query("SELECT * FROM table")
   *
   * // User context execution (in route handler)
   * const result = await this.asUser(req).query("SELECT * FROM table")
   * ```
   */
  query(query: string, parameters?: Record<string, SQLTypeMarker | null | undefined>, formatParameters?: Record<string, any>, signal?: AbortSignal): Promise<any>;
  /**
   * Get Arrow-formatted data for a completed query job.
   */
  protected getArrowData(workspaceClient: WorkspaceClient, jobId: string, signal?: AbortSignal): Promise<ReturnType<typeof this.SQLClient.getArrowData>>;
  shutdown(): Promise<void>;
  /**
   * Returns the public exports for the analytics plugin.
   * Note: `asUser()` is automatically added by AppKit.
   */
  exports(): {
    /**
     * Execute a SQL query using service principal credentials.
     */
    query: (query: string, parameters?: Record<string, SQLTypeMarker | null | undefined>, formatParameters?: Record<string, any>, signal?: AbortSignal) => Promise<any>;
  };
}
/**
 * @internal
 */
declare const analytics: ToPlugin<typeof AnalyticsPlugin, IAnalyticsConfig, "analytics">;
//#endregion
export { analytics };
//# sourceMappingURL=analytics.d.ts.map