Skip to content

Commit be35367

Browse files
Improve docs for round corners and rotate (#373)
* Improve docs for round corners and rotate
1 parent 21d5312 commit be35367

File tree

5 files changed

+23
-12
lines changed

5 files changed

+23
-12
lines changed

src/actions/rotate.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,18 @@
66
* @example
77
* <caption>Rotate by mode</caption>
88
* import {Cloudinary} from "@cloudinary/base";
9-
* import {mode} from "@cloudinary/base/actions/rotate";
9+
* import {mode, byAngle} from "@cloudinary/base/actions/rotate";
1010
* import {autoLeft} from "@cloudinary/base/qualifiers/rotationMode";
1111
*
1212
* const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
1313
* const image = yourCldInstance.image('woman');
14-
* image.rotate(mode(autoLeft());
15-
* image.toURL();
16-
*
17-
* @example
18-
* <caption>Rotate by angle</caption>
19-
* import {Cloudinary} from "@cloudinary/base";
20-
* import {byAngle} from "@cloudinary/base/actions/rotate";
2114
*
22-
* const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
23-
* const image = yourCldInstance.image('woman');
15+
* // Rotate by mode
16+
* image.rotate(mode(autoLeft());
2417
*
18+
* // Rotate by angle
2519
* image.rotate(byAngle(90));
20+
*
2621
* image.toURL();
2722
*/
2823

src/actions/roundCorners.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
* {@link https://cloudinary.com/documentation/video_manipulation_and_delivery#rounding_corners_and_creating_circular_videos | Rounded videos}
77
* @memberOf Actions
88
* @namespace RoundCorners
9+
* @example
10+
* <caption>Round corners by a radius</caption>
11+
* import {Cloudinary} from "@cloudinary/base";
12+
* import {byRadius, max} from "@cloudinary/base/actions/roundCorners";
13+
*
14+
* const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
15+
* const image = yourCldInstance.image('woman');
16+
* // By a radius
17+
* image.roundCorners(byRadius(10));
18+
* // Or just the maximum possible
19+
* image.roundCorners(max());
20+
* image.toURL();
921
*/
1022

1123
import byRadius from './roundCorners/byRadius';

src/actions/roundCorners/RoundCornersAction.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import {QualifierValue} from "../../internal/qualifier/QualifierValue";
55
/**
66
* @description A class to round one or more corners of an image or video.
77
* @extends SDK.Action
8+
* @memberOf Actions.RoundCorners
9+
* @see Visit {@link Actions.RoundCorners|RoundCorners} for an example
810
*/
911
class RoundCornersAction extends Action {
1012
constructor() {

src/actions/roundCorners/byRadius.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import RoundCornersAction from "./RoundCornersAction";
22

33
/**
4+
* @summary action
45
* @description Rounds the specified corners of an image or a video by specifying 1-4 pixel values as follows:
56
*
67
* * 1 value: All four corners are rounded equally according to the specified value.
@@ -13,7 +14,7 @@ import RoundCornersAction from "./RoundCornersAction";
1314
* @param {number} c
1415
* @param {number} d
1516
* @memberOf Actions.RoundCorners
16-
* @return {RoundCornersAction}
17+
* @return {Actions.RoundCorners.RoundCornersAction}
1718
*/
1819
function byRadius(a:number, b?:number, c?:number, d?:number):RoundCornersAction {
1920
return new RoundCornersAction().radius(a, b, c, d);

src/actions/roundCorners/max.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import RoundCornersAction from "./RoundCornersAction";
22

33

44
/**
5+
* @summary action
56
* @description Generates an asset with a circular crop using the 'max' radius value.
67
* @memberOf Actions.RoundCorners
7-
* @return {RoundCornersAction}
8+
* @return {Actions.RoundCorners.RoundCornersAction}
89
*/
910
function max():RoundCornersAction {
1011
return new RoundCornersAction().max();

0 commit comments

Comments
 (0)