import * as esbuild from 'esbuild'; export type ShippedPackageKind = 'project' | 'bundled' | 'external'; export interface ShippedPackage { kind: ShippedPackageKind; name: string; version?: string; declaredLicense?: string; /** Only for the project, the package.json license of its own source, which declaredLicense distributes it under */ sourceLicense?: string; /** Where recipients can obtain the source of this package, as required by MPL-2.0 and the GPL family */ repositoryUrl?: string; packageRoot: string; contributingPaths: Set; } export interface MetafilePackageCollection { packages: ShippedPackage[]; diagnostics: string[]; } export interface LegalText { role: 'license' | 'notice' | 'source-comment'; filename: string; content: string; sha256: string; } export interface ShippedPackageLegalRecord extends ShippedPackage { legalTexts: LegalText[]; } export interface PackageLegalMaterial { package: ShippedPackageLegalRecord; diagnostics: string[]; } export interface LegalInventory { packages: ShippedPackageLegalRecord[]; diagnostics: string[]; } type PackageJson = { name?: string; version?: string; license?: unknown; licenses?: unknown; repository?: unknown; homepage?: unknown; }; export declare function normalizeRepositoryUrl(packageJson: PackageJson): string | undefined; export declare function normalizeInventoryPath(inputPath: string, ownerRoot: string): string; export declare function collectInstalledPackages(nodeModulesDir: string): Promise; export declare function normalizeLegalText(content: string): string; export declare function collectPackageLegalMaterial(packageInfo: ShippedPackage): Promise; export declare function renderLicenseFile(inventory: LegalInventory): string; export declare function renderNoticeFile(inventory: LegalInventory): string | undefined; export declare function writeLegalArtifacts(outputDir: string, inventory: LegalInventory): Promise; export declare function createLegalInventory(packages: ShippedPackage[]): Promise; export declare function analyzeShippedLegalInventory(moduleDir: string): Promise; export declare function collectMetafilePackages(moduleDir: string, metafile: esbuild.Metafile): Promise; export {};