@hydranium/glsp-client 1.0.0-next.315 → 1.0.0-next.317

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -91,10 +91,9 @@ declare const initializeMyDiagramContainer: GlspDiagramMountOptions['initializeD
91
91
  -->
92
92
 
93
93
  ```ts
94
- import { HydraniumGlspClient, mountGlspDiagram } from '@hydranium/glsp-client';
95
- import { sendByMethodName } from '@hydranium/protocol';
94
+ import { glspConnection, HydraniumGlspClient, mountGlspDiagram } from '@hydranium/glsp-client';
96
95
 
97
- const glspClient = new HydraniumGlspClient({ id: 'my-app', connectionProvider: sendByMethodName(connection) });
96
+ const glspClient = new HydraniumGlspClient({ id: 'my-app', connectionProvider: glspConnection(connection) });
98
97
  const diagram = await mountGlspDiagram({
99
98
  mount: document.getElementById('my-diagram')!,
100
99
  diagramType: 'my-diagram',
@@ -105,8 +104,10 @@ const diagram = await mountGlspDiagram({
105
104
  });
106
105
  ```
107
106
 
108
- Wrap the connection with `sendByMethodName`: GLSP's client sends message
109
- types built by its own copy of `vscode-jsonrpc`, which another copy rejects.
107
+ Wrap the connection with `glspConnection`: GLSP's client sends message types
108
+ built by its own copy of `vscode-jsonrpc`, which another copy rejects, and
109
+ `glspConnection` sends them by method name through `sendByMethodName` from
110
+ `@hydranium/protocol`, typed as the connection GLSP's client takes.
110
111
  One client serves every diagram on the page, each mounted as its own session.
111
112
  The element's `id` is the diagram's `clientId`, so it needs one; give it a
112
113
  height, `position: relative` so the palette stays on it, `touch-action: none`
@@ -0,0 +1,20 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ import type { ConnectionProvider } from '@eclipse-glsp/client';
10
+ import { sendByMethodName } from '@hydranium/protocol';
11
+ /** The connection GLSP's client sends over, typed by GLSP's own copy of `vscode-jsonrpc`. */
12
+ export type GlspMessageConnection = Exclude<ConnectionProvider, (...args: never[]) => unknown>;
13
+ /**
14
+ * `connection`, wrapped with `sendByMethodName` and typed as the connection
15
+ * GLSP's client takes. Passed straight to `connectionProvider`, the wrapper
16
+ * reads its result type from that option's union, which older TypeScript
17
+ * versions do not resolve, and the assignment fails.
18
+ */
19
+ export declare function glspConnection(connection: Parameters<typeof sendByMethodName>[0]): GlspMessageConnection;
20
+ //# sourceMappingURL=glsp-connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glsp-connection.d.ts","sourceRoot":"","sources":["../src/glsp-connection.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,6FAA6F;AAC7F,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,CAAC;AAE/F;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAExG"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.glspConnection = glspConnection;
12
+ const protocol_1 = require("@hydranium/protocol");
13
+ /**
14
+ * `connection`, wrapped with `sendByMethodName` and typed as the connection
15
+ * GLSP's client takes. Passed straight to `connectionProvider`, the wrapper
16
+ * reads its result type from that option's union, which older TypeScript
17
+ * versions do not resolve, and the assignment fails.
18
+ */
19
+ function glspConnection(connection) {
20
+ return (0, protocol_1.sendByMethodName)(connection);
21
+ }
22
+ //# sourceMappingURL=glsp-connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glsp-connection.js","sourceRoot":"","sources":["../src/glsp-connection.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAGlF,kDAAuD;AAKvD;;;;;GAKG;AACH,wBAA+B,UAAkD;IAC9E,OAAO,IAAA,2BAAgB,EAAC,UAAU,CAAC,CAAC;AACvC,CAAC"}
package/lib/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export * from './diagram-loader';
12
12
  export * from './diagram-mount';
13
13
  export * from './edge';
14
14
  export * from './glsp-client';
15
+ export * from './glsp-connection';
15
16
  export * from './glsp-client-module';
16
17
  export * from './hidden-bounds-updater';
17
18
  export * from './select-mouse-listener';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAOlF,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAOlF,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
package/lib/index.js CHANGED
@@ -33,6 +33,7 @@ __exportStar(require("./diagram-loader"), exports);
33
33
  __exportStar(require("./diagram-mount"), exports);
34
34
  __exportStar(require("./edge"), exports);
35
35
  __exportStar(require("./glsp-client"), exports);
36
+ __exportStar(require("./glsp-connection"), exports);
36
37
  __exportStar(require("./glsp-client-module"), exports);
37
38
  __exportStar(require("./hidden-bounds-updater"), exports);
38
39
  __exportStar(require("./select-mouse-listener"), exports);
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,SAAS;AACT,sDAAoC;AACpC,wDAAsC;AACtC,mDAAiC;AACjC,kDAAgC;AAChC,yCAAuB;AACvB,gDAA8B;AAC9B,uDAAqC;AACrC,0DAAwC;AACxC,0DAAwC;AACxC,2DAAyC;AACzC,mDAAiC;AACjC,gDAA8B;AAC9B,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,SAAS;AACT,sDAAoC;AACpC,wDAAsC;AACtC,mDAAiC;AACjC,kDAAgC;AAChC,yCAAuB;AACvB,gDAA8B;AAC9B,oDAAkC;AAClC,uDAAqC;AACrC,0DAAwC;AACxC,0DAAwC;AACxC,2DAAyC;AACzC,mDAAiC;AACjC,gDAA8B;AAC9B,0CAAwB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hydranium/glsp-client",
3
- "version": "1.0.0-next.315",
3
+ "version": "1.0.0-next.317",
4
4
  "description": "Host-neutral client classes for GLSP heads built on @hydranium/glsp-server, the binder that mounts them in a Theia frontend, a VS Code webview or a plain browser page, the one call that mounts a diagram in a page, and the edge whose labels keep finite bounds without bendpoints.",
5
5
  "keywords": [
6
6
  "diagram",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "devDependencies": {
61
61
  "@eclipse-glsp/client": "2.7.0",
62
- "@hydranium/protocol": "1.0.0-next.315",
62
+ "@hydranium/protocol": "1.0.0-next.317",
63
63
  "@types/node": "^22.0.0",
64
64
  "inversify": "6.2.2",
65
65
  "reflect-metadata": "0.2.2",
@@ -69,7 +69,7 @@
69
69
  },
70
70
  "peerDependencies": {
71
71
  "@eclipse-glsp/client": "^2.6.0",
72
- "@hydranium/protocol": "1.0.0-next.315",
72
+ "@hydranium/protocol": "1.0.0-next.317",
73
73
  "inversify": "^6.0.0",
74
74
  "snabbdom": "^3.5.1"
75
75
  },
@@ -0,0 +1,24 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+
10
+ import type { ConnectionProvider } from '@eclipse-glsp/client';
11
+ import { sendByMethodName } from '@hydranium/protocol';
12
+
13
+ /** The connection GLSP's client sends over, typed by GLSP's own copy of `vscode-jsonrpc`. */
14
+ export type GlspMessageConnection = Exclude<ConnectionProvider, (...args: never[]) => unknown>;
15
+
16
+ /**
17
+ * `connection`, wrapped with `sendByMethodName` and typed as the connection
18
+ * GLSP's client takes. Passed straight to `connectionProvider`, the wrapper
19
+ * reads its result type from that option's union, which older TypeScript
20
+ * versions do not resolve, and the assignment fails.
21
+ */
22
+ export function glspConnection(connection: Parameters<typeof sendByMethodName>[0]): GlspMessageConnection {
23
+ return sendByMethodName(connection);
24
+ }
package/src/index.ts CHANGED
@@ -18,6 +18,7 @@ export * from './diagram-loader';
18
18
  export * from './diagram-mount';
19
19
  export * from './edge';
20
20
  export * from './glsp-client';
21
+ export * from './glsp-connection';
21
22
  export * from './glsp-client-module';
22
23
  export * from './hidden-bounds-updater';
23
24
  export * from './select-mouse-listener';