forked from deptagency/dept-engineering-blog-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
59 lines (51 loc) · 1.35 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
declare module '@tryghost/admin-api'
declare module 'hast-util-to-string' {
import { Node } from 'unist'
export default function toString(node: Node): string
}
declare module 'probe-image-size' {
/**
* Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD.
*/
declare function probe(
source: string,
opts: probe.ProbeOptions,
callback: probe.ProbeCallback
): void
declare function probe(
source: string,
opts?: probe.ProbeOptions
): Promise<probe.ProbeResult>
declare function probe(
source: string | NodeJS.ReadableStream,
callback: probe.ProbeCallback
): void
declare function probe(
source: NodeJS.ReadableStream
): Promise<probe.ProbeResult>
declare namespace probe {
interface ProbeResult {
width: number
height: number
length: number
type: string
mime: string
wUnits: string
hUnits: string
url: string
}
interface ProbeOptions {
open_timeout?: number
response_timeout?: number
read_timeout?: number
follow_max?: number
}
interface ProbeError extends Error {
code?: 'ECONTENT'
status?: number
}
type ProbeCallback = (err: ProbeError | null, result: ProbeResult) => void
function sync(data: Buffer): ProbeResult | null
}
export = probe
}