docs: note TypeScript migration
This commit is contained in:
194
whatsapp-router/src/types.ts
Normal file
194
whatsapp-router/src/types.ts
Normal file
@@ -0,0 +1,194 @@
|
||||
export interface ProfilePicThumb {
|
||||
eurl?: string;
|
||||
id?: string;
|
||||
img?: string;
|
||||
imgFull?: string;
|
||||
tag?: string;
|
||||
}
|
||||
|
||||
export interface Sender {
|
||||
id: string;
|
||||
name: string;
|
||||
shortName: string;
|
||||
pushname: string;
|
||||
type: string;
|
||||
isBusiness: boolean;
|
||||
isEnterprise: boolean;
|
||||
isSmb: boolean;
|
||||
isContactSyncCompleted: number;
|
||||
disappearingModeDuration: number;
|
||||
disappearingModeSettingTimestamp: number;
|
||||
textStatusLastUpdateTime: number;
|
||||
syncToAddressbook: boolean;
|
||||
formattedName: string;
|
||||
isMe: boolean;
|
||||
isMyContact: boolean;
|
||||
isPSA: boolean;
|
||||
isUser: boolean;
|
||||
status?: string;
|
||||
isVerified: boolean;
|
||||
isWAContact: boolean;
|
||||
profilePicThumbObj?: ProfilePicThumb;
|
||||
msgs: any;
|
||||
}
|
||||
|
||||
export interface Contact {
|
||||
id: string;
|
||||
name: string;
|
||||
shortName: string;
|
||||
pushname: string;
|
||||
type: string;
|
||||
isBusiness: boolean;
|
||||
isEnterprise: boolean;
|
||||
isSmb: boolean;
|
||||
isContactSyncCompleted: number;
|
||||
disappearingModeDuration: number;
|
||||
disappearingModeSettingTimestamp: number;
|
||||
textStatusLastUpdateTime: number;
|
||||
syncToAddressbook: boolean;
|
||||
formattedName: string;
|
||||
isMe: boolean;
|
||||
isMyContact: boolean;
|
||||
isPSA: boolean;
|
||||
isUser: boolean;
|
||||
isVerified: boolean;
|
||||
isWAContact: boolean;
|
||||
profilePicThumbObj?: Partial<ProfilePicThumb>;
|
||||
msgs: any;
|
||||
}
|
||||
|
||||
export interface Chat {
|
||||
id: string;
|
||||
pendingMsgs: boolean;
|
||||
lastReceivedKey?: {
|
||||
fromMe: boolean;
|
||||
remote: string;
|
||||
id: string;
|
||||
_serialized: string;
|
||||
};
|
||||
t: number;
|
||||
unreadCount: number;
|
||||
unreadDividerOffset: number;
|
||||
archive: boolean;
|
||||
isReadOnly: boolean;
|
||||
isLocked: boolean;
|
||||
muteExpiration: number;
|
||||
isAutoMuted: boolean;
|
||||
name: string;
|
||||
notSpam: boolean;
|
||||
pin: number;
|
||||
ephemeralDuration: number;
|
||||
ephemeralSettingTimestamp: number;
|
||||
disappearingModeInitiator: string;
|
||||
disappearingModeTrigger: string;
|
||||
createdLocally: boolean;
|
||||
unreadMentionsOfMe: any[];
|
||||
unreadMentionCount: number;
|
||||
hasUnreadMention: boolean;
|
||||
archiveAtMentionViewedInDrawer: boolean;
|
||||
hasChatBeenOpened: boolean;
|
||||
tcToken: Record<string, unknown>;
|
||||
tcTokenTimestamp: number;
|
||||
tcTokenSenderTimestamp: number;
|
||||
endOfHistoryTransferType: number;
|
||||
pendingInitialLoading: boolean;
|
||||
chatlistPreview?: any;
|
||||
unreadEditTimestampMs: number;
|
||||
celebrationAnimationLastPlayed: number;
|
||||
hasRequestedWelcomeMsg: boolean;
|
||||
msgs: any;
|
||||
canSend: boolean;
|
||||
isGroup: boolean;
|
||||
pic?: string;
|
||||
formattedTitle: string;
|
||||
contact: Contact;
|
||||
groupMetadata: any;
|
||||
presence?: {
|
||||
id: string;
|
||||
chatstates: any[];
|
||||
};
|
||||
isOnline: boolean;
|
||||
participantsCount: number;
|
||||
}
|
||||
|
||||
export interface WhatsAppMessage {
|
||||
id: string;
|
||||
viewed: boolean;
|
||||
body: string;
|
||||
type: string;
|
||||
t: number;
|
||||
notifyName: string;
|
||||
from: string;
|
||||
to: string;
|
||||
author: string | null;
|
||||
invis: boolean;
|
||||
isNewMsg: boolean;
|
||||
star: boolean;
|
||||
kicNotified: boolean;
|
||||
recvFresh: boolean;
|
||||
isFromTemplate: boolean;
|
||||
thumbnail?: string;
|
||||
pollInvalidated: boolean;
|
||||
isSentCagPollCreation: boolean;
|
||||
latestEditMsgKey: any;
|
||||
latestEditSenderTimestampMs: any;
|
||||
mentionedJidList: any[];
|
||||
groupMentions: any[];
|
||||
isEventCanceled: boolean;
|
||||
eventInvalidated: boolean;
|
||||
isVcardOverMmsDocument: boolean;
|
||||
labels: any[];
|
||||
hasReaction: boolean;
|
||||
ephemeralDuration: number;
|
||||
ephemeralSettingTimestamp: number;
|
||||
disappearingModeInitiator: string;
|
||||
disappearingModeTrigger: string;
|
||||
viewMode: string;
|
||||
productHeaderImageRejected: boolean;
|
||||
lastPlaybackProgress: number;
|
||||
isDynamicReplyButtonsMsg: boolean;
|
||||
isCarouselCard: boolean;
|
||||
parentMsgId: any;
|
||||
callSilenceReason: any;
|
||||
isVideoCall: boolean;
|
||||
callDuration: any;
|
||||
callParticipants: any;
|
||||
isMdHistoryMsg: boolean;
|
||||
stickerSentTs: number;
|
||||
isAvatar: boolean;
|
||||
lastUpdateFromServerTs: number;
|
||||
invokedBotWid: any;
|
||||
bizBotType: any;
|
||||
botResponseTargetId: any;
|
||||
botPluginType: any;
|
||||
botPluginReferenceIndex: any;
|
||||
botPluginSearchProvider: any;
|
||||
botPluginSearchUrl: any;
|
||||
botPluginSearchQuery: any;
|
||||
botPluginMaybeParent: boolean;
|
||||
botReelPluginThumbnailCdnUrl: any;
|
||||
botMessageDisclaimerText: any;
|
||||
botMsgBodyType: any;
|
||||
reportingTokenInfo: any;
|
||||
requiresDirectConnection: boolean;
|
||||
bizContentPlaceholderType: any;
|
||||
hostedBizEncStateMismatch: boolean;
|
||||
senderOrRecipientAccountTypeHosted: boolean;
|
||||
placeholderCreatedWhenAccountIsHosted: boolean;
|
||||
device: number;
|
||||
local: boolean;
|
||||
fromMe: boolean;
|
||||
mId: string;
|
||||
sender: Sender;
|
||||
senderId: any;
|
||||
timestamp: number;
|
||||
content: string;
|
||||
isGroupMsg: boolean;
|
||||
isQuotedMsgAvailable: boolean;
|
||||
isMedia: boolean;
|
||||
chat: Chat;
|
||||
isOnline: boolean;
|
||||
chatId: string;
|
||||
mediaData: Record<string, unknown>;
|
||||
text: string;
|
||||
}
|
||||
Reference in New Issue
Block a user