@jay-framework/editor-client 0.12.0 → 0.14.0
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/dist/index.d.ts +5 -3
- package/dist/index.js +6 -0
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _jay_framework_editor_protocol from '@jay-framework/editor-protocol';
|
|
2
|
-
import { ConnectionState, EditorProtocolMessageTypes, PublishMessage, PublishResponse, SaveImageMessage, SaveImageResponse, HasImageMessage, HasImageResponse, GetProjectInfoMessage, GetProjectInfoResponse, EditorProtocol, EditorProtocolResponseTypes } from '@jay-framework/editor-protocol';
|
|
2
|
+
import { ConnectionState, EditorProtocolMessageTypes, PublishMessage, PublishResponse, SaveImageMessage, SaveImageResponse, HasImageMessage, HasImageResponse, GetProjectInfoMessage, GetProjectInfoResponse, ExportMessage, ExportResponse, ImportMessage, ImportResponse, EditorProtocol, EditorProtocolResponseTypes } from '@jay-framework/editor-protocol';
|
|
3
3
|
|
|
4
4
|
interface ConnectionManagerOptions {
|
|
5
5
|
portRange?: [number, number];
|
|
@@ -29,7 +29,7 @@ declare class ConnectionManager {
|
|
|
29
29
|
disconnect(): Promise<void>;
|
|
30
30
|
getConnectionState(): ConnectionState;
|
|
31
31
|
onConnectionStateChange(callback: ConnectionStateCallback): () => void;
|
|
32
|
-
sendMessage<T extends EditorProtocolMessageTypes
|
|
32
|
+
sendMessage<T extends EditorProtocolMessageTypes<any>>(message: T): Promise<T extends PublishMessage ? PublishResponse : T extends SaveImageMessage ? SaveImageResponse : T extends HasImageMessage ? HasImageResponse : T extends GetProjectInfoMessage ? GetProjectInfoResponse : T extends ExportMessage<any> ? ExportResponse : T extends ImportMessage<any> ? ImportResponse<any> : never>;
|
|
33
33
|
private updateConnectionState;
|
|
34
34
|
private scheduleReconnect;
|
|
35
35
|
private discoverServer;
|
|
@@ -53,7 +53,9 @@ declare class EditorClient implements EditorProtocol {
|
|
|
53
53
|
saveImage(params: SaveImageMessage): Promise<SaveImageResponse>;
|
|
54
54
|
hasImage(params: HasImageMessage): Promise<HasImageResponse>;
|
|
55
55
|
getProjectInfo(params: GetProjectInfoMessage): Promise<GetProjectInfoResponse>;
|
|
56
|
-
|
|
56
|
+
export<TVendorDoc>(params: ExportMessage<TVendorDoc>): Promise<ExportResponse>;
|
|
57
|
+
import<TVendorDoc>(params: ImportMessage<TVendorDoc>): Promise<ImportResponse<TVendorDoc>>;
|
|
58
|
+
send(params: EditorProtocolMessageTypes<any>): Promise<EditorProtocolResponseTypes<any>>;
|
|
57
59
|
getConnectionManager(): ConnectionManager;
|
|
58
60
|
}
|
|
59
61
|
declare function createEditorClient(options?: EditorClientOptions): EditorClient;
|
package/dist/index.js
CHANGED
|
@@ -255,6 +255,12 @@ class EditorClient {
|
|
|
255
255
|
async getProjectInfo(params) {
|
|
256
256
|
return this.connectionManager.sendMessage(params);
|
|
257
257
|
}
|
|
258
|
+
async export(params) {
|
|
259
|
+
return this.connectionManager.sendMessage(params);
|
|
260
|
+
}
|
|
261
|
+
async import(params) {
|
|
262
|
+
return this.connectionManager.sendMessage(params);
|
|
263
|
+
}
|
|
258
264
|
async send(params) {
|
|
259
265
|
return this.connectionManager.sendMessage(params);
|
|
260
266
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/editor-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"test:watch": "vitest"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@jay-framework/editor-protocol": "^0.
|
|
28
|
-
"@jay-framework/logger": "^0.
|
|
27
|
+
"@jay-framework/editor-protocol": "^0.14.0",
|
|
28
|
+
"@jay-framework/logger": "^0.14.0",
|
|
29
29
|
"get-port": "^7.0.0",
|
|
30
30
|
"socket.io-client": "^4.7.4",
|
|
31
31
|
"uuid": "^9.0.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@jay-framework/dev-environment": "^0.
|
|
35
|
-
"@jay-framework/jay-cli": "^0.
|
|
34
|
+
"@jay-framework/dev-environment": "^0.14.0",
|
|
35
|
+
"@jay-framework/jay-cli": "^0.14.0",
|
|
36
36
|
"@types/node": "^22.15.21",
|
|
37
37
|
"@types/uuid": "^9.0.7",
|
|
38
38
|
"rimraf": "^5.0.5",
|