Skip to content

Commit

Permalink
fix(cropper): remove deprecated variables
Browse files Browse the repository at this point in the history
BREAKING CHANGES:

`cropperEvent.base64` is now deprecated, use `cropperEvent.dataURL` instead

before:

```ts
onCropped(e: ImgCropperEvent) {
  this.croppedImage = e.base64;
}
```

after:

```ts
onCropped(e: ImgCropperEvent) {
  this.croppedImage = e.dataUrl;
}
```
  • Loading branch information
Enlcxx committed Dec 22, 2018
1 parent 425cb78 commit 796bb37
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/lib/resizing-cropping-images/resizing-cropping-images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ export interface ImgOutput {
height: number;
}

/**
* Deprecated, use instead ImgCropperConfig
* @deprecated
*/
export type LyResizingCroppingImagesConfig = ImgCropperConfig;

/** Image output */
export enum ImgResolution {
/** Resizing & cropping */
Expand All @@ -111,8 +105,6 @@ export enum ImgResolution {
}

export interface ImgCropperEvent {
/** Cropped image in base64, !deprecated use instead `dataURL` */
base64: string;
/** Cropped image data URL */
dataURL: string;
name: string;
Expand Down Expand Up @@ -511,7 +503,6 @@ export class LyResizingCroppingImages {
name: this._fileName,
type: this._defaultType,
dataURL: null,
base64: null,
width: null,
height: null,
scale: null,
Expand Down Expand Up @@ -713,9 +704,8 @@ export class LyResizingCroppingImages {
} else {
url = result.toDataURL(this._defaultType);
}
const cropEvent = {
const cropEvent: ImgCropperEvent = {
dataURL: url,
base64: url,
type: this._defaultType || myConfig.type,
name: this._fileName,
width: config.width,
Expand Down Expand Up @@ -747,7 +737,7 @@ export class LyResizingCroppingImages {
* convertToValidDegrees(45) === 90
* convertToValidDegrees(40) === 0
* convertToValidDegrees(100) === 90
* @ignore
* @docs-private
*/
function convertToValidDegrees(num: number) {
const val360 = limitNum(num, 360);
Expand All @@ -763,7 +753,7 @@ function convertToValidDegrees(num: number) {
/**
* demo:
* limitNum(450, 360) === 90
* @ignore
* @docs-private
*/
function limitNum(num: number, num2: number) {
const numAbs = Math.abs(num);
Expand Down

0 comments on commit 796bb37

Please sign in to comment.