This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
/
opts.d.ts
57 lines (57 loc) · 1.81 KB
/
opts.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
export declare const release_revisions: Revisions;
export declare const supported_versions: Record<Tool, string[]>;
export declare const ghcup_version: string;
export type Revisions = Record<OS, Record<Tool, Array<{
from: string;
to: string;
}>>>;
export type OS = 'linux' | 'darwin' | 'win32';
export type Tool = 'cabal' | 'ghc' | 'stack';
export interface ProgramOpt {
enable: boolean;
raw: string;
resolved: string;
}
export interface Options {
ghc: ProgramOpt;
cabal: ProgramOpt & {
update: boolean;
};
stack: ProgramOpt & {
setup: boolean;
};
general: {
matcher: {
enable: boolean;
};
};
}
type Version = {
version: string;
supported: string[];
};
export type Defaults = Record<Tool, Version> & {
general: {
matcher: {
enable: boolean;
};
};
};
export declare const yamlInputs: Record<string, {
default: string;
}>;
export declare function getDefaults(os: OS): Defaults;
export declare function releaseRevision(version: string, tool: Tool, os: OS): string;
/**
* Convert a string input to a boolean according to the YAML 1.2 "core schema" specification.
* Supported boolean renderings: `true | True | TRUE | false | False | FALSE` .
* ref: https://yaml.org/spec/1.2/spec.html#id2804923
* Adapted from: https://github.com/actions/toolkit/commit/fbdf27470cdcb52f16755d32082f1fee0bfb7d6d#diff-f63fb32fca85d8e177d6400ce078818a4815b80ac7a3319b60d3507354890992R94-R115
*
* @param name name of the input
* @param val supposed string representation of a boolean
* @returns boolean
*/
export declare function parseYAMLBoolean(name: string, val: string): boolean;
export declare function getOpts({ ghc, cabal, stack }: Defaults, os: OS, inputs: Record<string, string>): Options;
export {};