UNPKG

2.15 kBTypeScriptView Raw
1import Version, { Status, Row } from './version.js';
2/**
3 * A JSON object representing the status of our {@link Versions} instance.
4 * It contains a `success` property, which can be `true` or `false.
5 * It also contains the various version numbers mapped to arrays based on their status.
6 * @example {"success": true, "passed": ["10.6.0", "10.7.0"]}
7 */
8export type JSONResult = {
9 [status in Status]?: Array<string>;
10} & {
11 success: boolean;
12};
13/** Versions */
14export declare class Versions {
15 /** The list of listeners we will call when updates happen. */
16 listeners: Array<Function>;
17 /** The list of Version instances. */
18 array: Array<Version>;
19 /** Create our Versions instance */
20 constructor(versions: Array<string | number>, listeners?: Array<Function>);
21 /** The comparator to use for sorting an array of versions. */
22 static comparator(left: Version, right: Version): 1 | -1 | 0;
23 /** Add version(s) to the list. */
24 add(versions: Array<string | number> | string | number): this;
25 /** Get version(s) from the list. */
26 get(version: string): Version | null;
27 /** Sort our versions by our comparator. */
28 sort(): this;
29 /** Compact versions that share the same exact version number together. */
30 compact(): this;
31 /** Unless every version of ours was successful, then this will be `false`. */
32 get success(): boolean;
33 /** Get how many versions we have. */
34 get length(): number;
35 /** Get the results of our versions as a JSON object. */
36 get json(): JSONResult;
37 /** An array of {@link Version.row} results for use of displaying our status as a neat table. */
38 get table(): Array<Row>;
39 /** An array of the {@link Version.message} results for use of displaying detailed status updates of each version. */
40 get messages(): Array<string>;
41 /** Loads each of our versions. */
42 load(compact?: boolean): Promise<this>;
43 /** Installs any missing versions. */
44 install(): Promise<this>;
45 /** Runs the test for each version. */
46 test(command: string, serial?: boolean): Promise<this>;
47}
48export default Versions;
49//# sourceMappingURL=versions.d.ts.map
\No newline at end of file