mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-10-15 14:28:33 +00:00
ATL-374: Refactored the Output services.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
@@ -1,22 +1,13 @@
|
||||
import { JsonRpcServer } from '@theia/core/lib/common/messaging/proxy-factory';
|
||||
import { Searchable } from './searchable';
|
||||
import { Installable } from './installable';
|
||||
import { ArduinoComponent } from './arduino-component';
|
||||
import { Installable, InstallableClient } from './installable';
|
||||
|
||||
export const LibraryServicePath = '/services/library-service';
|
||||
export const LibraryService = Symbol('LibraryService');
|
||||
export interface LibraryService extends Installable<LibraryPackage>, Searchable<LibraryPackage> {
|
||||
install(options: { item: LibraryPackage, version?: Installable.Version }): Promise<void>;
|
||||
list(options: LibraryService.List.Options): Promise<LibraryPackage[]>;
|
||||
}
|
||||
|
||||
export const LibraryServiceClient = Symbol('LibraryServiceClient');
|
||||
export interface LibraryServiceClient extends InstallableClient<LibraryPackage> {
|
||||
}
|
||||
|
||||
export const LibraryServiceServerPath = '/services/library-service-server';
|
||||
export const LibraryServiceServer = Symbol('LibraryServiceServer');
|
||||
export interface LibraryServiceServer extends LibraryService, JsonRpcServer<LibraryServiceClient> {
|
||||
}
|
||||
|
||||
export namespace LibraryService {
|
||||
export namespace List {
|
||||
export interface Options {
|
||||
@@ -26,31 +17,38 @@ export namespace LibraryService {
|
||||
}
|
||||
|
||||
export enum LibraryLocation {
|
||||
|
||||
/**
|
||||
* In the `libraries` subdirectory of the Arduino IDE installation.
|
||||
*/
|
||||
IDE_BUILTIN = 0,
|
||||
|
||||
/**
|
||||
* In the `libraries` subdirectory of the user directory (sketchbook).
|
||||
*/
|
||||
USER = 1,
|
||||
|
||||
/**
|
||||
* In the `libraries` subdirectory of a platform.
|
||||
*/
|
||||
PLATFORM_BUILTIN = 2,
|
||||
|
||||
/**
|
||||
* When `LibraryLocation` is used in a context where a board is specified, this indicates the library is in the `libraries`
|
||||
* subdirectory of a platform referenced by the board's platform.
|
||||
*/
|
||||
REFERENCED_PLATFORM_BUILTIN = 3
|
||||
|
||||
}
|
||||
|
||||
export interface LibraryPackage extends ArduinoComponent {
|
||||
|
||||
/**
|
||||
* Same as [`Library#real_name`](https://arduino.github.io/arduino-cli/latest/rpc/commands/#library).
|
||||
* Should be used for the UI, and `name` is used to uniquely identify a library. It does not have an ID.
|
||||
*/
|
||||
readonly label: string;
|
||||
|
||||
/**
|
||||
* An array of string that should be included into the `ino` file if this library is used.
|
||||
* For example, including `SD` will prepend `#include <SD.h>` to the `ino` file. While including `Bridge`
|
||||
|
Reference in New Issue
Block a user