import { PackageInfo } from "./PackageInfo"; /** * Base class for a local or remote source of OpenT2T packages. Also serves * as a factory for various package source subclasses. The factory pattern is * used to reduce the surface area of APIs exported from the library (and * projected to applications). */ export declare abstract class PackageSource { /** * Creates a new local package source with a specified source directory. * * @param {string} sourceDirectory Path to a package source directory, or * a node_modules directory where packages are installed. */ static createLocalPackageSource(sourceDirectory: string): PackageSource; /** * Creates a combined prioritized view over multiple package sources. * * @param {IPackageSource[]} sources Array of package sources in priority order. */ static createUnion(sources: PackageSource[]): PackageSource; /** * Gets information about all OpenT2T packages currently available from the source. * This method is optional; it may not be implemented for remote sources. * CAUTION: This is a potentially slow operation. * * @returns {Promise} An array of package information * objects, or an empty array if the cache is empty */ getAllPackageInfoAsync?(): Promise; /** * Gets information about an OpenT2T package from the source * (potentially without downloading the whole package). * * @param {string} name Name of the package * @returns {(Promise; /** * Downloads or copies a package to a target (cache) directory. * * @param {string} name Name of the package * @param {string} targetDirectory Directory where the package is to be extracted */ abstract copyPackageAsync(name: string, targetDirectory: string): Promise; }