Skip to content

Commit 470a6b4

Browse files
Improve rotate docs (#371)
1 parent 2478c38 commit 470a6b4

File tree

4 files changed

+29
-13
lines changed

4 files changed

+29
-13
lines changed

src/actions/rotate.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22
* Rotates or flips an image or video by the specified number of degrees, or automatically (images only) according to its orientation or available metadata.
33
* @memberOf Actions
44
* @namespace Rotate
5+
*
6+
* @example
7+
* <caption>Rotate by mode</caption>
8+
* import {Cloudinary} from "@cloudinary/base";
9+
* import {mode} from "@cloudinary/base/actions/rotate";
10+
* import {autoLeft} from "@cloudinary/base/qualifiers/rotationMode";
11+
*
12+
* const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
13+
* 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";
21+
*
22+
* const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
23+
* const image = yourCldInstance.image('woman');
24+
*
25+
* image.rotate(byAngle(90));
26+
* image.toURL();
527
*/
628

729

src/actions/rotate/RotateAction.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ const QUALIFIER_KEY = 'a';
1010
*
1111
* <b>Learn more:</b> {@link https://cloudinary.com/documentation/image_transformations#rotating_image | Rotating images}
1212
* {@link https://cloudinary.com/documentation/video_manipulation_and_delivery#rotating_videos | Rotating videos}
13-
* @augments {Action}
13+
* @extends SDK.Action
14+
* @memberOf Actions.Rotate
15+
* @see Visit {@link Actions.Rotate|Rotate} for an example
1416
*/
1517
class RotateAction extends Action {
1618
constructor(angle?: number) {

src/actions/rotate/byAngle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import RotateAction from "./RotateAction";
22

33
/**
44
* @summary action
5-
* @memberOf Actions.Rotate
65
* @description Rotate an image by the given degrees.
76
* @param {number} angle Given degrees. (Range: 0 to 360, Default: 0).
8-
* @return {RotateAction}
7+
* @return {Actions.Rotate.RotateAction}
8+
* @memberOf Actions.Rotate
99
*/
1010
function byAngle(angle: number) :RotateAction {
1111
return new RotateAction(angle);

src/actions/rotate/mode.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,12 @@ import {RotationModeQualifierValue} from "../../qualifiers/rotate/RotationModeQu
33

44
/**
55
* @summary action
6-
* @memberOf Actions.Rotate
76
* @description Rotate an image by using a rotationMode
87
* @param {string} rotationMode
98
* For a list of supported rotation modes see {@link Qualifiers.rotationModeValues| types of rotation modes} for
109
* possible values
11-
* @example
12-
* import {mode} from "@cloudinary/base/actions/rotate";
13-
* import {RotationMode} from "@cloudinary/base/qualifiers/rotationMode";
14-
*
15-
* const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
16-
* const image = yourCldInstance.image('woman');
17-
*
18-
* image.rotate(mode(RotationMode.autoLeft());
19-
* @return {RotateAction}
10+
* @memberOf Actions.Rotate
11+
* @return {Actions.Rotate.RotateAction}
2012
*/
2113
function mode(rotationMode: RotationModeQualifierValue | string) :RotateAction {
2214
return new RotateAction().mode(rotationMode);

0 commit comments

Comments
 (0)