import type { APIAttachment, APIMessage, Awaitable } from 'discord.js'; /** * Callback used to save an image attachment. * The returned string is the URL that will be used in the transcript. * * `undefined` indicates to use the original attachment URL. * `null` indicates to not include the attachment in the transcript. * `string` indicates to use the returned URL as the attachment URL (base64 or remote image). */ export type ResolveImageCallback = (attachment: APIAttachment, message: APIMessage) => Awaitable; /** * Builder to build an image saving callback with optimization. */ export declare class TranscriptImageDownloader { private static log; private log; private maxFileSize?; private maxDimensions?; private compression?; private sharpModule; /** * Sets the maximum file size for *each* individual image. * Images larger than this will be skipped (not downloaded). * @param size The maximum file size in kilobytes */ withMaxSize(size: number): this; /** * Sets the maximum dimensions for images. Images larger than this * will be resized while maintaining aspect ratio. * Requires `sharp` to be installed. * @param width Maximum width in pixels * @param height Maximum height in pixels */ withMaxDimensions(width: number, height: number): this; /** * Sets the compression quality for each image. * Requires `sharp` to be installed. If sharp is not available, * images will be saved without compression. * @param quality The quality of the image (1 lowest - 100 highest) * @param convertToWebP Whether to convert the image to WebP format */ withCompression(quality?: number, convertToWebP?: boolean): this; /** * Tries to load sharp. Returns the module or null if not available. */ private loadSharp; /** * Builds the image saving callback. */ build(): ResolveImageCallback; }