mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: add "strictNullChecks"
This commit is contained in:
@@ -12,7 +12,7 @@ export interface GroupMetadata {
|
||||
subjectOwner?: string
|
||||
/** group subject modification date */
|
||||
subjectTime?: number
|
||||
creation: number
|
||||
creation?: number
|
||||
desc?: string
|
||||
descOwner?: string
|
||||
descId?: string
|
||||
|
||||
@@ -71,7 +71,8 @@ export type SocketQueryOptions = SocketSendMessageOptions & {
|
||||
requiresPhoneConnection?: boolean
|
||||
}
|
||||
|
||||
export type LegacySocketConfig = CommonSocketConfig<LegacyAuthenticationCreds> & {
|
||||
export type LegacySocketConfig = CommonSocketConfig & {
|
||||
auth?: LegacyAuthenticationCreds
|
||||
/** max time for the phone to respond to a connectivity test */
|
||||
phoneResponseTimeMs: number
|
||||
/** max time for WA server to respond before error with 422 */
|
||||
|
||||
@@ -22,7 +22,7 @@ export type WAMediaUpload = Buffer | { url: URL | string } | { stream: Readable
|
||||
/** Set of message types that are supported by the library */
|
||||
export type MessageType = keyof proto.Message
|
||||
|
||||
export type DownloadableMessage = { mediaKey?: Uint8Array, directPath?: string, url?: string }
|
||||
export type DownloadableMessage = { mediaKey?: Uint8Array | null, directPath?: string | null, url?: string | null }
|
||||
|
||||
export type MessageReceiptType = 'read' | 'read-self' | 'hist_sync' | 'peer_msg' | 'sender' | 'inactive' | undefined
|
||||
|
||||
@@ -37,7 +37,7 @@ export interface WAUrlInfo {
|
||||
'canonical-url': string
|
||||
'matched-text': string
|
||||
title: string
|
||||
description: string
|
||||
description?: string
|
||||
jpegThumbnail?: Buffer
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ export type MediaGenerationOptions = {
|
||||
mediaUploadTimeoutMs?: number
|
||||
}
|
||||
export type MessageContentGenerationOptions = MediaGenerationOptions & {
|
||||
getUrlInfo?: (text: string) => Promise<WAUrlInfo>
|
||||
getUrlInfo?: (text: string) => Promise<WAUrlInfo | undefined>
|
||||
}
|
||||
export type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent
|
||||
|
||||
|
||||
@@ -8,9 +8,7 @@ import { MediaConnInfo } from './Message'
|
||||
export type WAVersion = [number, number, number]
|
||||
export type WABrowserDescription = [string, string, string]
|
||||
|
||||
export type CommonSocketConfig<T> = {
|
||||
/** provide an auth state object to maintain the auth state */
|
||||
auth?: T
|
||||
export type CommonSocketConfig = {
|
||||
/** the WS url to connect to WA */
|
||||
waWebSocketUrl: string | URL
|
||||
/** Fails the connection if the socket times out in this interval */
|
||||
|
||||
@@ -7,7 +7,7 @@ export type ConnectionState = {
|
||||
connection: WAConnectionState
|
||||
/** the error that caused the connection to close */
|
||||
lastDisconnect?: {
|
||||
error: Error
|
||||
error: Error | undefined
|
||||
date: Date
|
||||
}
|
||||
/** is this a new login */
|
||||
|
||||
@@ -17,7 +17,9 @@ import { CommonSocketConfig } from './Socket'
|
||||
|
||||
export type MessageRetryMap = { [msgId: string]: number }
|
||||
|
||||
export type SocketConfig = CommonSocketConfig<AuthenticationState> & {
|
||||
export type SocketConfig = CommonSocketConfig & {
|
||||
/** provide an auth state object to maintain the auth state */
|
||||
auth: AuthenticationState
|
||||
/** By default true, should history messages be downloaded and processed */
|
||||
downloadHistory: boolean
|
||||
/** transaction capability options for SignalKeyStore */
|
||||
@@ -67,18 +69,16 @@ export type WABusinessHoursConfig = {
|
||||
|
||||
export type WABusinessProfile = {
|
||||
description: string
|
||||
email: string
|
||||
email: string | undefined
|
||||
business_hours: {
|
||||
timezone?: string
|
||||
config?: WABusinessHoursConfig[]
|
||||
business_config?: WABusinessHoursConfig[]
|
||||
}
|
||||
website: string[]
|
||||
categories: {
|
||||
id: string
|
||||
localized_display_name: string
|
||||
}[]
|
||||
category?: string
|
||||
wid?: string
|
||||
address?: string
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user