//#region src/utils/github.d.ts interface GitHubClient { resolveRef: (owner: string, repo: string, ref: string) => Promise; readFile: (owner: string, repo: string, ref: string, path: string) => Promise; } //#endregion //#region src/types.d.ts interface ActionspackOptions { cwd?: string; entries?: WorkflowEntry[]; external?: string[]; github?: GitHubClient; stdout?: WritableStream; stderr?: WritableStream; } interface WritableStream { write: (chunk: string) => void; } interface WorkflowEntry { source: string; output: string; } interface ActionspackConfig { entries: WorkflowEntry[]; external: string[]; } interface LockDependency { package: string; requested: string; resolved?: string; foundAt?: string; } interface LockEntry { output: string; dependencies: LockDependency[]; } interface LockPackage { source: "github"; owner: string; repo: string; path: string; requested: string; resolved: string; type: "composite" | "external-action" | "external-workflow" | "reusable-workflow"; external?: boolean; contentDigest: string; dependencies: LockDependency[]; } interface Lockfile { lockfileVersion: 1; entries: Record; packages: Record; } interface RemoteRef { owner: string; repo: string; path: string; ref: string; package: string; kind: "action" | "reusable-workflow"; } interface ScanOptions extends ActionspackOptions { refreshPackages?: Set; } interface UpdateOptions extends ActionspackOptions { packageName?: string; lockfileOnly?: boolean; } interface DiffOptions extends ActionspackOptions { json?: boolean; } interface DiffResult { added: string[]; removed: string[]; changed: Array<{ package: string; oldResolved: string; newResolved: string; dependencyChanged: boolean; }>; } interface CommandResult { lockfile: Lockfile; entries: WorkflowEntry[]; } //#endregion //#region src/pack.d.ts declare function pack(options?: ActionspackOptions): Promise; declare function verify(options?: ActionspackOptions): Promise; declare function packWorkflow(workflow: Record, lockfile: Lockfile, github: GitHubClient): Promise>; declare function assertNoRemoteUses(value: unknown, file?: string): void; //#endregion //#region src/scan.d.ts interface ResolvedDependency extends LockDependency { remote: RemoteRef; } declare function scan(options?: ScanOptions): Promise; declare function collectWorkflowDependencies(workflow: Record, source: string): ResolvedDependency[]; declare function collectStepDependencies(steps: unknown[], foundAtPrefix: string): ResolvedDependency[]; //#endregion //#region src/commands.d.ts declare function update(options?: UpdateOptions): Promise; declare function tree(options?: ActionspackOptions): Promise; declare function why(packageName: string, options?: ActionspackOptions): Promise; declare function diff(options?: DiffOptions): Promise; declare function diffLockfiles(previous: Lockfile, current: Lockfile): DiffResult; //#endregion export { type ActionspackConfig, type ActionspackOptions, type CommandResult, type DiffOptions, type DiffResult, type GitHubClient, type LockDependency, type LockEntry, type LockPackage, type Lockfile, type UpdateOptions, type WorkflowEntry, assertNoRemoteUses, collectStepDependencies, collectWorkflowDependencies, diff, diffLockfiles, pack, packWorkflow, scan, tree, update, verify, why };