diff --git a/typescript/base/base.ts b/typescript/base/base.ts new file mode 100644 index 0000000000..b6dfd42405 --- /dev/null +++ b/typescript/base/base.ts @@ -0,0 +1,7 @@ +import { LayerController } from "../core/controller/controller.layer"; +import { BroadcastController } from "../core/controller/controller.broadcast"; + +export type Layers = LayerController; + +export type Broadcasts = BroadcastController; + diff --git a/typescript/core/controller/controller.broadcast.ts b/typescript/core/controller/controller.broadcast.ts new file mode 100644 index 0000000000..3b5bf68e1a --- /dev/null +++ b/typescript/core/controller/controller.broadcast.ts @@ -0,0 +1,9 @@ +import { Controller } from './controller'; + +export declare class BroadcastController extends Controller { + on(name: string, fn: Function): Function; + + send(name: string, ...args: any[]): void; + + remove(name: string, fn: Function): this; +} diff --git a/typescript/index.ts b/typescript/index.ts index 432b9d93bd..34afc93a29 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -161,6 +161,8 @@ import { FloatHorizontalLayout } from "./core/wrapper/layout/adapt/float.horizon import { AdaptiveLayout } from "./core/wrapper/layout/layout.adaptive"; import { HexColorChooserPopup } from './case/colorchooser/colorchooser.popup.hex'; import { BlankIconTextItem } from './base/single/button/listitem/blankicontextitem'; +import { Broadcasts, Layers } from "./base/base"; +import { BroadcastController } from "./core/controller/controller.broadcast"; export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { @@ -179,7 +181,10 @@ export interface BI extends _func, _i18n, _base, _inject, _var, _web, _utils { ActionFactory: typeof ActionFactory; ShowAction: typeof ShowAction; Controller: typeof Controller; + Layers: Layers; LayerController: typeof LayerController; + Broadcasts: Broadcasts; + BroadcastController: typeof BroadcastController; Behavior: typeof Behavior; BehaviorFactory: typeof BehaviorFactory; HighlightBehavior: typeof HighlightBehavior; @@ -371,6 +376,7 @@ export { ShowAction, Controller, LayerController, + BroadcastController, Behavior, BehaviorFactory, RedMarkBehavior,