import { ISyntheticSourceInfo } from "@tandem/sandbox"; import { CoreEvent, BoundingRect, ISourceLocation } from "@tandem/common"; import { ISyntheticObject } from "@tandem/sandbox"; import { IMessage, SocketIOBus, TransformStream, IStreamableDispatcher } from "@tandem/mesh"; import { Project, IProjectData } from "../stores"; export declare namespace EditorFamilyType { /** * Peer (client) application such as an extension */ const TEXT_EDITOR = "textEditor"; /** * editor app */ const BROWSER = "browser"; /** * Heavy lifter - may be a web worker, node worker, or live in a remote location */ const WORKER = "worker"; /** * Main app all others talk to */ const MASTER = "master"; } export declare class OpenFileRequest extends CoreEvent { readonly uri: string; readonly selection: ISourceLocation; static readonly OPEN_FILE: string; constructor(uri: string, selection?: ISourceLocation); static dispatch(uri: string, selection: ISyntheticSourceInfo, bus: IStreamableDispatcher): TransformStream; } export declare class SaveAllRequest extends CoreEvent { static readonly SAVE_ALL: string; constructor(); } export declare class SetCurrentFileRequest extends CoreEvent { readonly uri: string; readonly selection: ISourceLocation; static readonly SET_CURRENT_FILE: string; constructor(uri: string, selection?: ISourceLocation); static dispatch(uri: string, selection: ISyntheticSourceInfo, bus: IStreamableDispatcher): TransformStream; } export declare class OpenWorkspaceRequest extends CoreEvent { readonly project: Project; static readonly OPEN_WORKSPACE: string; constructor(project: Project); static dispatch(project: Project, bus: IStreamableDispatcher): Promise; } export declare class CreateNewProjectRequest extends CoreEvent { readonly owner: string; readonly uri: string; static readonly CREATE_NEW_PROJECT: string; constructor(owner: string, uri: string); static dispatch(owner: string, uri: string, bus: IStreamableDispatcher): Promise; } export declare class IOClientConnectedMessage extends CoreEvent { readonly bus: SocketIOBus; static readonly IO_CLIENT_CONNECTED: string; constructor(bus: SocketIOBus); } export declare class IOClientDisconnectedMessage extends CoreEvent { static readonly IO_CLIENT_DISCONNECTED: string; constructor(); } export declare class PingRequest implements IMessage { static readonly PING: string; readonly type: string; } export declare class OpenProjectEnvironmentChannelRequest extends CoreEvent { readonly projectId: string; static readonly OPEN_PROJECT_ENVIRONMENT_CHANNEL: string; constructor(projectId: string); } export declare class GetProjectRequest extends CoreEvent { readonly projectId: string; static readonly GET_PROJECT: string; constructor(projectId: string); static dispatch(projectId: string, bus: IStreamableDispatcher): Promise; } export declare class WatchProjectRequest extends CoreEvent { readonly projectId: string; static readonly WATCH_PROJECT: string; constructor(projectId: string); static dispatch(projectId: string, bus: IStreamableDispatcher, onChange?: () => any): { dispose(): any; }; } export declare class UpdateProjectRequest extends CoreEvent { readonly projectId: string; readonly data: IProjectData; static readonly UPDATE_PROJECT: string; constructor(projectId: string, data: IProjectData); } export interface INewWorkspaceOptions { commonjs?: boolean; } export declare class OpenNewWorkspaceRequest implements IMessage { readonly projectOrFilePath: Project | string; static readonly OPEN_NEW_WORKSPACE: string; readonly type: string; constructor(projectOrFilePath: Project | string, options?: INewWorkspaceOptions); } export declare class ResolveWorkspaceURIRequest implements IMessage { readonly uri: string; static readonly RESOLVE_WORKSPACE_URI: string; readonly type: string; constructor(uri: string); static dispatch(uri: string, bus: IStreamableDispatcher): Promise; } export declare class CreateTemporaryWorkspaceRequest implements IMessage { readonly uri: string; static readonly CREATE_TEMPORARY_WORKSPACE: string; readonly type: string; constructor(uri: string); static dispatch(uri: string, bus: IStreamableDispatcher): Promise; } export declare class ImportFileRequest extends CoreEvent { readonly bounds: BoundingRect; readonly targetObject: ISyntheticObject; static readonly IMPORT_FILE: string; readonly uri: string; constructor(uri: string, bounds?: BoundingRect, targetObject?: ISyntheticObject); } export declare class SelectSourceRequest extends CoreEvent { readonly uri: string; readonly ranges: ISourceLocation[]; static readonly SELECT_SOURCE: string; constructor(uri: string, ranges: ISourceLocation[]); } export declare class GetTunnelUrlRequest extends CoreEvent { static readonly GET_TUNNEL_URL: string; constructor(); static dispatch(bus: IStreamableDispatcher): Promise; }