import type { JsonValue } from '../control-plane';
import type { JobProvider, ScheduledJob } from './model';
import { JobStore } from './store';
export type JobDesiredState = Record<string, JsonValue>;
export interface JobProviderAdapter {
    readonly provider: JobProvider;
    observe(job: ScheduledJob): Promise<JobDesiredState | undefined>;
    apply(job: ScheduledJob, desired: JobDesiredState): Promise<void>;
    remove(job: ScheduledJob): Promise<void>;
    matches(desired: JobDesiredState, observed: JobDesiredState): boolean;
}
export interface ServerCronTransport {
    read(path: string): Promise<string | undefined>;
    writeRootOwned(path: string, content: string): Promise<void>;
    removeRootOwned(path: string): Promise<void>;
}
export interface EventBridgeScheduleTransport {
    get(name: string): Promise<JobDesiredState | undefined>;
    put(input: JobDesiredState): Promise<void>;
    remove(name: string): Promise<void>;
}
declare function desiredState(job: ScheduledJob): JobDesiredState;
export declare class ServerCronJobAdapter implements JobProviderAdapter {
    private readonly transport;
    readonly provider: 'server';
    constructor(transport: ServerCronTransport);
    observe(job: ScheduledJob): Promise<JobDesiredState | undefined>;
    apply(job: ScheduledJob, desired: JobDesiredState): Promise<void>;
    remove(job: ScheduledJob): Promise<void>;
    matches(desired: JobDesiredState, observed: JobDesiredState): boolean;
}
export declare class EventBridgeJobAdapter implements JobProviderAdapter {
    private readonly transport;
    readonly provider: 'eventbridge';
    constructor(transport: EventBridgeScheduleTransport);
    observe(job: ScheduledJob): Promise<JobDesiredState | undefined>;
    apply(_job: ScheduledJob, desired: JobDesiredState): Promise<void>;
    remove(job: ScheduledJob): Promise<void>;
    matches(desired: JobDesiredState, observed: JobDesiredState): boolean;
}
export declare class JobProviderReconciler {
    private readonly store;
    constructor(store: JobStore);
    reconcile(job: ScheduledJob, adapter: JobProviderAdapter, options?: {
        apply?: boolean;
    }): Promise<ScheduledJob>;
    remove(job: ScheduledJob, adapter: JobProviderAdapter): Promise<void>;
}
export { desiredState as desiredJobProviderState };
