@eclipse-glsp/protocol
Advanced tools
Comparing version 0.8.0-next.5c0863ff to 0.8.0-next.7e276fdb
@@ -19,5 +19,8 @@ /******************************************************************************** | ||
/** | ||
* Unique identifier for the current client application | ||
*/ | ||
* Unique identifier for the current client application. | ||
*/ | ||
applicationId: string; | ||
/** | ||
* Options that can include application-specific parameters. | ||
*/ | ||
options?: any; | ||
@@ -31,44 +34,75 @@ } | ||
export declare enum ClientState { | ||
/** | ||
* The client has been created. | ||
*/ | ||
Initial = 0, | ||
/** | ||
* `Start` has been called on the client and the start process is still on-going. | ||
*/ | ||
Starting = 1, | ||
/** | ||
* The client failed to complete the start process. | ||
*/ | ||
StartFailed = 2, | ||
/** | ||
* The client was successfully started and is now running. | ||
*/ | ||
Running = 3, | ||
/** | ||
* `Stop` has been called on the client and the stop process is still on-going. | ||
*/ | ||
Stopping = 4, | ||
/** | ||
* The client stopped and disposed the server connection. Thus, action messages can no longer be sent. | ||
*/ | ||
Stopped = 5, | ||
/** | ||
* An error was encountered while connecting to the server. No action messages can be sent. | ||
*/ | ||
ServerError = 6 | ||
} | ||
export interface GLSPClient { | ||
/** | ||
* Unique client Id. | ||
*/ | ||
readonly id: string; | ||
/** | ||
* Client name. | ||
*/ | ||
readonly name: string; | ||
/** | ||
* Current client state. | ||
*/ | ||
currentState(): ClientState; | ||
/** | ||
* Initialize the client and the server connection. | ||
* | ||
* Initializes the client and the server connection. During the start procedure the client is in the `Starting` state and will transition to either `Running` or `StartFailed`. | ||
*/ | ||
start(): Promise<void>; | ||
/** | ||
* Send an initalize request to ther server. The server needs to be initialized | ||
* in order to accept and process action messages | ||
* Send an `initialize` request to the server. The server needs to be initialized in order to accept and process action messages. | ||
* | ||
* @param params Initialize parameter | ||
* @returns true if the initialization was successfull | ||
* @returns true if the initialization was successful | ||
*/ | ||
initializeServer(params: InitializeParameters): Promise<Boolean>; | ||
/** | ||
* Send a shutdown notification to the server | ||
* Send a `shutdown` notification to the server. | ||
*/ | ||
shutdownServer(): void; | ||
/** | ||
* Stop the client and cleanup/dispose resources | ||
* Stops the client and disposes any resources. During the stop procedure the client is in the `Stopping` state and will transition to either `Stopped` or `ServerError`. | ||
*/ | ||
stop(): Promise<void>; | ||
/** | ||
* Set a handler/listener for action messages received from the server | ||
* Send an action message to the server. | ||
* | ||
* @param message The message | ||
*/ | ||
sendActionMessage(message: ActionMessage): void; | ||
/** | ||
* Sets a handler/listener for action messages received from the server. | ||
* | ||
* @param handler The action message handler | ||
*/ | ||
onActionMessage(handler: ActionMessageHandler): void; | ||
/** | ||
* Send an action message to the server | ||
* @param message The message | ||
*/ | ||
sendActionMessage(message: ActionMessage): void; | ||
} | ||
@@ -75,0 +109,0 @@ export declare namespace GLSPClient { |
@@ -19,8 +19,29 @@ "use strict"; | ||
(function (ClientState) { | ||
/** | ||
* The client has been created. | ||
*/ | ||
ClientState[ClientState["Initial"] = 0] = "Initial"; | ||
/** | ||
* `Start` has been called on the client and the start process is still on-going. | ||
*/ | ||
ClientState[ClientState["Starting"] = 1] = "Starting"; | ||
/** | ||
* The client failed to complete the start process. | ||
*/ | ||
ClientState[ClientState["StartFailed"] = 2] = "StartFailed"; | ||
/** | ||
* The client was successfully started and is now running. | ||
*/ | ||
ClientState[ClientState["Running"] = 3] = "Running"; | ||
/** | ||
* `Stop` has been called on the client and the stop process is still on-going. | ||
*/ | ||
ClientState[ClientState["Stopping"] = 4] = "Stopping"; | ||
/** | ||
* The client stopped and disposed the server connection. Thus, action messages can no longer be sent. | ||
*/ | ||
ClientState[ClientState["Stopped"] = 5] = "Stopped"; | ||
/** | ||
* An error was encountered while connecting to the server. No action messages can be sent. | ||
*/ | ||
ClientState[ClientState["ServerError"] = 6] = "ServerError"; | ||
@@ -27,0 +48,0 @@ })(ClientState = exports.ClientState || (exports.ClientState = {})); |
{ | ||
"name": "@eclipse-glsp/protocol", | ||
"version": "0.8.0-next.5c0863ff", | ||
"version": "0.8.0-next.7e276fdb", | ||
"description": "The protocol definition for client-server communication in GLSP", | ||
@@ -5,0 +5,0 @@ "license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)", |
@@ -21,7 +21,12 @@ /******************************************************************************** | ||
/** | ||
* Unique identifier for the current client application | ||
*/ | ||
* Unique identifier for the current client application. | ||
*/ | ||
applicationId: string; | ||
/** | ||
* Options that can include application-specific parameters. | ||
*/ | ||
options?: any | ||
} | ||
export class ApplicationIdProvider { | ||
@@ -36,11 +41,33 @@ private static _applicationId?: string; | ||
} | ||
export type ActionMessageHandler = (message: ActionMessage) => void; | ||
export enum ClientState { | ||
/** | ||
* The client has been created. | ||
*/ | ||
Initial, | ||
/** | ||
* `Start` has been called on the client and the start process is still on-going. | ||
*/ | ||
Starting, | ||
/** | ||
* The client failed to complete the start process. | ||
*/ | ||
StartFailed, | ||
/** | ||
* The client was successfully started and is now running. | ||
*/ | ||
Running, | ||
/** | ||
* `Stop` has been called on the client and the stop process is still on-going. | ||
*/ | ||
Stopping, | ||
/** | ||
* The client stopped and disposed the server connection. Thus, action messages can no longer be sent. | ||
*/ | ||
Stopped, | ||
/** | ||
* An error was encountered while connecting to the server. No action messages can be sent. | ||
*/ | ||
ServerError | ||
@@ -50,35 +77,53 @@ } | ||
export interface GLSPClient { | ||
/** | ||
* Unique client Id. | ||
*/ | ||
readonly id: string; | ||
/** | ||
* Client name. | ||
*/ | ||
readonly name: string; | ||
/** | ||
* Current client state. | ||
*/ | ||
currentState(): ClientState; | ||
/** | ||
* Initialize the client and the server connection. | ||
* | ||
* Initializes the client and the server connection. During the start procedure the client is in the `Starting` state and will transition to either `Running` or `StartFailed`. | ||
*/ | ||
start(): Promise<void>; | ||
/** | ||
* Send an initalize request to ther server. The server needs to be initialized | ||
* in order to accept and process action messages | ||
* Send an `initialize` request to the server. The server needs to be initialized in order to accept and process action messages. | ||
* | ||
* @param params Initialize parameter | ||
* @returns true if the initialization was successfull | ||
* @returns true if the initialization was successful | ||
*/ | ||
initializeServer(params: InitializeParameters): Promise<Boolean>; | ||
/** | ||
* Send a shutdown notification to the server | ||
* Send a `shutdown` notification to the server. | ||
*/ | ||
shutdownServer(): void | ||
/** | ||
* Stop the client and cleanup/dispose resources | ||
* Stops the client and disposes any resources. During the stop procedure the client is in the `Stopping` state and will transition to either `Stopped` or `ServerError`. | ||
*/ | ||
stop(): Promise<void>; | ||
/** | ||
* Set a handler/listener for action messages received from the server | ||
* Send an action message to the server. | ||
* | ||
* @param message The message | ||
*/ | ||
sendActionMessage(message: ActionMessage): void; | ||
/** | ||
* Sets a handler/listener for action messages received from the server. | ||
* | ||
* @param handler The action message handler | ||
*/ | ||
onActionMessage(handler: ActionMessageHandler): void; | ||
/** | ||
* Send an action message to the server | ||
* @param message The message | ||
*/ | ||
sendActionMessage(message: ActionMessage): void; | ||
} | ||
@@ -85,0 +130,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
54379
900