Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support typescript #108

Merged
merged 8 commits into from
Jan 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: incorrect jsdoc
  • Loading branch information
jinwoo-kim-nhn committed Dec 24, 2018
commit 616248d863263a4e455fb59012a8c8f541f25b6c
5 changes: 2 additions & 3 deletions src/js/graphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,11 +554,10 @@ class Graphics {

/**
* Get cropped rect
* @param {Object} mode cropzone rect mode
* @returns {Object} rect
* @param {number} [mode] cropzone rect mode
*/
setCropzoneRect(mode) {
return this.getComponent(components.CROPPER).setCropzoneRect(mode);
this.getComponent(components.CROPPER).setCropzoneRect(mode);
}

/**
Expand Down
24 changes: 16 additions & 8 deletions src/js/imageEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ const {isUndefined, forEach, CustomEvents} = snippet;
* @param {string} [options.includeUI.menuBarPosition=bottom] - Menu bar position [top | bottom | left | right]
* @param {number} options.cssMaxWidth - Canvas css-max-width
* @param {number} options.cssMaxHeight - Canvas css-max-height
* @param {Object} [options.selectionStyle] - selection style
* @param {string} [options.selectionStyle.cornerStyle] - selection corner style
* @param {number} [options.selectionStyle.cornerSize] - selection corner size
* @param {string} [options.selectionStyle.cornerColor] - selection corner color
* @param {string} [options.selectionStyle.cornerStrokeColor] = selection corner stroke color
* @param {boolean} [options.selectionStyle.transparentCorners] - selection corner transparent
* @param {number} [options.selectionStyle.lineWidth] - selection line width
* @param {string} [options.selectionStyle.borderColor] - selection border color
* @param {number} [options.selectionStyle.rotatingPointOffset] - selection rotating point length
* @param {Boolean} [options.usageStatistics=true] - Let us know the hostname. If you don't want to send the hostname, please set to false.
* @example
* var ImageEditor = require('tui-image-editor');
Expand Down Expand Up @@ -668,11 +677,10 @@ class ImageEditor {

/**
* Set the cropping rect
* @param {Object} mode crop rect mode [1, 1.5, 1.3333333333333333, 1.25, 1.7777777777777777]
* @returns {Object} {{left: number, top: number, width: number, height: number}} rect
* @param {number} [mode] crop rect mode [1, 1.5, 1.3333333333333333, 1.25, 1.7777777777777777]
*/
setCropzoneRect(mode) {
return this._graphics.setCropzoneRect(mode);
this._graphics.setCropzoneRect(mode);
}

/**
Expand Down Expand Up @@ -860,7 +868,7 @@ class ImageEditor {
* @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)
* @param {number} [options.left] - Shape x position
* @param {number} [options.top] - Shape y position
* @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not
* @param {boolean} [options.isRegular] - Whether resizing shape has 1:1 ratio or not
* @returns {Promise<ObjectProps, ErrorMsg>}
* @example
* imageEditor.addShape('rect', {
Expand Down Expand Up @@ -904,7 +912,7 @@ class ImageEditor {
* @param {number} [options.height] - Height value (When type option is 'rect', this options can use)
* @param {number} [options.rx] - Radius x value (When type option is 'circle', this options can use)
* @param {number} [options.ry] - Radius y value (When type option is 'circle', this options can use)
* @param {number} [options.isRegular] - Whether resizing shape has 1:1 ratio or not
* @param {boolean} [options.isRegular] - Whether resizing shape has 1:1 ratio or not
* @returns {Promise}
* @example
* // call after selecting shape object on canvas
Expand Down Expand Up @@ -949,7 +957,7 @@ class ImageEditor {
* imageEditor.addText('init text', {
* styles: {
* fill: '#000',
* fontSize: '20',
* fontSize: 20,
* fontWeight: 'bold'
* },
* position: {
Expand Down Expand Up @@ -1155,8 +1163,8 @@ class ImageEditor {
* @param {string} type - Icon type ('arrow', 'cancel', custom icon name)
* @param {Object} options - Icon options
* @param {string} [options.fill] - Icon foreground color
* @param {string} [options.left] - Icon x position
* @param {string} [options.top] - Icon y position
* @param {number} [options.left] - Icon x position
* @param {number} [options.top] - Icon y position
* @returns {Promise<ObjectProps, ErrorMsg>}
* @example
* imageEditor.addIcon('arrow'); // The position is center on canvas
Expand Down