Skip to content

Commit

Permalink
update: add enum 2
Browse files Browse the repository at this point in the history
  • Loading branch information
VsevolodX committed Apr 6, 2024
1 parent 6d3b1bf commit afa6ad0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
@@ -1,9 +1,9 @@
import { IframeMessageSchema } from "@mat3ra/esse/dist/js/types";
type HandlerFunction = (...args: IframeMessageSchema["payload"][]) => void | any;
export declare enum ActionEnum {
GET_DATA = "get-data",
SET_DATA = "set-data",
INFO = "info"
GetData = "get-data",
SetData = "set-data",
Info = "info"
}
declare class IframeToFromHostMessageHandler {
private handlers;
Expand Down
12 changes: 6 additions & 6 deletions dist/other/iframe-messaging/IframeToFromHostMessageHandler.js
@@ -1,15 +1,15 @@
export var ActionEnum;
(function (ActionEnum) {
ActionEnum["GET_DATA"] = "get-data";
ActionEnum["SET_DATA"] = "set-data";
ActionEnum["INFO"] = "info";
ActionEnum["GetData"] = "get-data";
ActionEnum["SetData"] = "set-data";
ActionEnum["Info"] = "info";
})(ActionEnum || (ActionEnum = {}));
class IframeToFromHostMessageHandler {
constructor() {
this.handlers = {
[ActionEnum.GET_DATA]: [],
[ActionEnum.SET_DATA]: [],
[ActionEnum.INFO]: [],
[ActionEnum.GetData]: [],
[ActionEnum.SetData]: [],
[ActionEnum.Info]: [],
};
// Default values for the origin URLs to pass the CORS policy, if not provided from the parent component
this.iframeOriginURL = "*";
Expand Down
12 changes: 6 additions & 6 deletions src/other/iframe-messaging/IframeToFromHostMessageHandler.ts
Expand Up @@ -6,16 +6,16 @@ type HandlersMap = {
[action in IframeMessageSchema["action"]]: HandlerFunction[];
};
export enum ActionEnum {
GET_DATA = "get-data",
SET_DATA = "set-data",
INFO = "info",
GetData = "get-data",
SetData = "set-data",
Info = "info",
}

class IframeToFromHostMessageHandler {
private handlers: HandlersMap = {
[ActionEnum.GET_DATA]: [],
[ActionEnum.SET_DATA]: [],
[ActionEnum.INFO]: [],
[ActionEnum.GetData]: [],
[ActionEnum.SetData]: [],
[ActionEnum.Info]: [],
};

// Default values for the origin URLs to pass the CORS policy, if not provided from the parent component
Expand Down

0 comments on commit afa6ad0

Please sign in to comment.