diff --git a/types/jquery-cropper/index.d.ts b/types/jquery-cropper/index.d.ts new file mode 100644 index 0000000000..6351672016 --- /dev/null +++ b/types/jquery-cropper/index.d.ts @@ -0,0 +1,54 @@ +// Type definitions for jquery-cropper 1.0 +// Project: https://github.com/fengyuanchen/jquery-cropper +// Definitions by: Mustafa Salaheldin +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +interface CropperOptions { + viewMode?: number; + dragMode?: string; + initialAspectRatio?: number; + aspectRatio?: number; + data?: any; + preview?: any; + responsive?: boolean; + restore?: boolean; + checkCrossOrigin?: boolean; + checkOrientation?: string; + modal?: boolean; + guides?: boolean; + center?: boolean; + highlight?: boolean; + background?: boolean; + autoCrop?: boolean; + autoCropArea?: number; + movable?: boolean; + rotatable?: boolean; + scalable?: boolean; + zoomable?: boolean; + zoomOnTouch?: boolean; + zoomOnWheel?: boolean; + wheelZoomRatio?: number; + cropBoxMovable?: number; + cropBoxResizable?: number; + toggleDragModeOnDblclick?: number; + minContainerWidth?: number; + minContainerHeight?: number; + minCanvasWidth?: number; + minCanvasHeight?: number; + minCropBoxWidth?: number; + minCropBoxHeight?: number; + ready?(): any; + cropstart?(): any; + cropmove?(): any; + cropend?(): any; + crop?(data?: any): void; + zoom?(): any; +} + +interface JQuery { + cropper(options?: CropperOptions): JQuery; + cropper(method: string, ...arguments: any[]): JQuery; +} diff --git a/types/jquery-cropper/tsconfig.json b/types/jquery-cropper/tsconfig.json new file mode 100644 index 0000000000..0a5939581f --- /dev/null +++ b/types/jquery-cropper/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} diff --git a/types/jquery-cropper/tslint.json b/types/jquery-cropper/tslint.json new file mode 100644 index 0000000000..0fef79a49f --- /dev/null +++ b/types/jquery-cropper/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "interface-name": [true, "never-prefix"] + } +}