diff options
Diffstat (limited to 'editors/code/src/installation/interfaces.ts')
-rw-r--r-- | editors/code/src/installation/interfaces.ts | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/editors/code/src/installation/interfaces.ts b/editors/code/src/installation/interfaces.ts index 03eac5b79..8039d0b90 100644 --- a/editors/code/src/installation/interfaces.ts +++ b/editors/code/src/installation/interfaces.ts | |||
@@ -12,42 +12,44 @@ export interface ArtifactMetadata { | |||
12 | } | 12 | } |
13 | 13 | ||
14 | /** | 14 | /** |
15 | * Type tag for `BinarySource` discriminated union. | ||
16 | */ | ||
17 | export enum BinarySourceType { ExplicitPath, GithubBinary } | ||
18 | |||
19 | /** | ||
20 | * Represents the source of a binary artifact which is either specified by the user | 15 | * Represents the source of a binary artifact which is either specified by the user |
21 | * explicitly, or bundled by this extension from GitHub releases. | 16 | * explicitly, or bundled by this extension from GitHub releases. |
22 | */ | 17 | */ |
23 | export type BinarySource = ExplicitPathSource | GithubBinarySource; | 18 | export type BinarySource = BinarySource.ExplicitPath | BinarySource.GithubRelease; |
24 | |||
25 | |||
26 | export interface ExplicitPathSource { | ||
27 | type: BinarySourceType.ExplicitPath; | ||
28 | 19 | ||
20 | export namespace BinarySource { | ||
29 | /** | 21 | /** |
30 | * Filesystem path to the binary specified by the user explicitly. | 22 | * Type tag for `BinarySource` discriminated union. |
31 | */ | 23 | */ |
32 | path: string; | 24 | export const enum Type { ExplicitPath, GithubRelease } |
33 | } | ||
34 | 25 | ||
35 | export interface GithubBinarySource { | 26 | export interface ExplicitPath { |
36 | type: BinarySourceType.GithubBinary; | 27 | type: Type.ExplicitPath; |
37 | 28 | ||
38 | /** | 29 | /** |
39 | * Repository where the binary is stored. | 30 | * Filesystem path to the binary specified by the user explicitly. |
40 | */ | 31 | */ |
41 | repo: GithubRepo; | 32 | path: string; |
33 | } | ||
42 | 34 | ||
43 | /** | 35 | export interface GithubRelease { |
44 | * Directory on the filesystem where the bundled binary is stored. | 36 | type: Type.GithubRelease; |
45 | */ | 37 | |
46 | dir: string; | 38 | /** |
39 | * Repository where the binary is stored. | ||
40 | */ | ||
41 | repo: GithubRepo; | ||
42 | |||
43 | /** | ||
44 | * Directory on the filesystem where the bundled binary is stored. | ||
45 | */ | ||
46 | dir: string; | ||
47 | |||
48 | /** | ||
49 | * Name of the binary file. It is stored under the same name on GitHub releases | ||
50 | * and in local `.dir`. | ||
51 | */ | ||
52 | file: string; | ||
53 | } | ||
47 | 54 | ||
48 | /** | ||
49 | * Name of the binary file. It is stored under the same name on GitHub releases | ||
50 | * and in local `.dir`. | ||
51 | */ | ||
52 | file: string; | ||
53 | } | 55 | } |