diff --git a/front/dist/service-worker-prod.js b/front/dist/service-worker-prod.js index 5ab0e84b..80486623 100644 --- a/front/dist/service-worker-prod.js +++ b/front/dist/service-worker-prod.js @@ -57,4 +57,5 @@ self.addEventListener('update', function(event) { }); self.addEventListener('beforeinstallprompt', (e) => { -//TODO change prompt \ No newline at end of file + //TODO change prompt +}); \ No newline at end of file diff --git a/front/src/Api/iframe/ui.ts b/front/src/Api/iframe/ui.ts index cd0ec05a..c4d40d16 100644 --- a/front/src/Api/iframe/ui.ts +++ b/front/src/Api/iframe/ui.ts @@ -7,7 +7,7 @@ import { Popup } from "./Ui/Popup"; import { ActionMessage } from "./Ui/ActionMessage"; import { isMessageReferenceEvent } from "../Events/ui/TriggerActionMessageEvent"; import { Menu } from "./Ui/Menu"; -import type { RequireOnlyOne } from "../../types"; +import type { RequireOnlyOne } from "../types"; let popupId = 0; const popups: Map = new Map(); @@ -26,7 +26,7 @@ interface MenuDescriptor { allowApi?: boolean; } -type CallbackOrIframe = RequireOnlyOne; +export type MenuOptions = RequireOnlyOne; interface ZonedPopupOptions { zone: string; @@ -119,10 +119,7 @@ export class WorkAdventureUiCommands extends IframeApiContribution void) - ): Menu { + registerMenuCommand(commandDescriptor: string, options: MenuOptions | ((commandDescriptor: string) => void)): Menu { const menu = new Menu(commandDescriptor); if (typeof options === "function") { diff --git a/front/src/Api/types.ts b/front/src/Api/types.ts new file mode 100644 index 00000000..7d1a2107 --- /dev/null +++ b/front/src/Api/types.ts @@ -0,0 +1,4 @@ +export type RequireOnlyOne = Pick> & + { + [K in keys]-?: Required> & Partial, undefined>>; + }[keys]; diff --git a/front/src/Components/Menu/Menu.svelte b/front/src/Components/Menu/Menu.svelte index a8cf36c2..4086a9ae 100644 --- a/front/src/Components/Menu/Menu.svelte +++ b/front/src/Components/Menu/Menu.svelte @@ -9,7 +9,8 @@ import CustomSubMenu from "./CustomSubMenu.svelte" import {customMenuIframe, menuVisiblilityStore, SubMenusInterface, subMenusStore} from "../../Stores/MenuStore"; import {onDestroy, onMount} from "svelte"; - import {get, Unsubscriber} from "svelte/store"; + import {get} from "svelte/store"; + import type {Unsubscriber} from "svelte/store"; import {sendMenuClickedEvent} from "../../Api/iframe/Ui/MenuItem"; let activeSubMenu: string = SubMenusInterface.settings; diff --git a/front/src/types.ts b/front/src/types.ts index 3f566de8..d957a2c2 100644 --- a/front/src/types.ts +++ b/front/src/types.ts @@ -21,8 +21,3 @@ export interface IVirtualJoystick extends Phaser.GameObjects.GameObject { visible: boolean; createCursorKeys: () => CursorKeys; } - -export type RequireOnlyOne = Pick> & - { - [K in keys]-?: Required> & Partial, undefined>>; - }[keys];