import type { TargetEnvironment } from './TargetEnvironment.js'; /** * Serializable representation of the package hashes cache. */ export interface SerializablePackageHashesCache { hashesWithSource: { browser: Record; node: Record; }; hashesWithNoSource: { browser: Record; node: Record; }; } /** * Utility class for hashing packages and caching the results. */ export interface PackageHashesCache { /** * Gets the hash for a given package path. This is useful for caching, to determine if the package has changed. * If the package definition has not been read, it will be read and cached. * @returns The hash for the package. */ get(input: PackageHashOptions): Promise; /** * Creates a serializable representation of the cache. */ toSerializable(): SerializablePackageHashesCache; /** * Sets the hash for a given package path. This is useful when the hash needs to be set manually (e.g. link). */ set(input: Omit, hash: string): void; /** * Extends the cache with a serializable representation of the cache. * This is useful for merging caches from different sources (e.g. link). */ extend(input: SerializablePackageHashesCache): void; } /** * Options for hashing a package (`PackageHashes.get`). */ export interface PackageHashOptions { /** The package path to get the hash for. */ packagePath: string; /** The target environment to hash for. */ targetEnvironment: TargetEnvironment; /** Whether or not to hash the source files. */ isSourceHashingEnabled: boolean; /** Whether to force a re-calculation of the hash. */ shouldRecalculate?: boolean; } //# sourceMappingURL=PackageHashesCache.d.ts.map