Skip to content

Commit

Permalink
type(bottender-facebook): add type details for feed events (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
wtflink authored Jun 17, 2020
1 parent 611534b commit 8eaf0f6
Showing 1 changed file with 77 additions and 7 deletions.
84 changes: 77 additions & 7 deletions packages/bottender-facebook/src/FacebookTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,92 @@ export type FeedReaction = {

export type FeedEvent = {
item: 'event';
[key: string]: any; // FIXME
message?: string;
postId: string;
story?: string;
eventId: string;
verb: 'add';
createdTime: number;
};

export type FeedPhoto = {
item: 'photo';
[key: string]: any; // FIXME
from: {
id: string;
name?: string;
};
link?: string;
message?: string;
postId: string;
createdTime: number;
photoId: string;
published: 0 | 1;
verb: 'add' | 'edited';
};

export type FeedVideo = {
item: 'video';
[key: string]: any; // FIXME
};
export type FeedVideo =
| {
item: 'video';
from: {
id: string;
name?: string;
};
link?: string;
message?: string;
postId: string;
createdTime: number;
published: 0 | 1;
verb: 'add' | 'edited';
videoId: string;
}
| {
item: 'video';
from: {
id: string;
name?: string;
};
postId: string;
createdTime: number;
verb: 'remove';
recipientId: string;
}
| {
item: 'video';
link: string;
message?: string;
videoFlagReason: 1;
verb: 'mute';
videoId: string;
}
| {
item: 'video';
message?: string;
videoFlagReason: 1;
verb: 'block';
videoId: string;
}
| {
item: 'video';
link: string;
message?: string;
videoFlagReason: 1;
verb: 'unblock';
videoId: string;
};

export type FeedShare = {
item: 'share';
[key: string]: any; // FIXME
from: {
id: string;
name?: string;
};
link?: string;
message?: string;
postId: string;
createdTime: number;
published: 0 | 1;
verb: 'add' | 'edited';
shareId: string;
};

export type FeedPageLike = {
Expand Down

0 comments on commit 8eaf0f6

Please sign in to comment.