Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Commit

Permalink
First attempt at JSDoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashryanbeats committed Aug 12, 2016
1 parent 1140059 commit 35b0329
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions www/ImageEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,19 @@ var argscheck = require('cordova/argscheck'),
exec = cordova.require('cordova/exec'),
utils = cordova.require('cordova/utils');

/**
@description A global object that lets you interact with the Creative SDK Image Editor.
@global
*/
var CSDKImageEditor = {
/**
* @description Launches the Image Editor.
* @function edit
* @callback {!successCallback} successCallback
* @callback {!errorCallback} errorCallback
* @param {!string} imageUrl URL of the image to be edited.
* @param {?Object} options An object containing optional property/value pairs.
*/
edit: function(successCallback, errorCallback, imageUrl, options) {
var getValue = argscheck.getValue;
options = options || {};
Expand Down Expand Up @@ -63,6 +75,7 @@ var CSDKImageEditor = {
return validTools;
},
/**
* @readonly
* @enum {number}
*/
OutputType:{
Expand All @@ -72,6 +85,7 @@ var CSDKImageEditor = {
PNG: 1
},
/**
* @readonly
* @enum {number}
*/
ToolType:{
Expand All @@ -97,6 +111,18 @@ var CSDKImageEditor = {
OVERLAYS: 19,
ADJUST: 20
}
/**
* @description A callback to be used upon successful editing of an image.
*
* @callback successCallback
* @param {string} newUrl - The URL of the new edited image.
*/
/**
* @description A callback to handle errors when attempting to edit an image.
*
* @callback errorCallback
* @param {string} error
*/
};

module.exports = CSDKImageEditor;

0 comments on commit 35b0329

Please sign in to comment.