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

fix: keep back compatibility #799

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Changes from all commits
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
14 changes: 7 additions & 7 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ declare namespace Cropper {
height?: number;
}

interface CropperEvent<T extends EventTarget> extends CustomEvent {
interface CropperEvent<T extends EventTarget = EventTarget> extends CustomEvent {
currentTarget: T & { cropper: Cropper };
}

export type ReadyEvent<T extends EventTarget> = CropperEvent<T>

export interface CropEvent<T extends EventTarget> extends CropperEvent<T> {
export interface CropEvent<T extends EventTarget = EventTarget> extends CropperEvent<T> {
detail: Data;
}

Expand All @@ -99,15 +99,15 @@ declare namespace Cropper {
action: Action;
}

export interface CropStartEvent<T extends EventTarget> extends CropperEvent<T> {
export interface CropStartEvent<T extends EventTarget = EventTarget> extends CropperEvent<T> {
detail: CropEventData;
}

export interface CropMoveEvent<T extends EventTarget> extends CropperEvent<T> {
export interface CropMoveEvent<T extends EventTarget = EventTarget> extends CropperEvent<T> {
detail: CropEventData;
}

export interface CropEndEvent<T extends EventTarget> extends CropperEvent<T> {
export interface CropEndEvent<T extends EventTarget = EventTarget> extends CropperEvent<T> {
detail: CropEventData;
}

Expand All @@ -117,11 +117,11 @@ declare namespace Cropper {
ratio: number;
}

export interface ZoomEvent<T extends EventTarget> extends CropperEvent<T> {
export interface ZoomEvent<T extends EventTarget = EventTarget> extends CropperEvent<T> {
detail: ZoomEventData;
}

export interface Options<T extends EventTarget> {
export interface Options<T extends EventTarget = EventTarget> {
aspectRatio?: number;
autoCrop?: boolean;
autoCropArea?: number;
Expand Down