@jay-framework/editor-protocol 0.6.3 → 0.6.5
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 +14 -5
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -8,12 +8,18 @@ interface BaseResponse {
|
|
|
8
8
|
}
|
|
9
9
|
interface PublishMessage extends BaseMessage<PublishResponse> {
|
|
10
10
|
type: 'publish';
|
|
11
|
-
pages
|
|
11
|
+
pages?: {
|
|
12
12
|
route: string;
|
|
13
13
|
jayHtml: string;
|
|
14
14
|
name: string;
|
|
15
15
|
}[];
|
|
16
|
+
components?: {
|
|
17
|
+
jayHtml: string;
|
|
18
|
+
name: string;
|
|
19
|
+
}[];
|
|
16
20
|
}
|
|
21
|
+
type PublishPage = PublishMessage['pages'][number];
|
|
22
|
+
type PublishComponent = PublishMessage['components'][number];
|
|
17
23
|
interface SaveImageMessage extends BaseMessage<SaveImageResponse> {
|
|
18
24
|
type: 'saveImage';
|
|
19
25
|
imageId: string;
|
|
@@ -31,6 +37,7 @@ interface PublishResponse extends BaseResponse {
|
|
|
31
37
|
error?: string;
|
|
32
38
|
}[];
|
|
33
39
|
}
|
|
40
|
+
type PublishStatus = PublishResponse['status'][number];
|
|
34
41
|
interface SaveImageResponse extends BaseResponse {
|
|
35
42
|
type: 'saveImage';
|
|
36
43
|
success: boolean;
|
|
@@ -42,15 +49,17 @@ interface HasImageResponse extends BaseResponse {
|
|
|
42
49
|
exists: boolean;
|
|
43
50
|
imageUrl?: string;
|
|
44
51
|
}
|
|
52
|
+
type EditorProtocolMessageTypes = PublishMessage | SaveImageMessage | HasImageMessage;
|
|
53
|
+
type EditorProtocolResponseTypes = PublishResponse | SaveImageResponse | HasImageResponse;
|
|
45
54
|
interface ProtocolMessage {
|
|
46
55
|
id: string;
|
|
47
56
|
timestamp: number;
|
|
48
|
-
payload:
|
|
57
|
+
payload: EditorProtocolMessageTypes;
|
|
49
58
|
}
|
|
50
59
|
interface ProtocolResponse {
|
|
51
60
|
id: string;
|
|
52
61
|
timestamp: number;
|
|
53
|
-
payload:
|
|
62
|
+
payload: EditorProtocolResponseTypes;
|
|
54
63
|
}
|
|
55
64
|
interface EditorProtocol {
|
|
56
65
|
publish(params: PublishMessage): Promise<PublishResponse>;
|
|
@@ -73,7 +82,7 @@ interface EditorConfig {
|
|
|
73
82
|
}
|
|
74
83
|
type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
75
84
|
interface PortDiscoveryResponse {
|
|
76
|
-
status: 'init' | '
|
|
85
|
+
status: 'init' | 'match' | 'no-match';
|
|
77
86
|
id?: string;
|
|
78
87
|
port: number;
|
|
79
88
|
}
|
|
@@ -87,4 +96,4 @@ declare function createHasImageResponse(exists: boolean, imageUrl?: string): Has
|
|
|
87
96
|
declare function createProtocolMessage(payload: PublishMessage | SaveImageMessage | HasImageMessage): ProtocolMessage;
|
|
88
97
|
declare function createProtocolResponse(id: string, payload: PublishResponse | SaveImageResponse | HasImageResponse): ProtocolResponse;
|
|
89
98
|
|
|
90
|
-
export { type BaseMessage, type BaseResponse, type ConnectionState, type DevServerProtocol, type EditorConfig, type EditorProtocol, type HasImageMessage, type HasImageResponse, type PortDiscoveryResponse, type ProtocolMessage, type ProtocolResponse, type PublishMessage, type PublishResponse, type SaveImageMessage, type SaveImageResponse, createHasImageMessage, createHasImageResponse, createProtocolMessage, createProtocolResponse, createPublishMessage, createPublishResponse, createSaveImageMessage, createSaveImageResponse };
|
|
99
|
+
export { type BaseMessage, type BaseResponse, type ConnectionState, type DevServerProtocol, type EditorConfig, type EditorProtocol, type EditorProtocolMessageTypes, type EditorProtocolResponseTypes, type HasImageMessage, type HasImageResponse, type PortDiscoveryResponse, type ProtocolMessage, type ProtocolResponse, type PublishComponent, type PublishMessage, type PublishPage, type PublishResponse, type PublishStatus, type SaveImageMessage, type SaveImageResponse, createHasImageMessage, createHasImageResponse, createProtocolMessage, createProtocolResponse, createPublishMessage, createPublishResponse, createSaveImageMessage, createSaveImageResponse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/editor-protocol",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"test:watch": ":"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@jay-framework/dev-environment": "^0.6.
|
|
31
|
-
"@jay-framework/jay-cli": "^0.6.
|
|
30
|
+
"@jay-framework/dev-environment": "^0.6.5",
|
|
31
|
+
"@jay-framework/jay-cli": "^0.6.5",
|
|
32
32
|
"@types/node": "^22.15.21",
|
|
33
33
|
"rimraf": "^5.0.5",
|
|
34
34
|
"tsup": "^8.0.1",
|