mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
ec4f6c01de
Also moves icon and color definitions to the backend and makes it so the new workspaces get created with a different icon color for each index. If an ephemeral window has more than one tab, always create a new window when switching workspaces Also fixes workspace accelerators on macOS
232 lines
8.8 KiB
TypeScript
232 lines
8.8 KiB
TypeScript
// Copyright 2024, Command Line Inc.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// generated by cmd/generate/main-generatets.go
|
|
|
|
import * as WOS from "./wos";
|
|
|
|
// blockservice.BlockService (block)
|
|
class BlockServiceType {
|
|
GetControllerStatus(arg2: string): Promise<BlockControllerRuntimeStatus> {
|
|
return WOS.callBackendService("block", "GetControllerStatus", Array.from(arguments))
|
|
}
|
|
|
|
// save the terminal state to a blockfile
|
|
SaveTerminalState(blockId: string, state: string, stateType: string, ptyOffset: number, termSize: TermSize): Promise<void> {
|
|
return WOS.callBackendService("block", "SaveTerminalState", Array.from(arguments))
|
|
}
|
|
SaveWaveAiData(arg2: string, arg3: OpenAIPromptMessageType[]): Promise<void> {
|
|
return WOS.callBackendService("block", "SaveWaveAiData", Array.from(arguments))
|
|
}
|
|
}
|
|
|
|
export const BlockService = new BlockServiceType();
|
|
|
|
// clientservice.ClientService (client)
|
|
class ClientServiceType {
|
|
// @returns object updates
|
|
AgreeTos(): Promise<void> {
|
|
return WOS.callBackendService("client", "AgreeTos", Array.from(arguments))
|
|
}
|
|
FocusWindow(arg2: string): Promise<void> {
|
|
return WOS.callBackendService("client", "FocusWindow", Array.from(arguments))
|
|
}
|
|
GetAllConnStatus(): Promise<ConnStatus[]> {
|
|
return WOS.callBackendService("client", "GetAllConnStatus", Array.from(arguments))
|
|
}
|
|
GetClientData(): Promise<Client> {
|
|
return WOS.callBackendService("client", "GetClientData", Array.from(arguments))
|
|
}
|
|
GetTab(arg1: string): Promise<Tab> {
|
|
return WOS.callBackendService("client", "GetTab", Array.from(arguments))
|
|
}
|
|
TelemetryUpdate(arg2: boolean): Promise<void> {
|
|
return WOS.callBackendService("client", "TelemetryUpdate", Array.from(arguments))
|
|
}
|
|
}
|
|
|
|
export const ClientService = new ClientServiceType();
|
|
|
|
// fileservice.FileService (file)
|
|
class FileServiceType {
|
|
// delete file
|
|
DeleteFile(connection: string, path: string): Promise<void> {
|
|
return WOS.callBackendService("file", "DeleteFile", Array.from(arguments))
|
|
}
|
|
GetFullConfig(): Promise<FullConfigType> {
|
|
return WOS.callBackendService("file", "GetFullConfig", Array.from(arguments))
|
|
}
|
|
GetWaveFile(arg1: string, arg2: string): Promise<any> {
|
|
return WOS.callBackendService("file", "GetWaveFile", Array.from(arguments))
|
|
}
|
|
Mkdir(arg1: string, arg2: string): Promise<void> {
|
|
return WOS.callBackendService("file", "Mkdir", Array.from(arguments))
|
|
}
|
|
|
|
// read file
|
|
ReadFile(connection: string, path: string): Promise<FullFile> {
|
|
return WOS.callBackendService("file", "ReadFile", Array.from(arguments))
|
|
}
|
|
Rename(arg1: string, arg2: string, arg3: string): Promise<void> {
|
|
return WOS.callBackendService("file", "Rename", Array.from(arguments))
|
|
}
|
|
|
|
// save file
|
|
SaveFile(connection: string, path: string, data64: string): Promise<void> {
|
|
return WOS.callBackendService("file", "SaveFile", Array.from(arguments))
|
|
}
|
|
|
|
// get file info
|
|
StatFile(connection: string, path: string): Promise<FileInfo> {
|
|
return WOS.callBackendService("file", "StatFile", Array.from(arguments))
|
|
}
|
|
TouchFile(arg1: string, arg2: string): Promise<void> {
|
|
return WOS.callBackendService("file", "TouchFile", Array.from(arguments))
|
|
}
|
|
}
|
|
|
|
export const FileService = new FileServiceType();
|
|
|
|
// objectservice.ObjectService (object)
|
|
class ObjectServiceType {
|
|
// @returns blockId (and object updates)
|
|
CreateBlock(blockDef: BlockDef, rtOpts: RuntimeOpts): Promise<string> {
|
|
return WOS.callBackendService("object", "CreateBlock", Array.from(arguments))
|
|
}
|
|
|
|
// @returns object updates
|
|
DeleteBlock(blockId: string): Promise<void> {
|
|
return WOS.callBackendService("object", "DeleteBlock", Array.from(arguments))
|
|
}
|
|
|
|
// get wave object by oref
|
|
GetObject(oref: string): Promise<WaveObj> {
|
|
return WOS.callBackendService("object", "GetObject", Array.from(arguments))
|
|
}
|
|
|
|
// @returns objects
|
|
GetObjects(orefs: string[]): Promise<WaveObj[]> {
|
|
return WOS.callBackendService("object", "GetObjects", Array.from(arguments))
|
|
}
|
|
|
|
// @returns object updates
|
|
UpdateObject(waveObj: WaveObj, returnUpdates: boolean): Promise<void> {
|
|
return WOS.callBackendService("object", "UpdateObject", Array.from(arguments))
|
|
}
|
|
|
|
// @returns object updates
|
|
UpdateObjectMeta(oref: string, meta: MetaType): Promise<void> {
|
|
return WOS.callBackendService("object", "UpdateObjectMeta", Array.from(arguments))
|
|
}
|
|
|
|
// @returns object updates
|
|
UpdateTabName(tabId: string, name: string): Promise<void> {
|
|
return WOS.callBackendService("object", "UpdateTabName", Array.from(arguments))
|
|
}
|
|
}
|
|
|
|
export const ObjectService = new ObjectServiceType();
|
|
|
|
// userinputservice.UserInputService (userinput)
|
|
class UserInputServiceType {
|
|
SendUserInputResponse(arg1: UserInputResponse): Promise<void> {
|
|
return WOS.callBackendService("userinput", "SendUserInputResponse", Array.from(arguments))
|
|
}
|
|
}
|
|
|
|
export const UserInputService = new UserInputServiceType();
|
|
|
|
// windowservice.WindowService (window)
|
|
class WindowServiceType {
|
|
CloseWindow(windowId: string, fromElectron: boolean): Promise<void> {
|
|
return WOS.callBackendService("window", "CloseWindow", Array.from(arguments))
|
|
}
|
|
CreateWindow(winSize: WinSize, workspaceId: string): Promise<WaveWindow> {
|
|
return WOS.callBackendService("window", "CreateWindow", Array.from(arguments))
|
|
}
|
|
GetWindow(windowId: string): Promise<WaveWindow> {
|
|
return WOS.callBackendService("window", "GetWindow", Array.from(arguments))
|
|
}
|
|
|
|
// move block to new window
|
|
// @returns object updates
|
|
MoveBlockToNewWindow(currentTabId: string, blockId: string): Promise<void> {
|
|
return WOS.callBackendService("window", "MoveBlockToNewWindow", Array.from(arguments))
|
|
}
|
|
|
|
// set window position and size
|
|
// @returns object updates
|
|
SetWindowPosAndSize(windowId: string, pos: Point, size: WinSize): Promise<void> {
|
|
return WOS.callBackendService("window", "SetWindowPosAndSize", Array.from(arguments))
|
|
}
|
|
SwitchWorkspace(windowId: string, workspaceId: string): Promise<Workspace> {
|
|
return WOS.callBackendService("window", "SwitchWorkspace", Array.from(arguments))
|
|
}
|
|
}
|
|
|
|
export const WindowService = new WindowServiceType();
|
|
|
|
// workspaceservice.WorkspaceService (workspace)
|
|
class WorkspaceServiceType {
|
|
// @returns object updates
|
|
ChangeTabPinning(workspaceId: string, tabId: string, pinned: boolean): Promise<void> {
|
|
return WOS.callBackendService("workspace", "ChangeTabPinning", Array.from(arguments))
|
|
}
|
|
|
|
// @returns CloseTabRtn (and object updates)
|
|
CloseTab(workspaceId: string, tabId: string, fromElectron: boolean): Promise<CloseTabRtnType> {
|
|
return WOS.callBackendService("workspace", "CloseTab", Array.from(arguments))
|
|
}
|
|
|
|
// @returns tabId (and object updates)
|
|
CreateTab(workspaceId: string, tabName: string, activateTab: boolean, pinned: boolean): Promise<string> {
|
|
return WOS.callBackendService("workspace", "CreateTab", Array.from(arguments))
|
|
}
|
|
|
|
// @returns workspaceId
|
|
CreateWorkspace(name: string, icon: string, color: string, applyDefaults: boolean): Promise<string> {
|
|
return WOS.callBackendService("workspace", "CreateWorkspace", Array.from(arguments))
|
|
}
|
|
|
|
// @returns object updates
|
|
DeleteWorkspace(workspaceId: string): Promise<void> {
|
|
return WOS.callBackendService("workspace", "DeleteWorkspace", Array.from(arguments))
|
|
}
|
|
|
|
// @returns colors
|
|
GetColors(): Promise<string[]> {
|
|
return WOS.callBackendService("workspace", "GetColors", Array.from(arguments))
|
|
}
|
|
|
|
// @returns icons
|
|
GetIcons(): Promise<string[]> {
|
|
return WOS.callBackendService("workspace", "GetIcons", Array.from(arguments))
|
|
}
|
|
|
|
// @returns workspace
|
|
GetWorkspace(workspaceId: string): Promise<Workspace> {
|
|
return WOS.callBackendService("workspace", "GetWorkspace", Array.from(arguments))
|
|
}
|
|
ListWorkspaces(): Promise<WorkspaceListEntry[]> {
|
|
return WOS.callBackendService("workspace", "ListWorkspaces", Array.from(arguments))
|
|
}
|
|
|
|
// @returns object updates
|
|
SetActiveTab(workspaceId: string, tabId: string): Promise<void> {
|
|
return WOS.callBackendService("workspace", "SetActiveTab", Array.from(arguments))
|
|
}
|
|
|
|
// @returns object updates
|
|
UpdateTabIds(workspaceId: string, tabIds: string[], pinnedTabIds: string[]): Promise<void> {
|
|
return WOS.callBackendService("workspace", "UpdateTabIds", Array.from(arguments))
|
|
}
|
|
|
|
// @returns object updates
|
|
UpdateWorkspace(workspaceId: string, name: string, icon: string, color: string, applyDefaults: boolean): Promise<void> {
|
|
return WOS.callBackendService("workspace", "UpdateWorkspace", Array.from(arguments))
|
|
}
|
|
}
|
|
|
|
export const WorkspaceService = new WorkspaceServiceType();
|
|
|