workadventure/front/src/Api/iframe/Ui/Popup.ts
2021-09-06 14:31:59 +02:00

19 lines
432 B
TypeScript

import { sendToWorkadventure } from "../IframeApiContribution";
import type { ClosePopupEvent } from "../../Events/ClosePopupEvent";
export class Popup {
constructor(private id: number) {}
/**
* Closes the popup
*/
public close(): void {
sendToWorkadventure({
type: "closePopup",
data: {
popupId: this.id,
} as ClosePopupEvent,
});
}
}