UNPKG

3.58 kBJavaScriptView Raw
1/**
2 * The possible methods that can be used to fit the image.
3 * {@docCategory Image}
4 */
5export var ImageFit;
6(function (ImageFit) {
7 /**
8 * The image is not scaled. The image is centered and cropped within the content box.
9 */
10 ImageFit[ImageFit["center"] = 0] = "center";
11 /**
12 * The image is scaled to maintain its aspect ratio while being fully contained within the frame. The image will
13 * be centered horizontally and vertically within the frame. The space in the top and bottom or in the sides of
14 * the frame will be empty depending on the difference in aspect ratio between the image and the frame.
15 */
16 ImageFit[ImageFit["contain"] = 1] = "contain";
17 /**
18 * The image is scaled to maintain its aspect ratio while filling the frame. Portions of the image will be cropped
19 * from the top and bottom, or the sides, depending on the difference in aspect ratio between the image and the frame.
20 */
21 ImageFit[ImageFit["cover"] = 2] = "cover";
22 /**
23 * Neither the image nor the frame are scaled. If their sizes do not match, the image will either be cropped or the
24 * frame will have empty space.
25 */
26 ImageFit[ImageFit["none"] = 3] = "none";
27 /**
28 * The image will be centered horizontally and vertically within the frame and maintains its aspect ratio. It will
29 * behave as ImageFit.center if the image's natural height or width is less than the Image frame's height or width,
30 * but if both natural height and width are larger than the frame it will behave as ImageFit.cover.
31 */
32 ImageFit[ImageFit["centerCover"] = 4] = "centerCover";
33 /**
34 * The image will be centered horizontally and vertically within the frame and maintains its aspect ratio. It will
35 * behave as ImageFit.center if the image's natural height and width is less than the Image frame's height and width,
36 * but if either natural height or width are larger than the frame it will behave as ImageFit.contain.
37 */
38 ImageFit[ImageFit["centerContain"] = 5] = "centerContain";
39})(ImageFit || (ImageFit = {}));
40/**
41 * The cover style to be used on the image
42 * {@docCategory Image}
43 */
44export var ImageCoverStyle;
45(function (ImageCoverStyle) {
46 /**
47 * The image will be shown at 100% height of container and the width will be scaled accordingly
48 */
49 ImageCoverStyle[ImageCoverStyle["landscape"] = 0] = "landscape";
50 /**
51 * The image will be shown at 100% width of container and the height will be scaled accordingly
52 */
53 ImageCoverStyle[ImageCoverStyle["portrait"] = 1] = "portrait";
54})(ImageCoverStyle || (ImageCoverStyle = {}));
55/**
56 * {@docCategory Image}
57 */
58export var ImageLoadState;
59(function (ImageLoadState) {
60 /**
61 * The image has not yet been loaded, and there is no error yet.
62 */
63 ImageLoadState[ImageLoadState["notLoaded"] = 0] = "notLoaded";
64 /**
65 * The image has been loaded successfully.
66 */
67 ImageLoadState[ImageLoadState["loaded"] = 1] = "loaded";
68 /**
69 * An error has been encountered while loading the image.
70 */
71 ImageLoadState[ImageLoadState["error"] = 2] = "error";
72 /**
73 * Deprecated at v1.3.6, to replace the src in case of errors, use `onLoadingStateChange` instead
74 * and rerender the Image with a difference src.
75 * @deprecated Use `onLoadingStateChange` instead
76 * and rerender the Image with a difference src.
77 */
78 ImageLoadState[ImageLoadState["errorLoaded"] = 3] = "errorLoaded";
79})(ImageLoadState || (ImageLoadState = {}));
80//# sourceMappingURL=Image.types.js.map
\No newline at end of file