fixed save-as. added sketchload

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta
2020-07-30 19:58:14 +02:00
parent 528f4150d3
commit 8ab70f48f8
19 changed files with 360 additions and 114 deletions

View File

@@ -8,7 +8,12 @@ export interface SketchesService {
*/
getSketches(uri?: string): Promise<Sketch[]>;
getSketchFiles(uri: string): Promise<string[]>;
/**
* This is the TS implementation of `SketchLoad` from the CLI and should be replaced with a gRPC call eventually.
* See: https://github.com/arduino/arduino-cli/issues/837
* Based on: https://github.com/arduino/arduino-cli/blob/eef3705c4afcba4317ec38b803d9ffce5dd59a28/arduino/builder/sketch.go#L100-L215
*/
loadSketch(uri: string): Promise<Sketch>;
/**
* Creates a new sketch folder in the temp location.
@@ -40,7 +45,10 @@ export interface SketchesService {
export interface Sketch {
readonly name: string;
readonly uri: string;
readonly uri: string; // `LocationPath`
readonly mainFileUri: string; // `MainFile`
readonly otherSketchFileUris: string[]; // `OtherSketchFiles`
readonly additionalFileUris: string[]; // `AdditionalFiles`
}
export namespace Sketch {
export function is(arg: any): arg is Sketch {