forked from microsoft/vscode-arduino
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage.ts
253 lines (211 loc) · 5.25 KB
/
package.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
/**
* Interface that represents an individual package contributor from Arduino package index.
* @interface
*/
export interface IPackage {
/**
* Package name
* @property {string}
*/
name: string;
/**
* Package author email
* @property {string}
*/
email: string;
/**
* Package maintainer
* @property {string}
*/
maintainer: string;
/**
* Package support website URL
* @property {string}
*/
websiteURL: string;
/**
* Help information include online link(s)
* @property: {any}
*/
help: any;
/**
* Supported platforms that contain in this package.
* @property {IPlatform[]}
*/
platforms: IPlatform[];
/**
* Provided tools that contain in this package.
*/
tools: Array<object>;
}
/**
* Interface that represents the supported platforms from the contribution packages.
*
* The interface has merged all the supported versions.
*
* @interface
*/
export interface IPlatform {
/**
* Platform name
* @property {string}
*/
name: string;
/**
* Targeting architecture of the platform.
* @property {string}
*/
architecture: string;
/**
* Category, can be these values: "Arduino", "Arduino Certified", "Partner", "ESP8266", ...
* @property {string}
*/
category: string;
/**
* Provide URL of the platform
* @property {string}
*/
url: string;
/**
* Whether is the default platform come with the installation.
* @property {boolean}
*/
defaultPlatform?: boolean;
/**
* The raw version when load the object from json object. This value should not be used after the
* platforms information has been parsed.
* @property {string}
*/
version: string;
/**
* All supported version fro this platform.
* @property {string[]}
*/
versions: string[];
/**
* Installed platform on the local Arduino IDE
* @property {string}
*/
installedVersion: string;
/**
* Root path that contains all the files, board description under the specified version.
* @property {string}
*/
rootBoardPath: string;
/**
* The board descriptor information supported by this platform.
* @property {IBoard[]}
*/
boards: any[];
/**
* Help information object include online link(s).
* @property {any}
*/
help: any;
/**
* Parent package information
* @property {IPackage}
*/
package?: IPackage;
/**
* For custom package, only package name available.
* @property {packageName}
*/
packageName?: string;
}
export interface IBoardConfigOption {
id: string;
displayName: string;
}
export interface IBoardConfigItem {
displayName: string;
id: string;
selectedOption: string;
options: IBoardConfigOption[];
}
/**
* Interface for classes that represent an Arduino supported board.
*
* @interface
*/
export interface IBoard {
/**
* Unique key that represent the board in the package:arch:alias.
* @property {string}
*/
key: string;
/**
* Board aliasname for Arduino compilation such as `huzzah`, `yun`
* @property {string}
*/
board: string;
/**
* The human readable name displayed on the Arduino IDE Boards Manager
* @property {string}
*/
name?: string;
/**
* Reference to the platform that contains this board.
* @prop {IPlatform}
*/
platform: IPlatform;
/**
* Custom configuration for the Arduino board
* @property {string}
*/
customConfig: string;
/**
* Custom board's configuration items.
* @property {IBoardConfigItem[]}
*/
configItems: IBoardConfigItem[];
/**
* Board's parameter values.
*/
addParameter(key: string, value: string): void;
/**
* Get board specified build configuration.
*/
getBuildConfig(): string;
/**
* Load default configuration from saved context.
*/
loadConfig(configString: string): void;
/**
* Update the configuration
*/
updateConfig(configId: string, optionId: string): boolean;
/**
* Get the board package name
*/
getPackageName();
}
/**
* Interface for classes that represent an Arduino supported programmer.
*
* @interface
*/
export interface IProgrammer {
/**
* Unique key that represent the programmer in the package:name.
* @property {string}
*/
key: string;
/**
* Programmer name for Arduino compilation such as `avrisp`, `atmel_ice`
* @property {string}
*/
name: string;
/**
* The human readable name displayed in the Arduino programmer selection menu
* @property {string}
*/
displayName: string;
/**
* Reference to the platform that contains this board.
* @prop {IPlatform}
*/
platform: IPlatform;
}