Skip to content

Commit 0e38ae5

Browse files
Merge pull request #314 from Exabyte-io/chore/enums
add tsEnums support
2 parents 41cfe1f + eb879ee commit 0e38ae5

File tree

5 files changed

+38
-10
lines changed

5 files changed

+38
-10
lines changed

dist/js/schema/system/iframe_message.json

+9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
"enum": [
1717
"from-iframe-to-host",
1818
"from-host-to-iframe"
19+
],
20+
"tsEnumNames": [
21+
"fromIframeToHost",
22+
"fromHostToIframe"
1923
]
2024
},
2125
"action": {
@@ -25,6 +29,11 @@
2529
"set-data",
2630
"get-data",
2731
"info"
32+
],
33+
"tsEnumNames": [
34+
"setData",
35+
"getData",
36+
"info"
2837
]
2938
},
3039
"payload": {

dist/js/schemas.json

+1-1
Large diffs are not rendered by default.

dist/js/types.ts

+18-8
Original file line numberDiff line numberDiff line change
@@ -27025,19 +27025,29 @@ export interface HistorySchema {
2702527025
* communication message between iframe and the parent window.
2702627026
*/
2702727027
export interface IframeMessageSchema {
27028-
/**
27029-
* The type of the message to distinguish the direction of the message.
27030-
*/
27031-
type: "from-iframe-to-host" | "from-host-to-iframe";
27032-
/**
27033-
* The action to be performed upon receiving the message.
27034-
*/
27035-
action: "set-data" | "get-data" | "info";
27028+
type: Type;
27029+
action: Action;
2703627030
/**
2703727031
* The content of the message with actual data.
2703827032
*/
2703927033
payload: {};
2704027034
}
27035+
27036+
/**
27037+
* The type of the message to distinguish the direction of the message.
27038+
*/
27039+
export const enum Type {
27040+
fromIframeToHost = "from-iframe-to-host",
27041+
fromHostToIframe = "from-host-to-iframe"
27042+
}
27043+
/**
27044+
* The action to be performed upon receiving the message.
27045+
*/
27046+
export const enum Action {
27047+
setData = "set-data",
27048+
getData = "get-data",
27049+
info = "info"
27050+
}
2704127051

2704227052
/** Schema dist/js/schema/system/in_set.json */
2704327053

schema/system/iframe_message.json

+9
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
"enum": [
1212
"from-iframe-to-host",
1313
"from-host-to-iframe"
14+
],
15+
"tsEnumNames": [
16+
"fromIframeToHost",
17+
"fromHostToIframe"
1418
]
1519
},
1620
"action": {
@@ -20,6 +24,11 @@
2024
"set-data",
2125
"get-data",
2226
"info"
27+
],
28+
"tsEnumNames": [
29+
"setData",
30+
"getData",
31+
"info"
2332
]
2433
},
2534
"payload": {

src/py/mat3ra/esse/data/schemas.py

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)