forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apps.ts
28 lines (21 loc) · 951 Bytes
/
apps.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
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {IntlShape} from 'react-intl';
import {AppCallRequest, AppCallResponse, AppCallType, AppContext} from 'mattermost-redux/types/apps';
import {Post} from 'mattermost-redux/types/posts';
export type DoAppCallResult<Res=unknown> = {
data?: AppCallResponse<Res>;
error?: AppCallResponse<Res>;
}
export interface DoAppCall<Res=unknown> {
(call: AppCallRequest, type: AppCallType, intl: IntlShape): Promise<DoAppCallResult<Res>>;
}
export interface PostEphemeralCallResponseForPost {
(response: AppCallResponse, message: string, post: Post): void;
}
export interface PostEphemeralCallResponseForChannel {
(response: AppCallResponse, message: string, channelID: string): void;
}
export interface PostEphemeralCallResponseForContext {
(response: AppCallResponse, message: string, context: AppContext): void;
}