Merge branch 'update-game-tiles' into metadataScriptingApi
This commit is contained in:
commit
796a9418d3
6 changed files with 79 additions and 42 deletions
|
@ -17,6 +17,7 @@ import type { LayerEvent } from './LayerEvent';
|
|||
import type { SetPropertyEvent } from "./setPropertyEvent";
|
||||
import type { TagEvent } from "./TagEvent";
|
||||
import type { TilesetEvent } from "./TilesetEvent";
|
||||
import type { UpdateTileEvent } from "./UpdateTileEvent";
|
||||
|
||||
export interface TypedMessageEvent<T> extends MessageEvent {
|
||||
data: T
|
||||
|
@ -43,7 +44,8 @@ export type IframeEventMap = {
|
|||
setProperty: SetPropertyEvent
|
||||
getDataLayer: undefined
|
||||
getTag: undefined
|
||||
tilsetEvent: TilesetEvent
|
||||
tilesetEvent: TilesetEvent
|
||||
updateTileEvent: UpdateTileEvent
|
||||
}
|
||||
export interface IframeEvent<T extends keyof IframeEventMap> {
|
||||
type: T;
|
||||
|
|
15
front/src/Api/Events/UpdateTileEvent.ts
Normal file
15
front/src/Api/Events/UpdateTileEvent.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
import * as tg from "generic-type-guard";
|
||||
|
||||
|
||||
export const isUpdateTileEvent = tg.isArray(
|
||||
new tg.IsInterface().withProperties({
|
||||
x: tg.isNumber,
|
||||
y: tg.isNumber,
|
||||
tile: tg.isUnion(tg.isNumber, tg.isString),
|
||||
layer: tg.isString
|
||||
}).get()
|
||||
);
|
||||
/**
|
||||
* A message sent from the game to the iFrame when a user enters or leaves a zone marked with the "zone" property.
|
||||
*/
|
||||
export type UpdateTileEvent = tg.GuardedType<typeof isUpdateTileEvent>;
|
Loading…
Add table
Add a link
Reference in a new issue