workadventure/front/src/Api/iframe/Ui/Popup.ts

19 lines
432 B
TypeScript
Raw Normal View History

2021-09-06 14:27:54 +02:00
import { sendToWorkadventure } from "../IframeApiContribution";
import type { ClosePopupEvent } from "../../Events/ClosePopupEvent";
2021-06-21 12:26:12 +02:00
export class Popup {
2021-09-06 14:27:54 +02:00
constructor(private id: number) {}
2021-06-21 12:26:12 +02:00
/**
* Closes the popup
*/
public close(): void {
sendToWorkadventure({
2021-09-06 14:27:54 +02:00
type: "closePopup",
data: {
popupId: this.id,
} as ClosePopupEvent,
2021-06-21 12:26:12 +02:00
});
}
}