import type { ApiClient } from './request';
export type AvailabilityRule = {
    id: string;
    siteId: string;
    resourceId: string;
    serviceId: string | null;
    /** 0-6 (Sunday-Saturday). */
    weekday: number;
    /** HH:MM format. */
    startTime: string;
    /** HH:MM format. */
    endTime: string;
    /** ISO timestamp. */
    createdAt: string;
    /** ISO timestamp. */
    updatedAt: string;
};
export type ListAvailabilityRulesResponse = {
    rules: AvailabilityRule[];
    schedule?: AvailabilityScheduleSettings;
    serviceSchedules?: ServiceSpecificAvailabilityScheduleSettings[];
};
export type WeeklyAvailabilityWindowInput = {
    /** 0-6 (Sunday-Saturday). */
    weekday: number;
    /** HH:MM. */
    startTime: string;
    /** HH:MM. */
    endTime: string;
};
export type SetWeeklyAvailabilityRequest = {
    windows: WeeklyAvailabilityWindowInput[];
    startTimePolicy?: AvailabilityStartTimePolicyInput;
};
export type AvailabilityStartIntervalMinutes = 10 | 15 | 20 | 30 | 45 | 60;
export type SpecificAvailabilityStartInput = {
    /** 0-6 (Sunday-Saturday). */
    weekday: number;
    /** HH:MM. */
    startTime: string;
};
export type AvailabilityStartTimePolicyInput = {
    kind: 'automatic_spacing';
} | {
    kind: 'regular_interval';
    intervalMinutes: AvailabilityStartIntervalMinutes;
} | {
    kind: 'specific_start_times';
    starts: SpecificAvailabilityStartInput[];
};
export type AvailabilityScheduleSettings = {
    id: string;
    role: {
        kind: 'default';
    } | {
        kind: 'service_specific';
        serviceIds: string[];
    };
    startTimePolicy: AvailabilityStartTimePolicyInput;
    windows: WeeklyAvailabilityWindowInput[];
};
export type ServiceSpecificAvailabilityScheduleSettings = AvailabilityScheduleSettings & {
    role: {
        kind: 'service_specific';
        serviceIds: string[];
    };
};
/**
 * Canonical code-set for the `fieldErrors[]` surfaced through a 400 from
 * `PUT setWeeklyAvailability` when the supplied schedule fails validation.
 * Window issues map to `windows[]` paths, and start-policy issues map to
 * `startTimePolicy.*` paths so the editor can render inline messages.
 *
 * NOT a response variant: success returns `SetWeeklyAvailabilityResponse`
 * directly; failure rides on the dashboard error envelope's `fieldErrors`
 * field with the `code` populated from `SetWeeklyAvailabilityIssue['kind']`.
 */
export type SetWeeklyAvailabilityIssue = {
    kind: 'invalid_time';
    weekday: number;
    index: number;
    field: 'startTime' | 'endTime';
} | {
    kind: 'inverted_window';
    weekday: number;
    index: number;
} | {
    kind: 'overlapping_windows';
    weekday: number;
    firstIndex: number;
    secondIndex: number;
} | {
    kind: 'invalid_regular_interval';
    intervalMinutes: number;
    allowedIntervals: AvailabilityStartIntervalMinutes[];
} | {
    kind: 'invalid_specific_start_time';
    weekday: number;
    index: number;
    value: string;
} | {
    kind: 'invalid_specific_start_weekday';
    weekday: number;
    index: number;
} | {
    kind: 'duplicate_specific_start_time';
    weekday: number;
    firstIndex: number;
    secondIndex: number;
    startTime: string;
} | {
    kind: 'fixed_start_gap_too_short';
    serviceName: string;
    weekday: number;
    firstStart: string;
    secondStart: string;
    requiredGapMinutes: number;
    actualGapMinutes: number;
} | {
    kind: 'invalid_service_assignment';
    serviceId: string;
} | {
    kind: 'duplicate_service_assignment';
    serviceId: string;
};
/**
 * Success response from `PUT setWeeklyAvailability`. Returns the
 * (post-replace-set) list of resource-broad availability rules for the
 * resource — the same shape `GET listAvailabilityRules` returns. Service-
 * scoped rules (`service_id IS NOT NULL`) are filtered out at the service
 * layer to match the editor's mental model.
 */
export type SetWeeklyAvailabilityResponse = {
    rules: AvailabilityRule[];
    schedule?: AvailabilityScheduleSettings;
};
export type SetServiceSpecificAvailabilityRequest = {
    scheduleId?: string;
    serviceIds: string[];
    windows: WeeklyAvailabilityWindowInput[];
    startTimePolicy?: AvailabilityStartTimePolicyInput;
};
export type SetServiceSpecificAvailabilityResponse = {
    schedule: ServiceSpecificAvailabilityScheduleSettings;
};
export type DeleteServiceSpecificAvailabilityResponse = {
    success: boolean;
};
export type AppointmentBlackout = {
    id: string;
    siteId: string;
    resourceId: string | null;
    /** ISO timestamp. */
    startsAt: string;
    /** ISO timestamp. */
    endsAt: string;
    reason: string | null;
    /** ISO timestamp. */
    createdAt: string;
};
export type CreateBlackoutRequest = {
    /** ISO timestamp. */
    startsAt: string;
    /** ISO timestamp. */
    endsAt: string;
    reason?: string | null;
};
export type ListBlackoutsResponse = {
    blackouts: AppointmentBlackout[];
};
export type CreateBlackoutResponse = {
    blackout: AppointmentBlackout;
};
export type DeleteBlackoutResponse = {
    success: boolean;
};
export type TimeSlot = {
    /** ISO timestamp. */
    startAt: string;
    /** ISO timestamp. */
    endAt: string;
    resourceId: string;
};
export type GetAvailableSlotsQuery = {
    serviceId: string;
    resourceId?: string;
    startDate: string;
    endDate: string;
    timezone?: string;
};
export type GetAvailableSlotsResponse = {
    slots: TimeSlot[];
};
export declare function listAvailabilityRulesRequest(apiClient: ApiClient, siteId: string, resourceId: string, options?: RequestInit): Promise<AvailabilityRule[]>;
export declare function setWeeklyAvailabilityRequest(apiClient: ApiClient, siteId: string, resourceId: string, payload: SetWeeklyAvailabilityRequest, options?: RequestInit): Promise<AvailabilityRule[]>;
export declare function listBlackoutsRequest(apiClient: ApiClient, siteId: string, resourceId: string, options?: RequestInit): Promise<AppointmentBlackout[]>;
export declare function createBlackoutRequest(apiClient: ApiClient, siteId: string, resourceId: string, payload: CreateBlackoutRequest, options?: RequestInit): Promise<AppointmentBlackout>;
export declare function deleteBlackoutRequest(apiClient: ApiClient, siteId: string, resourceId: string, blackoutId: string, options?: RequestInit): Promise<void>;
/**
 * Get available appointment slots for a service.
 *
 * GET filters are passed as query parameters.
 */
export declare function getAvailableSlotsRequest(apiClient: ApiClient, siteId: string, query: {
    serviceId: string;
    resourceId?: string;
    startDate: string;
    endDate: string;
    timezone?: string;
}, options?: RequestInit): Promise<TimeSlot[]>;
