Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@eclipse-glsp/protocol

Package Overview
Dependencies
Maintainers
5
Versions
297
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eclipse-glsp/protocol - npm Package Compare versions

Comparing version 0.8.0-next.197cba73 to 0.8.0-next.2657aad3

LICENSE

64

lib/glsp-client.d.ts

@@ -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.197cba73",
"version": "0.8.0-next.2657aad3",
"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)",

@@ -9,2 +9,3 @@ # Eclipse GLSP - Client [![build-status](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.eclipse.org%2Fglsp%2Fjob%2Feclipse-glsp%2Fjob%2Fglsp-client%2Fjob%2Fmaster%2F)](https://ci.eclipse.org/glsp/job/eclipse-glsp/job/glsp-client/job/master) [![build-status-server](https://img.shields.io/jenkins/build?jobUrl=https://ci.eclipse.org/glsp/job/deploy-npm-glsp-client/&label=publish)](https://ci.eclipse.org/glsp/job/deploy-npm-glsp-client/)

## More information

@@ -11,0 +12,0 @@ For more information, please visit the [Eclipse GLSP Umbrella repository](https://github.com/eclipse-glsp/glsp) and the [Eclipse GLSP Website](https://www.eclipse.org/glsp/). If you have questions, contact us on our [spectrum chat](https://spectrum.chat/glsp/) and have a look at our [communication and support options](https://www.eclipse.org/glsp/contact/).

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc