-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathIPostMessageDeleted.ts
37 lines (35 loc) · 1.37 KB
/
IPostMessageDeleted.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { IMessage } from '.';
import { IHttp, IModify, IPersistence, IRead } from '../accessors';
import { IMessageDeleteContext } from './IMessageDeleteContext';
/** Handler for after a message is deleted. */
export interface IPostMessageDeleted {
/**
* Enables the handler to signal to the Apps framework whether
* this handler should actually be executed for after the message
* has been deleted.
*
* @param message The deleted message
* @param read An accessor to the environment
* @param http An accessor to the outside world
* @param context The context of the message which was deleted
* @returns whether to run the executor function
*/
checkPostMessageDeleted?(message: IMessage, read: IRead, http: IHttp, context: IMessageDeleteContext): Promise<boolean>;
/**
* Method called *after* the message has been deleted.
*
* @param message The deleted message
* @param read An accessor to the environment
* @param http An accessor to the outside world
* @param persistence An accessor to the App's persistence
* @param context The context of the message which was deleted
*/
executePostMessageDeleted(
message: IMessage,
read: IRead,
http: IHttp,
persistence: IPersistence,
modify: IModify,
context: IMessageDeleteContext,
): Promise<void>;
}