UNPKG

@microsoft/teams.apps

Version:

<p> <a href="https://www.npmjs.com/package/@microsoft/teams.apps" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.apps/latest" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.apps?activeTab=code

20 lines (19 loc) • 943 B
import { EventEmitter } from '@microsoft/teams.common'; import { IActivityEvent, IActivityResponseEvent, IActivitySentEvent, IErrorEvent } from './events'; import { AppEvents, IPlugin } from './types'; /** * Owns the app event emitter and fans inbound/outbound activity events out to * plugins before re-emitting them on the app's public event emitter. * * This used to live as a set of `this: App`-bound free functions; it is now a * collaborator the {@link App} constructs and owns. */ export declare class EventManager<TPlugin extends IPlugin = IPlugin> { private readonly events; private readonly plugins; constructor(events: EventEmitter<AppEvents<TPlugin>>, plugins: ReadonlyArray<TPlugin>); onError(event: IErrorEvent): Promise<void>; onActivity(event: IActivityEvent): void; onActivitySent(event: IActivitySentEvent): Promise<void>; onActivityResponse(event: IActivityResponseEvent): Promise<void>; }