fixed wrong import
This commit is contained in:
parent
ba1bcf226a
commit
64a00481f0
4 changed files with 24 additions and 21 deletions
|
@ -1,5 +1,4 @@
|
||||||
import * as tg from "generic-type-guard";
|
import * as tg from "generic-type-guard";
|
||||||
import { iframeListener } from '../../IframeListener';
|
|
||||||
|
|
||||||
export const isMenuItemClickedEvent =
|
export const isMenuItemClickedEvent =
|
||||||
new tg.IsInterface().withProperties({
|
new tg.IsInterface().withProperties({
|
||||||
|
@ -11,11 +10,3 @@ export const isMenuItemClickedEvent =
|
||||||
export type MenuItemClickedEvent = tg.GuardedType<typeof isMenuItemClickedEvent>;
|
export type MenuItemClickedEvent = tg.GuardedType<typeof isMenuItemClickedEvent>;
|
||||||
|
|
||||||
|
|
||||||
export function sendMenuClickedEvent(menuItem: string) {
|
|
||||||
iframeListener.postMessage({
|
|
||||||
'type': 'menuItemClicked',
|
|
||||||
'data': {
|
|
||||||
menuItem: menuItem,
|
|
||||||
} as MenuItemClickedEvent
|
|
||||||
});
|
|
||||||
}
|
|
11
front/src/Api/iframe/Ui/MenuItem.ts
Normal file
11
front/src/Api/iframe/Ui/MenuItem.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import type { MenuItemClickedEvent } from '../../Events/ui/MenuItemClickedEvent';
|
||||||
|
import { iframeListener } from '../../IframeListener';
|
||||||
|
|
||||||
|
export function sendMenuClickedEvent(menuItem: string) {
|
||||||
|
iframeListener.postMessage({
|
||||||
|
'type': 'menuItemClicked',
|
||||||
|
'data': {
|
||||||
|
menuItem: menuItem,
|
||||||
|
} as MenuItemClickedEvent
|
||||||
|
});
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import { sendMenuClickedEvent } from '../../Api/Events/ui/MenuItemClickedEvent';
|
|
||||||
import { registerMenuCommandStream } from '../../Api/Events/ui/MenuItemRegisterEvent';
|
import { registerMenuCommandStream } from '../../Api/Events/ui/MenuItemRegisterEvent';
|
||||||
|
import { sendMenuClickedEvent } from '../../Api/iframe/Ui/MenuItem';
|
||||||
import { connectionManager } from "../../Connexion/ConnectionManager";
|
import { connectionManager } from "../../Connexion/ConnectionManager";
|
||||||
import { localUserStore } from "../../Connexion/LocalUserStore";
|
import { localUserStore } from "../../Connexion/LocalUserStore";
|
||||||
import { worldFullWarningStream } from "../../Connexion/WorldFullWarningStream";
|
import { worldFullWarningStream } from "../../Connexion/WorldFullWarningStream";
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import {registeredCallbacks} from "./Api/iframe/registeredCallbacks";
|
|
||||||
import {
|
import {
|
||||||
IframeResponseEvent,
|
IframeResponseEvent,
|
||||||
IframeResponseEventMap,
|
IframeResponseEventMap,
|
||||||
|
@ -6,15 +5,17 @@ import {
|
||||||
TypedMessageEvent
|
TypedMessageEvent
|
||||||
} from "./Api/Events/IframeEvent";
|
} from "./Api/Events/IframeEvent";
|
||||||
import chat from "./Api/iframe/chat";
|
import chat from "./Api/iframe/chat";
|
||||||
import type {IframeCallback} from './Api/iframe/IframeApiContribution';
|
|
||||||
import nav from "./Api/iframe/nav";
|
|
||||||
import controls from "./Api/iframe/controls";
|
import controls from "./Api/iframe/controls";
|
||||||
import ui from "./Api/iframe/ui";
|
import type { IframeCallback } from './Api/iframe/IframeApiContribution';
|
||||||
import sound from "./Api/iframe/sound";
|
import nav from "./Api/iframe/nav";
|
||||||
|
import { registeredCallbacks } from "./Api/iframe/registeredCallbacks";
|
||||||
import room from "./Api/iframe/room";
|
import room from "./Api/iframe/room";
|
||||||
import type {ButtonDescriptor} from "./Api/iframe/Ui/ButtonDescriptor";
|
import sound from "./Api/iframe/sound";
|
||||||
import type {Popup} from "./Api/iframe/Ui/Popup";
|
import type { Sound } from "./Api/iframe/Sound/Sound";
|
||||||
import type {Sound} from "./Api/iframe/Sound/Sound";
|
import ui from "./Api/iframe/ui";
|
||||||
|
import type { ButtonDescriptor } from "./Api/iframe/Ui/ButtonDescriptor";
|
||||||
|
import type { Popup } from "./Api/iframe/Ui/Popup";
|
||||||
|
|
||||||
|
|
||||||
const wa = {
|
const wa = {
|
||||||
ui,
|
ui,
|
||||||
|
@ -77,7 +78,7 @@ const wa = {
|
||||||
/**
|
/**
|
||||||
* @deprecated Use WA.sound.loadSound instead
|
* @deprecated Use WA.sound.loadSound instead
|
||||||
*/
|
*/
|
||||||
loadSound(url: string) : Sound {
|
loadSound(url: string): Sound {
|
||||||
console.warn('Method WA.loadSound is deprecated. Please use WA.sound.loadSound instead');
|
console.warn('Method WA.loadSound is deprecated. Please use WA.sound.loadSound instead');
|
||||||
return sound.loadSound(url);
|
return sound.loadSound(url);
|
||||||
},
|
},
|
||||||
|
@ -85,7 +86,7 @@ const wa = {
|
||||||
/**
|
/**
|
||||||
* @deprecated Use WA.nav.goToPage instead
|
* @deprecated Use WA.nav.goToPage instead
|
||||||
*/
|
*/
|
||||||
goToPage(url : string) : void {
|
goToPage(url: string): void {
|
||||||
console.warn('Method WA.goToPage is deprecated. Please use WA.nav.goToPage instead');
|
console.warn('Method WA.goToPage is deprecated. Please use WA.nav.goToPage instead');
|
||||||
nav.goToPage(url);
|
nav.goToPage(url);
|
||||||
},
|
},
|
||||||
|
@ -101,7 +102,7 @@ const wa = {
|
||||||
/**
|
/**
|
||||||
* @deprecated Use WA.nav.openCoWebSite instead
|
* @deprecated Use WA.nav.openCoWebSite instead
|
||||||
*/
|
*/
|
||||||
openCoWebSite(url : string) : void{
|
openCoWebSite(url: string): void {
|
||||||
console.warn('Method WA.openCoWebSite is deprecated. Please use WA.nav.openCoWebSite instead');
|
console.warn('Method WA.openCoWebSite is deprecated. Please use WA.nav.openCoWebSite instead');
|
||||||
nav.openCoWebSite(url);
|
nav.openCoWebSite(url);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue