type DeliveryContext = { isRedelivery: boolean; }; type SourceUser = { type: 'user'; userId: string; }; type SourceGroup = { type: 'group'; groupId: string; userId?: string; }; type SourceRoom = { type: 'room'; roomId: string; userId?: string; }; type Source = SourceUser | SourceGroup | SourceRoom; type CommonProperties = { type: string; mode: 'active' | 'standby'; replyToken?: string; timestamp: number; source?: Source; webhookEventId: string; deliveryContext: DeliveryContext; destination: string; }; type EventMode = { mode: 'active'; replyToken: string; } | { mode: 'standby'; replyToken?: undefined; }; type Emoji = { index: number; length: number; productId: string; emojiId: string; }; type Mentionee = { index: number; length: number; type: 'user' | 'bot'; userId?: string; isSelf?: boolean; quotedMessageId?: string; }; type Mention = { mentionees: Mentionee[]; }; type ContentProvider = { type: 'line' | 'external'; originalContentUrl?: string; previewImageUrl?: string; }; type TextMessage = { id: string; type: 'text'; quoteToken: string; text: string; emojis?: Array; mention?: Mention; }; type ImageMessage = { id: string; type: 'image'; quoteToken: string; contentProvider: ContentProvider; imageSet?: { id: string; index: number; total: number; }; }; type VideoMessage = { id: string; type: 'video'; quoteToken: string; duration: number; contentProvider: ContentProvider; }; type AudioMessage = { id: string; type: 'audio'; quoteToken: string; duration: number; contentProvider: ContentProvider; }; type FileMessage = { id: string; type: 'file'; fileName: string; fileSize: number; }; type LocationMessage = { id: string; type: 'location'; title?: string; address?: string; latitude: number; longitude: number; }; type MessageEvent = { type: EventType.Message; replyToken: string; message: TextMessage | ImageMessage | VideoMessage | AudioMessage | FileMessage | LocationMessage; }; type UnsendEvent = { type: EventType.Unsend; unsend: { messageId: string; }; }; type FollowEvent = { type: EventType.Follow; replyToken: string; follow: { isUnblocked: boolean; }; }; type UnfollowEvent = { type: EventType.Unfollow; }; type JoinEvent = { type: EventType.Join; replyToken: string; }; type LeaveEvent = { type: EventType.Leave; }; type MemberJoinedEvent = { type: EventType.MemberJoined; replyToken: string; joined: { members: Array; }; }; type MemberLeftEvent = { type: EventType.MemberLeft; left: { members: Array; }; }; type PostbackDateTime = { date: string; } | { time: string; } | { dateTime: string; }; type PostbackRichMenu = { newRichMenuAliasId?: string; status: 'SUCCESS' | 'RICHMENU_ALIAS_ID_NOTFOUND' | 'RICHMENU_NOTFOUND' | 'FAILED'; }; type Postback = { data: string; params?: PostbackDateTime | PostbackRichMenu; }; type PostbackEvent = { type: EventType.Postback; replyToken: string; postback: Postback; }; type VideoPlayCompleteEvent = { type: EventType.VideoPlayComplete; replyToken: string; videoPlayComplete: { trackingId: string; }; }; type BeaconEvent = { type: EventType.Beacon; replyToken: string; beacon: { hwid: string; type: 'enter' | 'stay' | 'leave'; dm?: string; }; }; type AccountLinkEvent = { type: EventType.AccountLink; replyToken: string; link: { result: 'ok' | 'failed'; nonce: string; }; }; type MembershipEvent = { type: EventType.Membership; replyToken: string; membership: { type: 'joined' | 'left' | 'renewed'; membershipId: string; }; }; export declare enum EventType { Message = "message", Unsend = "unsend", Follow = "follow", Unfollow = "unfollow", Join = "join", Leave = "leave", MemberJoined = "memberJoined", MemberLeft = "memberLeft", Postback = "postback", VideoPlayComplete = "videoPlayComplete", Beacon = "beacon", AccountLink = "accountLink", Membership = "membership" } type EventBody = MessageEvent | UnsendEvent | FollowEvent | UnfollowEvent | JoinEvent | LeaveEvent | MemberJoinedEvent | MemberLeftEvent | PostbackEvent | VideoPlayCompleteEvent | BeaconEvent | AccountLinkEvent | MembershipEvent; export type IEvent = CommonProperties & EventMode & EventBody; export interface IWebhook { destination: string; events: IEvent[]; } export {};