-
-
Notifications
You must be signed in to change notification settings - Fork 436
/
Copy patharduino-component.ts
34 lines (33 loc) · 972 Bytes
/
arduino-component.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
import { Installable } from './installable';
export interface ArduinoComponent {
readonly name: string;
readonly deprecated?: boolean;
readonly author: string;
readonly summary: string;
readonly description: string;
readonly moreInfoLink?: string;
readonly availableVersions: Installable.Version[];
readonly installable: boolean;
readonly installedVersion?: Installable.Version;
/**
* This is the `Type` in IDE (1.x) UI.
*/
readonly types: string[];
}
export namespace ArduinoComponent {
export function is(arg: any): arg is ArduinoComponent {
return (
!!arg &&
'name' in arg &&
typeof arg['name'] === 'string' &&
'author' in arg &&
typeof arg['author'] === 'string' &&
'summary' in arg &&
typeof arg['summary'] === 'string' &&
'description' in arg &&
typeof arg['description'] === 'string' &&
'installable' in arg &&
typeof arg['installable'] === 'boolean'
);
}
}