import { type RuntimeCapacityQueuedRequest } from "./runtime-capacity-scheduler-helpers.js"; import type { RuntimeCapacityCounters } from "./runtime-capacity-policy.js"; import type { RuntimeWorkerRegistry } from "./runtime-worker-registry.js"; import type { RuntimeCapacitySchedulerEvent, RuntimeCapacityScope, RuntimeLease, RuntimeScheduleDecision, RuntimeScheduleReasonCode, RuntimeScheduleRequest } from "./types.js"; export type RuntimeLeaseRecord = { request: RuntimeScheduleRequest; lease: RuntimeLease; startedAt: number; }; export declare class RuntimeCapacitySchedulerState { private readonly queue; private readonly leases; private readonly events; private rejected; private nextDecision; private nextQueue; private nextLease; activeRecords(): RuntimeLeaseRecord[]; queuedRequests(): RuntimeCapacityQueuedRequest[]; rejectedCount(): number; counters(): RuntimeCapacityCounters; drainEvents(): RuntimeCapacitySchedulerEvent[]; releaseLease(leaseId: string, registry: RuntimeWorkerRegistry): RuntimeLeaseRecord | undefined; admit(request: RuntimeScheduleRequest, workerId: string, registry: RuntimeWorkerRegistry): RuntimeScheduleDecision; queueRequest(request: RuntimeScheduleRequest, reasonCode: RuntimeScheduleReasonCode): RuntimeScheduleDecision; reject(request: RuntimeScheduleRequest, scope: RuntimeCapacityScope, reasonCode: RuntimeScheduleReasonCode, userSafeReason: string): RuntimeScheduleDecision; decision({ status, request, reasonCode, userSafeReason, workerId, lease, queue, }: { status: RuntimeScheduleDecision["status"]; request: RuntimeScheduleRequest; reasonCode: RuntimeScheduleReasonCode; userSafeReason: string; workerId?: string; lease?: RuntimeLease; queue?: RuntimeScheduleDecision["queue"]; }): RuntimeScheduleDecision; sortQueue(): void; removeQueuedAt(index: number): void; recordPromoted({ decision, queued, workerId, }: { decision: RuntimeScheduleDecision; queued: RuntimeCapacityQueuedRequest; workerId: string; }): void; private nextDecisionId; }