@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
15 lines (14 loc) • 1.08 kB
TypeScript
import { EventHandler } from '@microsoft/teams.common';
import { App } from './app';
import { IActivityEvent, IActivityResponseEvent, IActivitySentEvent, IErrorEvent } from './events';
import { AppEvents, IPlugin, ISender } from './types';
/**
* subscribe to an event
* @param name the event to subscribe to
* @param cb the callback to invoke
*/
export declare function event<TPlugin extends IPlugin, Name extends keyof AppEvents<TPlugin>>(this: App<TPlugin>, name: Name, cb: EventHandler<AppEvents<TPlugin>[Name]>): App<TPlugin>;
export declare function onError<TPlugin extends IPlugin>(this: App<TPlugin>, event: IErrorEvent): Promise<void>;
export declare function onActivity<TPlugin extends IPlugin>(this: App<TPlugin>, sender: ISender, event: IActivityEvent): Promise<void>;
export declare function onActivitySent<TPlugin extends IPlugin>(this: App<TPlugin>, sender: ISender, event: IActivitySentEvent): Promise<void>;
export declare function onActivityResponse<TPlugin extends IPlugin>(this: App<TPlugin>, sender: ISender, event: IActivityResponseEvent): Promise<void>;