v3 new release (#101)

This commit is contained in:
github-actions[bot]
2022-10-27 10:04:25 -04:00
committed by GitHub
parent b5b231a831
commit f382f75448
717 changed files with 4912 additions and 33943 deletions

View File

@ -1,3 +1,6 @@
/// <reference types="node" />
import * as mm from './manifest';
import { OutgoingHttpHeaders } from 'http';
export declare class HTTPError extends Error {
readonly httpStatusCode: number | undefined;
constructor(httpStatusCode: number | undefined);
@ -6,9 +9,12 @@ export declare class HTTPError extends Error {
* Download a tool from an url and stream it into a file
*
* @param url url of tool to download
* @param dest path to download tool
* @param auth authorization header
* @param headers other headers
* @returns path to downloaded tool
*/
export declare function downloadTool(url: string): Promise<string>;
export declare function downloadTool(url: string, dest?: string, auth?: string, headers?: OutgoingHttpHeaders): Promise<string>;
/**
* Extract a .7z file
*
@ -26,14 +32,23 @@ export declare function downloadTool(url: string): Promise<string>;
*/
export declare function extract7z(file: string, dest?: string, _7zPath?: string): Promise<string>;
/**
* Extract a tar
* Extract a compressed tar archive
*
* @param file path to the tar
* @param dest destination directory. Optional.
* @param flags flags for the tar. Optional.
* @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
* @returns path to the destination directory
*/
export declare function extractTar(file: string, dest?: string, flags?: string): Promise<string>;
export declare function extractTar(file: string, dest?: string, flags?: string | string[]): Promise<string>;
/**
* Extract a xar compatible archive
*
* @param file path to the archive
* @param dest destination directory. Optional.
* @param flags flags for the xar. Optional.
* @returns path to the destination directory
*/
export declare function extractXar(file: string, dest?: string, flags?: string | string[]): Promise<string>;
/**
* Extract a zip
*
@ -77,3 +92,20 @@ export declare function find(toolName: string, versionSpec: string, arch?: strin
* @param arch optional arch. defaults to arch of computer
*/
export declare function findAllVersions(toolName: string, arch?: string): string[];
export declare type IToolRelease = mm.IToolRelease;
export declare type IToolReleaseFile = mm.IToolReleaseFile;
export declare function getManifestFromRepo(owner: string, repo: string, auth?: string, branch?: string): Promise<IToolRelease[]>;
export declare function findFromManifest(versionSpec: string, stable: boolean, manifest: IToolRelease[], archFilter?: string): Promise<IToolRelease | undefined>;
/**
* Check if version string is explicit
*
* @param versionSpec version string to check
*/
export declare function isExplicitVersion(versionSpec: string): boolean;
/**
* Get the highest satisfiying semantic version in `versions` which satisfies `versionSpec`
*
* @param versions array of versions to evaluate
* @param versionSpec semantic version spec to satisfy
*/
export declare function evaluateVersions(versions: string[], versionSpec: string): string;