aws-cdk
Version:
AWS CDK Toolkit CLI, the command line tool for CDK apps
39 lines (38 loc) • 1.37 kB
TypeScript
import type * as https from 'node:https';
import type { IoHelper } from '../api-private';
export declare class VersionCheckTTL {
static timestampFilePath(): string;
private readonly file;
private readonly ttlSecs;
constructor(file?: string, ttlSecs?: number);
hasExpired(): Promise<boolean>;
update(latestVersion?: string): Promise<void>;
}
export declare function getVersionMessages(currentVersion: string, cacheFile: VersionCheckTTL, agent?: https.Agent): Promise<string[]>;
export declare function shouldDisplayVersionMessage(): boolean;
/**
* Options for {@link displayVersionMessage}
*/
export interface DisplayVersionMessageOptions {
/**
* The version of the CLI that is currently running
*
* @default - the version of this package
*/
readonly currentVersion?: string;
/**
* The cache used to limit how often the version check runs
*
* @default - a TTL cache in the CDK cache directory
*/
readonly versionCheckCache?: VersionCheckTTL;
/**
* The agent used for the network request to the npm registry
*
* Use this to set up a proxy connection.
*
* @default - the shared global node agent
*/
readonly agent?: https.Agent;
}
export declare function displayVersionMessage(ioHelper: IoHelper, options?: DisplayVersionMessageOptions): Promise<void>;