-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
403 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'; | ||
|
||
type Percentage = `100%` | `${Digit}${Digit}%` | `${Digit}%`; | ||
|
||
type Pixel = | ||
| `${Digit}${Digit}${Digit}${Digit}px` | ||
| `${Digit}${Digit}${Digit}px` | ||
| `${Digit}${Digit}px`; | ||
|
||
export type ImageSizeTransform = Pixel | Percentage | 'auto'; | ||
|
||
export type MediaTransform = { | ||
/** | ||
* Set the transformed image's width. You can use specific size in | ||
* pixels eg. 100px, a percentage eg. 50% or set as 'auto' to be set automatically. | ||
* | ||
* @defaultValue 'auto' | ||
*/ | ||
width?: ImageSizeTransform; | ||
/** | ||
* Set the transformed image's height. You can use specific size in | ||
* pixels eg. 100px, a percentage eg. 50% or set as 'auto' to be set automatically. | ||
* | ||
* @defaultValue 'auto' | ||
*/ | ||
height?: ImageSizeTransform; | ||
/** | ||
* Set if you want to keep the image's original aspect ratio. | ||
* If explicitly set to false, the image will stretch based on the width and height values. | ||
* | ||
* @defaultValue true | ||
*/ | ||
keepAspectRatio?: boolean; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.