
import { et as RowCountDiff, l as Check, nt as RowCountDiffResult } from "./instanceInfo-D9Pe6gIo.js";
import { AxiosInstance } from "axios";

//#region src/api/cacheKeys.d.ts
/**
 * Cache keys for TanStack Query.
 * Provides consistent query keys for API caching.
 */
declare const cacheKeys: {
  rowCount: (model: string) => string[];
  lineage: () => string[];
  checks: () => string[];
  check: (checkId: string) => string[];
  checkEvents: (checkId: string) => string[];
  runs: () => string[];
  run: (runId: string) => string[];
  runsAggregated: () => string[];
  flag: () => string[];
  instanceInfo: () => string[];
  user: () => string[];
};
//#endregion
//#region src/api/checkEvents.d.ts

type CheckEventType = "check_created" | "comment" | "approval_change" | "description_change" | "name_change" | "preset_applied";
type ActorType = "user" | "recce_ai" | "preset_system";
interface CheckEventActor {
  type: ActorType;
  user_id: number | null;
  login: string | null;
  fullname: string | null;
}
interface CheckEvent {
  id: string;
  check_id: string;
  event_type: CheckEventType;
  actor: CheckEventActor;
  content: string | null;
  old_value: string | null;
  new_value: string | null;
  is_edited: boolean;
  is_deleted: boolean;
  created_at: string;
  updated_at: string;
}
interface CreateCommentRequest {
  content: string;
}
interface UpdateCommentRequest {
  content: string;
}
interface CheckEventsListResponse {
  events: CheckEvent[];
}
/**
 * List all events for a check in chronological order.
 *
 * @param checkId - The check ID
 * @param client - Axios instance for API configuration
 * @returns Promise resolving to array of CheckEvent objects
 */
declare function listCheckEvents(checkId: string, client: AxiosInstance): Promise<CheckEvent[]>;
/**
 * Get a specific event by ID.
 *
 * @param checkId - The check ID
 * @param eventId - The event ID
 * @param client - Axios instance for API configuration
 * @returns Promise resolving to a CheckEvent object
 */
declare function getCheckEvent(checkId: string, eventId: string, client: AxiosInstance): Promise<CheckEvent>;
/**
 * Create a new comment on a check.
 *
 * @param checkId - The check ID
 * @param content - The comment content (plain text for now, markdown later)
 * @param client - Axios instance for API configuration
 * @returns Promise resolving to the created CheckEvent
 */
declare function createComment(checkId: string, content: string, client: AxiosInstance): Promise<CheckEvent>;
/**
 * Update an existing comment.
 * Only the author or an admin can update a comment.
 *
 * @param checkId - The check ID
 * @param eventId - The event ID of the comment to update
 * @param content - The new comment content
 * @param client - Axios instance for API configuration
 * @returns Promise resolving to the updated CheckEvent
 */
declare function updateComment(checkId: string, eventId: string, content: string, client: AxiosInstance): Promise<CheckEvent>;
/**
 * Delete a comment (soft delete).
 * Only the author or an admin can delete a comment.
 *
 * @param checkId - The check ID
 * @param eventId - The event ID of the comment to delete
 * @param client - Axios instance for API configuration
 * @returns Promise resolving when deletion is complete
 */
declare function deleteComment(checkId: string, eventId: string, client: AxiosInstance): Promise<void>;
declare function isCommentEvent(event: CheckEvent): boolean;
declare function isStateChangeEvent(event: CheckEvent): boolean;
declare function isSystemEvent(event: CheckEvent): boolean;
/**
 * Get a human-readable description of an event for display.
 */
declare function getEventDescription(event: CheckEvent): string;
/**
 * Get the appropriate icon name for an event type.
 * Returns a string that can be used with react-icons.
 */
declare function getEventIconType(event: CheckEvent): "comment" | "approve" | "unapprove" | "edit" | "create" | "preset";
//#endregion
//#region src/api/keepAlive.d.ts
/** Callback to notify listeners when keep-alive is successfully sent */
type KeepAliveCallback = (timestamp: number) => void;
/**
 * Register a callback to be notified when keep-alive is successfully sent
 * Used by IdleTimeoutContext to track server sync time
 */
declare function setKeepAliveCallback(callback: KeepAliveCallback | null): void;
/**
 * Send a keep-alive signal to the server to reset the idle timeout timer.
 * This prevents the server from shutting down due to inactivity.
 *
 * Includes built-in throttling at the axios layer:
 * - Minimum 3 seconds between API calls
 * - Prevents concurrent API calls with a lock
 *
 * @param client - Axios instance for API configuration (required)
 * @returns true if keep-alive was sent, false if throttled/skipped
 */
declare function sendKeepAlive(client: AxiosInstance): Promise<boolean>;
/**
 * Get the last successful keep-alive timestamp
 * This represents the last time the server confirmed it received our keep-alive
 */
declare function getLastKeepAliveTime(): number;
/**
 * Reset all module state (for testing purposes)
 */
declare function resetKeepAliveState(): void;
//#endregion
//#region src/api/models.d.ts
interface QueryRowCountResult {
  runId: string;
  result: RowCountDiffResult;
}
/**
 * Fetch model row count from the API (cached value).
 * @param modelName - The name of the model
 * @param client - Required axios instance
 * @returns The row count diff for the model
 */
declare function fetchModelRowCount(modelName: string, client: AxiosInstance): Promise<RowCountDiff>;
/**
 * Query model row count by executing a row count diff run.
 * @param modelName - The name of the model
 * @param client - Required axios instance
 * @returns The row count diff for the model
 */
declare function queryModelRowCount(modelName: string, client: AxiosInstance): Promise<RowCountDiff>;
/**
 * Query row counts for multiple models.
 * @param modelNames - Array of model names to query
 * @param client - Required axios instance
 * @returns The run ID and row count diff results for all models
 */
declare function queryRowCount(modelNames: string[], client: AxiosInstance): Promise<QueryRowCountResult>;
//#endregion
//#region src/api/schemacheck.d.ts
interface SchemaDiffViewParams {
  node_id?: string | string[];
  select?: string;
  exclude?: string;
  view_mode?: "all" | "changed_models";
  packages?: string[];
}
/**
 * Create a schema diff check.
 *
 * @param params - Schema diff parameters
 * @param client - Axios instance for API configuration
 * @returns Promise resolving to the created check
 */
declare function createSchemaDiffCheck(params: SchemaDiffViewParams, client: AxiosInstance): Promise<Check>;
//#endregion
//#region src/api/select.d.ts
interface SelectInput {
  select?: string;
  exclude?: string;
  packages?: string[];
  view_mode?: "all" | "changed_models";
}
interface SelectOutput {
  nodes: string[];
}
declare function select(input: SelectInput, client: AxiosInstance): Promise<SelectOutput>;
//#endregion
//#region src/api/state.d.ts
interface SaveAsInput {
  filename: string;
  overwrite?: boolean;
}
interface ImportedState {
  runs: number;
  checks: number;
}
declare function saveAs(input: SaveAsInput, client: AxiosInstance): Promise<void>;
declare function rename(input: SaveAsInput, client: AxiosInstance): Promise<void>;
declare function exportState(client: AxiosInstance): Promise<string>;
declare function importState(file: File, checksOnly: boolean | undefined, client: AxiosInstance): Promise<ImportedState>;
declare function isStateSyncing(client: AxiosInstance): Promise<boolean>;
interface SyncStateInput {
  method?: "overwrite" | "revert" | "merge";
}
interface SyncStateResponse {
  status: "accepted" | "conflict" | "syncing";
}
declare function syncState(input: SyncStateInput, client: AxiosInstance): Promise<SyncStateResponse>;
interface ShareStateResponse {
  status: string;
  message: string;
  share_url?: string;
}
declare function shareState(client: AxiosInstance): Promise<ShareStateResponse>;
//#endregion
//#region src/api/storageKeys.d.ts
declare const LOCAL_STORAGE_KEYS: {
  bypassSaveOverwrite: string;
  previewChangeFeedbackID: string;
  prepareEnvGuideID: string;
};
declare const SESSION_STORAGE_KEYS: {
  recommendationIgnored: string;
  recommendationShowed: string;
  prevRefreshTimeStamp: string;
  lineageNotificationDismissed: string;
};
//#endregion
//#region src/api/version.d.ts
interface VersionResponse {
  version: string;
  latestVersion: string;
}
declare function getVersion(client: AxiosInstance): Promise<VersionResponse>;
declare function useVersionNumber(): {
  version: string;
  latestVersion: string;
};
//#endregion
export { setKeepAliveCallback as A, getCheckEvent as B, QueryRowCountResult as C, getLastKeepAliveTime as D, queryRowCount as E, CheckEventsListResponse as F, isSystemEvent as G, getEventIconType as H, CreateCommentRequest as I, cacheKeys as J, listCheckEvents as K, UpdateCommentRequest as L, CheckEvent as M, CheckEventActor as N, resetKeepAliveState as O, CheckEventType as P, createComment as R, createSchemaDiffCheck as S, queryModelRowCount as T, isCommentEvent as U, getEventDescription as V, isStateChangeEvent as W, syncState as _, SESSION_STORAGE_KEYS as a, select as b, ShareStateResponse as c, exportState as d, importState as f, shareState as g, saveAs as h, LOCAL_STORAGE_KEYS as i, ActorType as j, sendKeepAlive as k, SyncStateInput as l, rename as m, getVersion as n, ImportedState as o, isStateSyncing as p, updateComment as q, useVersionNumber as r, SaveAsInput as s, VersionResponse as t, SyncStateResponse as u, SelectInput as v, fetchModelRowCount as w, SchemaDiffViewParams as x, SelectOutput as y, deleteComment as z };
//# sourceMappingURL=api-CHRBUwIf.d.ts.map