-
Notifications
You must be signed in to change notification settings - Fork 19
/
index.d.ts
81 lines (77 loc) · 2.59 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import React from 'react'
type ClassName = string | Record<string, unknown>
export interface GraphImageProp {
handle: string
height: number
width: number
}
export interface GraphImageProps {
/**
* Passed to the img element
*/
title?: string
/**
* Passed to the img element
*/
alt?: string
/**
* Passed to the wrapper `div`. Object is needed to support Glamor's css prop
*/
className?: ClassName
/**
* Passed to the outer wrapper `div`. Object is needed to support Glamor's css prop
*/
outerWrapperClassName?: ClassName
/**
* Spread into the default styles in the wrapper `div`
*/
style?: React.CSSProperties
/**
* An object of shape `{ handle, width, height }`. Handle is an identifier required to display the image
* and both `width` and `height` are required to display a correct placeholder and aspect ratio for the image.
* You can get all 3 by just putting all 3 in your image-getting query.
*/
image: GraphImageProp
/**
* When resizing the image, how would you like it to fit the new dimensions?
* Defaults to crop. You can read more about resizing [here](https://www.filestack.com/docs/image-transformations/resize)
*/
fit?: 'clip' | 'crop' | 'scale' | 'max'
/**
* Maximum width you'd like your image to take up.
* (ex. If your image container is resizing dynamically up to a width of 1200, put it as a `maxWidth`)
*/
maxWidth?: number
/**
* If webp is supported by the browser, the images will be served with `.webp` extension. (Recommended)
*/
withWebp?: boolean
/**
* Array of `string`s, each representing a separate Filestack transform,
* eg. `['sharpen=amount:5', 'quality=value:75']`
*/
transforms?: string[]
/**
* A callback that is called when the full-size image has loaded.
*/
onLoad?: () => void
/**
* Would you like to display a blurry placeholder for your loading image? Defaults to `true`.
*/
blurryPlaceholder?: boolean
/**
* Set a colored background placeholder. If true, uses "lightgray" for the color.
* You can also pass in any valid color string.
*/
backgroundColor?: string | boolean
/**
* Do you want your image to fade in on load? Defaults to `true`
*/
fadeIn?: boolean
/**
* Set the base src from where the images are requested.
* Base URI Defaults to `https://media.graphassets.com`
*/
baseURI?: string
}
export default class GraphImage extends React.Component<GraphImageProps> {}