summaryrefslogtreecommitdiff
path: root/src/@types
diff options
context:
space:
mode:
Diffstat (limited to 'src/@types')
-rw-r--r--src/@types/probe-image-size.d.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/@types/probe-image-size.d.ts b/src/@types/probe-image-size.d.ts
new file mode 100644
index 0000000000..665edcf2e7
--- /dev/null
+++ b/src/@types/probe-image-size.d.ts
@@ -0,0 +1,27 @@
+declare module 'probe-image-size' {
+ import { ReadStream } from 'fs';
+
+ type ProbeOptions = {
+ retries: 1;
+ timeout: 30000;
+ };
+
+ type ProbeResult = {
+ width: number;
+ height: number;
+ length?: number;
+ type: string;
+ mime: string;
+ wUnits: 'in' | 'mm' | 'cm' | 'pt' | 'pc' | 'px' | 'em' | 'ex';
+ hUnits: 'in' | 'mm' | 'cm' | 'pt' | 'pc' | 'px' | 'em' | 'ex';
+ url?: string;
+ };
+
+ 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;
+
+ namespace probeImageSize {} // Hack
+
+ export = probeImageSize;
+}