Skip to content

Commit

Permalink
Merge pull request #314 from Exabyte-io/chore/enums
Browse files Browse the repository at this point in the history
add tsEnums support
  • Loading branch information
timurbazhirov committed Apr 8, 2024
2 parents 41cfe1f + eb879ee commit 0e38ae5
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 10 deletions.
9 changes: 9 additions & 0 deletions dist/js/schema/system/iframe_message.json
Expand Up @@ -16,6 +16,10 @@
"enum": [
"from-iframe-to-host",
"from-host-to-iframe"
],
"tsEnumNames": [
"fromIframeToHost",
"fromHostToIframe"
]
},
"action": {
Expand All @@ -25,6 +29,11 @@
"set-data",
"get-data",
"info"
],
"tsEnumNames": [
"setData",
"getData",
"info"
]
},
"payload": {
Expand Down
2 changes: 1 addition & 1 deletion dist/js/schemas.json

Large diffs are not rendered by default.

26 changes: 18 additions & 8 deletions dist/js/types.ts
Expand Up @@ -27025,19 +27025,29 @@ export interface HistorySchema {
* communication message between iframe and the parent window.
*/
export interface IframeMessageSchema {
/**
* The type of the message to distinguish the direction of the message.
*/
type: "from-iframe-to-host" | "from-host-to-iframe";
/**
* The action to be performed upon receiving the message.
*/
action: "set-data" | "get-data" | "info";
type: Type;
action: Action;
/**
* The content of the message with actual data.
*/
payload: {};
}

/**
* The type of the message to distinguish the direction of the message.
*/
export const enum Type {
fromIframeToHost = "from-iframe-to-host",
fromHostToIframe = "from-host-to-iframe"
}
/**
* The action to be performed upon receiving the message.
*/
export const enum Action {
setData = "set-data",
getData = "get-data",
info = "info"
}

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

Expand Down
9 changes: 9 additions & 0 deletions schema/system/iframe_message.json
Expand Up @@ -11,6 +11,10 @@
"enum": [
"from-iframe-to-host",
"from-host-to-iframe"
],
"tsEnumNames": [
"fromIframeToHost",
"fromHostToIframe"
]
},
"action": {
Expand All @@ -20,6 +24,11 @@
"set-data",
"get-data",
"info"
],
"tsEnumNames": [
"setData",
"getData",
"info"
]
},
"payload": {
Expand Down
2 changes: 1 addition & 1 deletion src/py/mat3ra/esse/data/schemas.py

Large diffs are not rendered by default.

0 comments on commit 0e38ae5

Please sign in to comment.