mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-21 13:09:15 +00:00
fix: MessageMedia interface to class (index.d.ts) (#301)
* fix: change MessageMedia to class * fix: remove all references to MessageMediaInterface * add MessageMedia constructor params docs
This commit is contained in:
22
index.d.ts
vendored
22
index.d.ts
vendored
@@ -513,12 +513,24 @@ declare namespace WAWebJS {
|
|||||||
media?: MessageMedia
|
media?: MessageMedia
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MessageMedia {
|
/** Media attached to a message */
|
||||||
data: string,
|
export class MessageMedia {
|
||||||
mimetype: string,
|
/** MIME type of the attachment */
|
||||||
filename?: string | null,
|
mimetype: string
|
||||||
|
/** Base64-encoded data of the file */
|
||||||
|
data: string
|
||||||
|
/** Document file name. Value can be null */
|
||||||
|
filename?: string | null
|
||||||
|
|
||||||
fromFilePath: (filePath: string) => MessageMedia,
|
/**
|
||||||
|
* @param {string} mimetype MIME type of the attachment
|
||||||
|
* @param {string} data Base64-encoded data of the file
|
||||||
|
* @param {?string} filename Document file name. Value can be null
|
||||||
|
*/
|
||||||
|
constructor(mimetype: string, data: string, filename?: string | null)
|
||||||
|
|
||||||
|
/** Creates a MessageMedia instance from a local file path */
|
||||||
|
static fromFilePath: (filePath: string) => MessageMedia
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MessageContent = string | MessageMedia | Location
|
export type MessageContent = string | MessageMedia | Location
|
||||||
|
|||||||
Reference in New Issue
Block a user