import { type LockfileErrorCode } from './errors.js'; import type { Diagnostic, Graph, HostingProvider, TarballKey } from '../graph.js'; import type { PmConfigEvidence, TargetInput } from '../completeness/types.js'; import type { ArtifactSourceList } from '../enrich/artifact-sources.js'; import type { Store } from '../enrich/artifact-store.js'; import type { RegistryAdapter } from '../registry/types.js'; import { type ArtifactResourcePolicy } from '../recipe/artifact-envelope.js'; export type DiagnosticSeverity = Diagnostic['severity']; export type DiagnosticCode = LockfileErrorCode | 'STORE_PATH_RESOLVED' | 'STORE_CANDIDATE_CORRUPT' | 'STORE_READ_FAILED' | 'STORE_WRITE_FAILED' | 'STORE_CAPACITY_EXCEEDED' | 'STORE_EVICTION_FAILED' | 'CONVERT_FROZEN_ORACLE_MISMATCH' | `BUN_${string}` | `COMPLETENESS_${string}` | `COMPLETION_${string}` | `CONVERT_${string}` | `DENO_${string}` | `ENRICH_${string}` | `INTEROP_${string}` | `LAYOUT_${string}` | `MODIFY_${string}` | `NPM_${string}` | `OVERRIDE_${string}` | `PNPM_${string}` | `PROJECTION_${string}` | `PRUNE_${string}` | `RECIPE_${string}` | `YARN_${string}`; export type DiagnosticObserver = (diagnostic: Diagnostic) => void; export interface ObserveOptions { readonly onDiagnostic?: DiagnosticObserver; } export interface OperationResult { readonly diagnostics: readonly Diagnostic[]; } export interface GraphOperationResult extends OperationResult { readonly graph: Graph; } export type PackageManager = 'npm' | 'pnpm' | 'yarn' | 'bun' | 'deno' | 'lockgraph'; export type Resolution = Readonly<{ kind: 'registry'; bind?: string; }> | Readonly<{ kind: 'tarball'; url: string; hostingProvider?: HostingProvider; bind?: string; }> | Readonly<{ kind: 'git'; url: string; sha: string; hostingProvider?: HostingProvider; }> | Readonly<{ kind: 'directory'; path: string; }> | Readonly<{ kind: 'unknown'; raw: string; }>; export type ByteSize = `${number} ${'B' | 'kB' | 'MB' | 'GB' | 'KiB' | 'MiB' | 'GiB'}`; export interface GuardProfile { readonly patterns?: readonly TarballKey[]; readonly artifactCompressed?: ByteSize; readonly artifactInflated?: ByteSize; readonly artifactTarContent?: ByteSize; readonly artifactRepacked?: ByteSize; readonly artifactLive?: ByteSize; readonly networkTraffic?: ByteSize; } export type ArtifactSource = ArtifactSourceList[number]; export type FileSource = readonly string[] | Readonly>; export interface OperationSources { readonly manifests?: FileSource; readonly policy?: PmConfigEvidence; readonly packuments?: readonly RegistryAdapter[]; readonly artifacts?: ArtifactSourceList; } export interface OperationOptions extends ObserveOptions { readonly target: TargetInput; readonly registry?: string; readonly sources?: OperationSources; readonly cwd?: string; readonly guards?: readonly GuardProfile[]; readonly store?: Store | false; } export interface ProjectionOptions extends OperationOptions { readonly strict?: boolean; } export declare function parseByteSize(value: ByteSize, field?: string): number; interface NormalizedGuards { readonly artifactResources?: ArtifactResourcePolicy; readonly maxNetworkTrafficBytes: number; readonly networkTrafficOrigin: 'default' | 'global'; } export declare function normalizeGuardProfiles(profiles: readonly GuardProfile[] | undefined): NormalizedGuards; export {};