package.src.utilities.package-metadata.d.ts Maven / Gradle / Ivy
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/
import { logging } from '@angular-devkit/core';
import type { Manifest, Packument } from 'pacote';
export interface PackageMetadata extends Packument, NgPackageManifestProperties {
tags: Record;
versions: Record;
}
export interface NpmRepositoryPackageJson extends PackageMetadata {
requestedName?: string;
}
export type NgAddSaveDependency = 'dependencies' | 'devDependencies' | boolean;
export interface PackageIdentifier {
type: 'git' | 'tag' | 'version' | 'range' | 'file' | 'directory' | 'remote';
name: string;
scope: string | null;
registry: boolean;
raw: string;
fetchSpec: string;
rawSpec: string;
}
export interface NgPackageManifestProperties {
'ng-add'?: {
save?: NgAddSaveDependency;
};
'ng-update'?: {
migrations?: string;
packageGroup?: string[] | Record;
packageGroupName?: string;
requirements?: string[] | Record;
};
}
export interface PackageManifest extends Manifest, NgPackageManifestProperties {
deprecated?: boolean;
}
export declare function fetchPackageMetadata(name: string, logger: logging.LoggerApi, options?: {
registry?: string;
usingYarn?: boolean;
verbose?: boolean;
}): Promise;
export declare function fetchPackageManifest(name: string, logger: logging.LoggerApi, options?: {
registry?: string;
usingYarn?: boolean;
verbose?: boolean;
}): Promise;
export declare function getNpmPackageJson(packageName: string, logger: logging.LoggerApi, options?: {
registry?: string;
usingYarn?: boolean;
verbose?: boolean;
}): Promise>;