@workadventure/iframe-api-typings
Advanced tools
Comparing version
@@ -1,50 +0,80 @@ | ||
import SoundConfig = Phaser.Types.Sound.SoundConfig; | ||
interface WorkAdventureApi { | ||
import type { ButtonDescriptor } from "./Api/iframe/Ui/ButtonDescriptor"; | ||
import type { Popup } from "./Api/iframe/Ui/Popup"; | ||
import type { Sound } from "./Api/iframe/Sound/Sound"; | ||
declare const wa: { | ||
ui: import("./Api/iframe/ui").WorkAdventureUiCommands; | ||
nav: import("./Api/iframe/nav").WorkadventureNavigationCommands; | ||
controls: import("./Api/iframe/controls").WorkadventureControlsCommands; | ||
chat: import("./Api/iframe/chat").WorkadventureChatCommands; | ||
sound: import("./Api/iframe/sound").WorkadventureSoundCommands; | ||
room: import("./Api/iframe/room").WorkadventureRoomCommands; | ||
player: import("./Api/iframe/player").WorkadventurePlayerCommands; | ||
/** | ||
* @deprecated Use WA.chat.sendChatMessage instead | ||
*/ | ||
sendChatMessage(message: string, author: string): void; | ||
onChatMessage(callback: (message: string) => void): void; | ||
onEnterZone(name: string, callback: () => void): void; | ||
onLeaveZone(name: string, callback: () => void): void; | ||
openPopup(targetObject: string, message: string, buttons: ButtonDescriptor[]): Popup; | ||
openTab(url: string): void; | ||
goToPage(url: string): void; | ||
openCoWebSite(url: string, allowApi?: boolean, allowPolicy?: string): void; | ||
closeCoWebSite(): void; | ||
/** | ||
* @deprecated Use WA.chat.disablePlayerControls instead | ||
*/ | ||
disablePlayerControls(): void; | ||
/** | ||
* @deprecated Use WA.controls.restorePlayerControls instead | ||
*/ | ||
restorePlayerControls(): void; | ||
/** | ||
* @deprecated Use WA.ui.displayBubble instead | ||
*/ | ||
displayBubble(): void; | ||
/** | ||
* @deprecated Use WA.ui.removeBubble instead | ||
*/ | ||
removeBubble(): void; | ||
/** | ||
* @deprecated Use WA.nav.openTab instead | ||
*/ | ||
openTab(url: string): void; | ||
/** | ||
* @deprecated Use WA.sound.loadSound instead | ||
*/ | ||
loadSound(url: string): Sound; | ||
} | ||
declare global { | ||
var WA: WorkAdventureApi; | ||
} | ||
declare type ButtonClickedCallback = (popup: Popup) => void; | ||
interface ButtonDescriptor { | ||
/** | ||
* The label of the button | ||
* @deprecated Use WA.nav.goToPage instead | ||
*/ | ||
label: string; | ||
goToPage(url: string): void; | ||
/** | ||
* The type of the button. Can be one of "normal", "primary", "success", "warning", "error", "disabled" | ||
* @deprecated Use WA.nav.goToRoom instead | ||
*/ | ||
className?: "normal" | "primary" | "success" | "warning" | "error" | "disabled"; | ||
goToRoom(url: string): void; | ||
/** | ||
* Callback called if the button is pressed | ||
* @deprecated Use WA.nav.openCoWebSite instead | ||
*/ | ||
callback: ButtonClickedCallback; | ||
} | ||
export declare class Popup { | ||
private id; | ||
constructor(id: number); | ||
openCoWebSite(url: string, allowApi?: boolean, allowPolicy?: string): void; | ||
/** | ||
* Closes the popup | ||
* @deprecated Use WA.nav.closeCoWebSite instead | ||
*/ | ||
close(): void; | ||
closeCoWebSite(): void; | ||
/** | ||
* @deprecated Use WA.controls.restorePlayerControls instead | ||
*/ | ||
openPopup(targetObject: string, message: string, buttons: ButtonDescriptor[]): Popup; | ||
/** | ||
* @deprecated Use WA.chat.onChatMessage instead | ||
*/ | ||
onChatMessage(callback: (message: string) => void): void; | ||
/** | ||
* @deprecated Use WA.room.onEnterZone instead | ||
*/ | ||
onEnterZone(name: string, callback: () => void): void; | ||
/** | ||
* @deprecated Use WA.room.onLeaveZone instead | ||
*/ | ||
onLeaveZone(name: string, callback: () => void): void; | ||
}; | ||
export declare type WorkAdventureApi = typeof wa; | ||
declare global { | ||
interface Window { | ||
WA: WorkAdventureApi; | ||
} | ||
let WA: WorkAdventureApi; | ||
} | ||
export declare class Sound { | ||
private url; | ||
constructor(url: string); | ||
play(config: SoundConfig): string; | ||
stop(): string; | ||
} | ||
export {}; |
{ | ||
"name": "@workadventure/iframe-api-typings", | ||
"version": "v1.4.6", | ||
"version": "v1.4.7", | ||
"description": "Typescript typings for WorkAdventure iFrame API", | ||
@@ -5,0 +5,0 @@ "main": "iframe_api.js", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
28264
875.29%41
925%701
1274.51%2
100%