Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add tsEnums support #314

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions dist/js/schema/system/iframe_message.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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.

Loading