-
-
Notifications
You must be signed in to change notification settings - Fork 431
/
Copy pathcore-service.ts
57 lines (52 loc) · 1.58 KB
/
core-service.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
import { Programmer } from './boards-service';
export const CompilerWarningLiterals = [
'None',
'Default',
'More',
'All',
] as const;
export type CompilerWarnings = typeof CompilerWarningLiterals[number];
export const CoreServicePath = '/services/core-service';
export const CoreService = Symbol('CoreService');
export interface CoreService {
compile(
options: CoreService.Compile.Options &
Readonly<{
exportBinaries?: boolean;
compilerWarnings?: CompilerWarnings;
}>
): Promise<void>;
upload(options: CoreService.Upload.Options): Promise<void>;
uploadUsingProgrammer(options: CoreService.Upload.Options): Promise<void>;
burnBootloader(options: CoreService.Bootloader.Options): Promise<void>;
}
export namespace CoreService {
export namespace Compile {
export interface Options {
/**
* `file` URI to the sketch folder.
*/
readonly sketchUri: string;
readonly fqbn?: string | undefined;
readonly optimizeForDebug: boolean;
readonly verbose: boolean;
readonly sourceOverride: Record<string, string>;
}
}
export namespace Upload {
export interface Options extends Compile.Options {
readonly port?: string | undefined;
readonly programmer?: Programmer | undefined;
readonly verify: boolean;
}
}
export namespace Bootloader {
export interface Options {
readonly fqbn?: string | undefined;
readonly port?: string | undefined;
readonly programmer?: Programmer | undefined;
readonly verbose: boolean;
readonly verify: boolean;
}
}
}