UNPKG

@rushstack/lockfile-explorer

Version:

Rush Lockfile Explorer: The UI for solving version conflicts quickly in a large monorepo

77 lines 2.24 kB
/** * TODO: If we end up expecting to use this elsewhere, we should move this to * either its own package or into `@rushstack/node-core-library`. */ /** * Options for {@link _PackageUpdateChecker}. * * @internal */ export interface IPackageUpdateCheckerOptions { /** * The npm package name to check for updates. */ packageName: string; /** * The currently installed version. */ currentVersion: string; /** * If `true`, skip the update check entirely. * Use this to suppress checks in CI environments or non-interactive sessions. * * @defaultValue false */ skip?: boolean; /** * If `true`, bypass the cache and always fetch from the registry. * Useful in debug/verbose modes where you want an immediate, authoritative answer. * * @defaultValue false */ forceCheck?: boolean; /** * How long (in milliseconds) to consider a cached registry response fresh * before re-fetching. * * @defaultValue 86400000 (24 hours) */ cacheExpiryMs?: number; } /** * The result of an update check. * * @internal */ export interface IPackageUpdateResult { /** * The latest version available on the registry. */ latestVersion: string; /** * `true` if {@link _IPackageUpdateResult.latestVersion} is strictly newer than * the {@link _IPackageUpdateCheckerOptions.currentVersion} that was passed to the checker. */ isOutdated: boolean; } /** * Checks npm for a newer version of a package and caches the result locally so that * the registry is not queried on every invocation. * * @internal */ export declare class PackageUpdateChecker { private readonly _packageName; private readonly _currentVersion; private readonly _skip; private readonly _forceCheck; private readonly _cacheExpiryMs; constructor(options: IPackageUpdateCheckerOptions); /** * Performs the update check and returns the result, or `undefined` if the check * was skipped or the registry could not be reached. */ tryGetUpdateAsync(): Promise<IPackageUpdateResult | undefined>; private _getCacheFilePath; } //# sourceMappingURL=PackageUpdateChecker.d.ts.map