import { NexusClient, NexusApi } from '@gzl10/nexus-client';

/**
 * @module @gzl10/nexus-plugin-schedules/client
 * @description Client API for the Schedules plugin with declaration merging.
 */

interface ScheduleStats {
    total_schedules: number;
    active: number;
    paused: number;
    errored: number;
    retrying: number;
    executions_24h: number;
    success_rate_24h: number;
    avg_duration_ms: number;
    total_retries_24h: number;
    exhausted_24h: number;
    next_run: string | null;
    next_run_name: string | null;
}
interface SchedulesApi {
    getStats(): Promise<ScheduleStats>;
}
declare module '@gzl10/nexus-client' {
    interface NexusPluginApis {
        schedules: SchedulesApi;
    }
}
declare function createSchedulesApi(client: NexusClient): SchedulesApi;
/**
 * Registers the Schedules API on a NexusApi instance.
 *
 * @example
 * ```typescript
 * import { registerSchedulesApi } from '@gzl10/nexus-plugin-schedules/client'
 *
 * registerSchedulesApi(nexus)
 * nexus.plugin('schedules').getStats()
 * ```
 */
declare function registerSchedulesApi(nexus: NexusApi): void;

export { type ScheduleStats, type SchedulesApi, createSchedulesApi, registerSchedulesApi };
