import type { Graph, Manifest } from '../graph.js'; import type { EnrichSources } from '../enrich/facade.js'; import type { FormatId } from '../api/format-contract.js'; import type { TargetInput } from '../completeness/types.js'; import type { ArtifactResourcePolicy } from '../recipe/artifact-envelope.js'; import type { OperationSources, ProjectionOptions } from '../api/operation.js'; import type { ConversionContract, ProjectEvidenceInput } from '../completeness/types.js'; export interface ProjectInput { readonly files: Readonly>; } export interface ProjectPathInput { readonly patterns: readonly string[]; readonly cwd?: string; } export type ConvertInput = string | Graph | ProjectInput | ProjectPathInput; export interface ConvertGlobOptions { readonly cwd: string; readonly onlyFiles: true; readonly followSymbolicLinks: false; } export interface ConvertFileSystem { readonly readFile: (path: string) => Promise; readonly glob: (patterns: readonly string[], options: ConvertGlobOptions) => Promise; readonly realpath: (path: string) => Promise; } export interface ConvertCommonOptions extends Omit { readonly contract?: ConversionContract | 'install'; readonly from?: FormatId; readonly sources?: EnrichSources; readonly fs?: ConvertFileSystem; readonly workspaceRoot?: string; readonly manifests?: Record; readonly lineEnding?: 'lf' | 'crlf'; readonly evidence?: readonly ProjectEvidenceInput[]; readonly cacheKey?: string; readonly artifactResources?: ArtifactResourcePolicy; } interface ConvertTargetOptions { readonly target: TargetInput; readonly to?: never; readonly targetVersion?: never; } interface LegacyConvertTargetOptions { readonly target?: never; /** @deprecated Use target. */ readonly to: FormatId; /** @deprecated Use target.managerVersion. */ readonly targetVersion?: string; } export type ConvertOptions = ConvertCommonOptions & (ConvertTargetOptions | LegacyConvertTargetOptions); export type ProjectConvertOptions = Omit & Readonly<{ readonly contract?: 'install'; readonly sources?: Omit; readonly sourceFormat?: FormatId; readonly fs?: ConvertFileSystem; readonly lineEnding?: 'lf' | 'crlf'; readonly evidence?: readonly ProjectEvidenceInput[]; }>; export interface CompanionFile { readonly path: string; readonly content: string; } export interface ProjectOutput { readonly lockfile: string; readonly companions: readonly CompanionFile[]; } export interface ConvertDependencies { readonly fs?: ConvertFileSystem; readonly defaultFileSystem: () => Promise; } export {};