nginx-binaries
Version:
A downloader for nginx and njs standalone binaries.
90 lines • 2.51 kB
TypeScript
/**
* Expected version of the index file.
* Keep in sync with FORMAT_VERSION in scripts/generate-index!
*/
export declare const FORMAT_VERSION = 2;
export interface IndexFile {
formatVersion: number;
contents: IndexEntry[];
}
export interface IndexEntry {
/**
* Name of the program (`nginx` or `njs`).
*/
name: string;
/**
* Version of the program.
*/
version: string;
/**
* The build variant of the binary (e.g. `debug`).
* An empty string indicates the default variant.
*/
variant: string;
/**
* OS platform for which this binary was built.
*/
os: Platform;
/**
* CPU architecture for which this binary was built.
*/
arch: Arch;
/**
* Full name of the binary file.
*/
filename: string;
/**
* Date and time (ISO-8601) at which the binary was built.
*/
date: string;
/**
* Size of the binary file in bytes.
*/
size: number;
/**
* Checksum of the binary file in format `<algorithm>:<hash>`.
*
* @example 'sha1:7336b675b26bd67fdda3db18c66fa7f64691e280'
*/
checksum: string;
/**
* A record of all libraries (or modules) statically linked into the binary
* and the version number.
*
* @example
* {
* 'openssl': '1.1.1i-r0',
* 'echo-nginx-module': '0.62',
* }
*/
bundledLibs: Record<string, string>;
}
type Platform = 'linux' | 'darwin' | 'win32';
type Arch = 'armv7' | 'arm' | 'aarch64' | 'arm64' | 'ppc64le' | 'x86_64' | 'x64';
export interface Query {
/**
* Specify required version as exact version number or a SemVer version range.
*
* @example '1.8.0', '1.8.x', '^1.8.0'
* @see https://github.com/npm/node-semver#ranges
*/
version?: string;
/**
* Specify build variant of the binary (e.g. `debug`).
* Defaults to an empty string, i.e. the default variant.
*/
variant?: string;
/**
* Specify target OS. Defaults to the host OS.
*/
os?: Platform;
/**
* Specify target CPU architecture. Defaults to the host architecture.
*/
arch?: Arch;
}
export declare function getIndex(repoUrl: string, cacheDir: string, fetchTimeout: number, cacheMaxAge: number): Promise<IndexFile>;
export declare function queryIndex(index: IndexFile, name: string, query: Query): IndexEntry[];
export declare const formatQuery: (query: Query) => string;
export {};
//# sourceMappingURL=repoIndex.d.ts.map