/**
 * This package canary monitors the availability of the versions of a specified
 * package in the ConstructHub catalog. It publishes metrics that help
 * understand how much time passes between a pakcage appearing in the public
 * registry and it's availability in the ConstructHub instance.
 *
 * From the moment a package has been published, and until it appeared in
 * catalog, the `MetricName.DWELL_TIME` metric is emitted.
 *
 * Once the package has appeared in catalog, and until a new package version is
 * identified in npmjs.com, the `MetricName.TIME_TO_CATALOG` metric is emitted.
 *
 * If a new package version is published before the previous one has appeared
 * in catalog, both versions will be tracked at the same time, and the metrics
 * will receive one sample per tracked version.
 */
export declare function handler(event: unknown): Promise<void>;
export declare class CanaryStateService {
    private readonly bucketName;
    constructor(bucketName: string);
    /**
     * Save the state to the bucket.
     */
    save(packageName: string, state: CanaryState): Promise<void>;
    /**
     * Load the state file for this package from the bucket.
     */
    load(packageName: string): Promise<CanaryState | undefined>;
    /**
     * Create a state from the latest version of the package.
     */
    latest(packageName: string): Promise<CanaryState['latest']>;
    isNpmReplicaDown(): Promise<boolean>;
    /**
     * Estimate how far behind the NPM replica is compared to the live NPM
     * registry. If the NPM replica is down, return undefined.
     */
    npmReplicaLagSeconds(packageName: string): Promise<number | undefined>;
    private key;
    private url;
}
export declare class HTTPError extends Error {
    readonly httpStatusCode: number | undefined;
    constructor(httpStatusCode: number | undefined, message: string);
}
export declare class TimeoutError extends Error {
    constructor(message: string);
}
interface CanaryState {
    /**
     * The latest package version, as of the last execution of the canary.
     */
    latest: {
        /**
         * The version we are tracking.
         */
        readonly version: string;
        /**
         * The publish date of the version.
         */
        readonly publishedAt: Date;
        /**
         * The date at which the version is available on the hub.
         */
        availableAt?: Date;
    };
    /**
     * Each existing, but not-yet-found versions that are still tracked.
     */
    pending: {
        [version: string]: {
            /**
             * The version we are tracking.
             */
            readonly version: string;
            /**
             * The publish date of the version.
             */
            readonly publishedAt: Date;
            /**
             * These pending packages are NEVER available at this point.
             */
            availableAt: undefined;
        };
    };
}
export {};
