UNPKG

@whiskeysockets/baileys

Version:

A WebSockets library for interacting with WhatsApp Web

22 lines (21 loc) 815 B
import { AxiosRequestConfig } from 'axios'; import { WAMediaUploadFunction, WAUrlInfo } from '../Types'; import { ILogger } from './logger'; export type URLGenerationOptions = { thumbnailWidth: number; fetchOpts: { /** Timeout in ms */ timeout: number; proxyUrl?: string; headers?: AxiosRequestConfig<{}>['headers']; }; uploadImage?: WAMediaUploadFunction; logger?: ILogger; }; /** * Given a piece of text, checks for any URL present, generates link preview for the same and returns it * Return undefined if the fetch failed or no URL was found * @param text first matched URL in text * @returns the URL info required to generate link preview */ export declare const getUrlInfo: (text: string, opts?: URLGenerationOptions) => Promise<WAUrlInfo | undefined>;