2023-01-13 05:40:33 +01:00
|
|
|
declare module "probe-image-size" {
|
|
|
|
import type { ReadStream } from "node:fs";
|
2020-01-12 08:40:58 +01:00
|
|
|
|
|
|
|
type ProbeOptions = {
|
|
|
|
retries: 1;
|
|
|
|
timeout: 30000;
|
|
|
|
};
|
|
|
|
|
|
|
|
type ProbeResult = {
|
|
|
|
width: number;
|
|
|
|
height: number;
|
|
|
|
length?: number;
|
|
|
|
type: string;
|
|
|
|
mime: string;
|
2023-01-13 05:40:33 +01:00
|
|
|
wUnits: "in" | "mm" | "cm" | "pt" | "pc" | "px" | "em" | "ex";
|
|
|
|
hUnits: "in" | "mm" | "cm" | "pt" | "pc" | "px" | "em" | "ex";
|
2020-01-12 08:40:58 +01:00
|
|
|
url?: string;
|
|
|
|
};
|
|
|
|
|
2023-01-13 05:40:33 +01:00
|
|
|
function probeImageSize(
|
|
|
|
src: string | ReadStream,
|
|
|
|
options?: ProbeOptions,
|
|
|
|
): Promise<ProbeResult>;
|
|
|
|
function probeImageSize(
|
|
|
|
src: string | ReadStream,
|
|
|
|
callback: (err: Error | null, result?: ProbeResult) => void,
|
|
|
|
): void;
|
|
|
|
function probeImageSize(
|
|
|
|
src: string | ReadStream,
|
|
|
|
options: ProbeOptions,
|
|
|
|
callback: (err: Error | null, result?: ProbeResult) => void,
|
|
|
|
): void;
|
2020-01-12 08:40:58 +01:00
|
|
|
|
|
|
|
namespace probeImageSize {} // Hack
|
|
|
|
|
|
|
|
export = probeImageSize;
|
|
|
|
}
|