-
Notifications
You must be signed in to change notification settings - Fork 18
/
index.d.ts
55 lines (49 loc) · 1.49 KB
/
index.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
declare class ImgixClient {
domain: string;
useHTTPS: boolean;
includeLibraryParam: boolean;
secureURLToken: string;
constructor(opts: {
domain: string;
secureURLToken?: string;
useHTTPS?: boolean;
includeLibraryParam?: boolean;
});
buildURL(
path: string,
params?: {},
options?: { disablePathEncoding?: boolean },
): string;
_sanitizePath(path: string, options?: { encode?: boolean }): string;
_buildParams(params: {}): string;
_signParams(path: string, queryParams?: {}): string;
buildSrcSet(path: string, params?: {}, options?: SrcSetOptions): string;
_buildSrcSetPairs(path: string, params?: {}, options?: SrcSetOptions): string;
_buildDPRSrcSet(path: string, params?: {}, options?: SrcSetOptions): string;
static targetWidths(
minWidth?: number,
maxWidth?: number,
widthTolerance?: number,
cache?: {},
): number[];
static _buildURL(path: string, params?: {}, options?: {}): string;
static _buildSrcSet(
path: string,
params?: {},
srcSetOptions?: {},
clientOptions?: {},
): string;
}
export type DevicePixelRatio = 1 | 2 | 3 | 4 | 5 | number;
export type VariableQualities = { [key in DevicePixelRatio]?: number };
export interface SrcSetOptions {
widths?: number[];
widthTolerance?: number;
minWidth?: number;
maxWidth?: number;
disableVariableQuality?: boolean;
devicePixelRatios?: DevicePixelRatio[];
variableQualities?: VariableQualities;
disablePathEncoding?: boolean;
}
export default ImgixClient;