UNPKG

@robotlegsjs/phaser

Version:

RobotlegsJS integration with Phaser Scene Manager

57 lines (56 loc) 2.25 kB
import { IClass, ITypeMatcher } from "@robotlegsjs/core"; import { IMediatorMapper } from "../dsl/IMediatorMapper"; import { IMediatorUnmapper } from "../dsl/IMediatorUnmapper"; export declare const ISceneMediatorMap: unique symbol; /** * The SceneMediator Map allows you to bind Mediators to Phaser.Scene objects */ export interface ISceneMediatorMap { /** * Maps a matcher that will be tested against incoming items to be handled. * * @param matcher The type or package matcher specifying the rules for matching. * @return the mapper so that you can continue the mapping. */ mapMatcher(matcher: ITypeMatcher): IMediatorMapper; /** * Maps a Phaser.Scene that will be tested against incoming items to be handled. * Under the hood this will create a TypeMatcher for this scene. * * @param scene The class or interface to be matched against. * @return the mapper so that you can continue the mapping. */ map(scene: IClass<Phaser.Scene>): IMediatorMapper; /** * Removes a mapping that was made against a matcher. * No error will be thrown if there isn't a mapping to remove. * * @param matcher The type or package matcher specifying the rules for matching. * @return the unmapper so that you can continue the unmapping. */ unmapMatcher(matcher: ITypeMatcher): IMediatorUnmapper; /** * Removes a mapping that was made against a scene. * No error will be thrown if there isn't a mapping to remove. * * @param scene The class or interface to be matched against. * @return the unmapper so that you can continue the unmapping. */ unmap(scene: IClass<Phaser.Scene>): IMediatorUnmapper; /** * Mediates an scene directly. If the scene matches any mapped matchers or types then it will be mediated according to those mappings. * * @param scene The scene to create mediators for. */ mediate(scene: IClass<Phaser.Scene>): void; /** * Removes the mediators for an scene if there are any. * * @param scene The scene to remove mediators for. */ unmediate(scene: IClass<Phaser.Scene>): void; /** * Removes all mediators */ unmediateAll(): void; }