Regenerated TS RPC for daemon fork

This commit is contained in:
Christian Weichel
2019-05-07 09:35:54 +02:00
parent 45a17bc0f5
commit 95ed43c9c4
31 changed files with 14033 additions and 26 deletions

View File

@@ -3,7 +3,7 @@ import { ArduinoComponent } from "./arduino-component";
export const BoardsServicePath = '/services/boards-service';
export const BoardsService = Symbol('BoardsService');
export interface BoardsService {
connectedBoards(): Promise<{ boards: Board[], current?: Board }>;
attachedBoards(): Promise<{ boards: AttachedBoard[] }>;
search(options: { query?: string }): Promise<{ items: Board[] }>;
install(board: Board): Promise<void>;
}
@@ -11,3 +11,39 @@ export interface BoardsService {
export interface Board extends ArduinoComponent {
id: string;
}
export interface AttachedBoard {
name: string
fqbn?: string
}
export interface AttachedSerialBoard extends AttachedBoard {
port: string;
serialNumber: string;
productID: string;
vendorID: string;
}
export namespace AttachedSerialBoard {
export function is(b: AttachedBoard): b is AttachedSerialBoard {
return 'port' in b
&& 'serialNumber' in b
&& 'productID' in b
&& 'vendorID' in b;
}
}
export interface AttachedNetworkBoard extends AttachedBoard {
info: string;
address: string;
port: number;
}
export namespace AttachedNetworkBoard {
export function is(b: AttachedBoard): b is AttachedNetworkBoard {
return 'name' in b
&& 'info' in b
&& 'address' in b
&& 'port' in b;
}
}