import { PackageGraphOptions } from './package-graph.js'; import type { Graph } from '../graph/index.js'; import type { ModuleNode } from '../types.js'; import type { PackageJson } from 'type-fest'; export type PackageOptions = { packageType?: string; rootPackagePath?: string; name?: string; excludeWorkspaces?: boolean; ignoredPaths?: string[]; }; /** * Package Class * - constructor(path) * - static methods to migrate existing stuff * - manipulation functions * - add/removeDependency * - add/removeDevDependency * - add/removeInRepoDependency * - add/removeInRepoDevDependency * * Implementation Details * - removeInRepo* * - if workspace, manipulate deps and devDeps * - else, remove addon-paths */ export declare class Package { /** * path {string} - the path to this package */ path: string; packageJson: PackageJson; packageName: string; type: string; includePatterns: Set; excludePatterns: Set; workspaceGlobs: string[]; protected graph: Graph | undefined; constructor(path: string, { name, packageType, excludeWorkspaces, ignoredPaths, }?: PackageOptions); /** * EXPLICIT DEPENDENCIES * These the items listed in package.json, different from *required* * dependencies which are actually _used_ by the package (i.e. referenced in the code) * * It is technically possible to have zero dependencies * @return dependencies {object|undefined} */ get dependencies(): Partial> | undefined; /** * These the items listed in package.json * * It is technically possible to have zero devDependencies * @return dependencies {object|undefined} */ get devDependencies(): Partial> | undefined; addWorkspaceGlob(glob: string): this; addIncludePattern(...patterns: string[]): this; addExcludePattern(...patterns: string[]): this; /** * Write the packageJson data to disk. * Writes a async, unlikes reads which are sync, so consumers of this could write * multiple packages at once. */ writePackageJsonToDisk(): void; isConvertedToTypescript(conversionLevel?: string): boolean; hasModuleGraph(): boolean; getModuleGraph(options: PackageGraphOptions): Graph; } export declare function onlyPackage(element: unknown): element is Package; //# sourceMappingURL=package.d.ts.map