/**
 * Copyright (C) 2024 Hedera Hashgraph, LLC
 *
 * Licensed under the Apache License, Version 2.0 (the ""License"");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an ""AS IS"" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
import { type Lease, type LeaseRenewalService } from './lease.js';
import { Duration } from '../time/duration.js';
/**
 * Implements a lease renewal service which utilizes a setInterval() based approach to renew leases at regular intervals.
 * The renewal delay is calculated as half the duration of the lease in seconds.
 */
export declare class IntervalLeaseRenewalService implements LeaseRenewalService {
    /** The internal registry used to track all non-cancelled lease renewals. */
    private readonly _scheduledLeases;
    /**
     * Constructs a new interval lease renewal service.
     */
    constructor();
    /**
     * Determines if a lease renewal is scheduled.
     * This implementation uses the internal registry to track all non-cancelled lease renewals.
     *
     * @param scheduleId - the unique identifier of the scheduled lease renewal.
     * @returns true if the lease renewal is scheduled; false otherwise.
     */
    isScheduled(scheduleId: number): Promise<boolean>;
    /**
     * Schedules a lease renewal.
     * This implementation uses the setInterval() method to renew the lease at regular intervals.
     *
     * @param lease - the lease to be renewed.
     * @returns the unique identifier of the scheduled lease renewal. The unique identifier is the ID of the setInterval() timeout.
     */
    schedule(lease: Lease): Promise<number>;
    /**
     * Cancels a scheduled lease renewal.
     * This implementation uses the clearInterval() method to cancel the scheduled lease renewal.
     * Due to the nature of the setInterval()/clearInterval() methods, the scheduled event may still fire at least once
     * after the cancellation.
     *
     * @param scheduleId - the unique identifier of the scheduled lease renewal. The unique identifier is the ID of the setInterval() timeout.
     * @returns true if the lease renewal was previously scheduled; false otherwise.
     */
    cancel(scheduleId: number): Promise<boolean>;
    /**
     * Cancels all scheduled lease renewals.
     * This implementation cancels all scheduled lease renewals by iterating over the internal registry and clearing each timeout.
     * @returns a map of the unique identifiers of the scheduled lease renewals and their cancellation status.
     */
    cancelAll(): Promise<Map<number, boolean>>;
    /**
     * Calculates the delay before the next lease renewal.
     * This implementation calculates the renewal delay as half the duration of the lease.
     *
     * @param lease - the lease to be renewed.
     * @returns the delay in milliseconds.
     */
    calculateRenewalDelay(lease: Lease): Duration;
}
