From 0b34e65eb9873ec4422beec9903f9c7d0cc31247 Mon Sep 17 00:00:00 2001 From: Mustafa Salaheldin Date: Thu, 12 Mar 2020 21:11:32 +0200 Subject: [PATCH] Jquery cropper (#42973) * commit jquery-croper type definitions commit jquery-croper type definitions * Update index.d.ts Update index.d.ts, correcting the version of the cropper and remove unnecessary comments. * update tsconfig Adding "strictFunctionTypes": true to tsconfig.json file. * Update index.d.ts & tslint.json Removing declare module "jquery-cropper" { }, and fixing the Project url * update "interface-name" property set "interface-name" property to false in tslint.json * update tslint * remove the patch version from index.d.ts * update rules in tslint.json * completely remove the patch digit * remove "v" from MAJOR.MINOR * Update tslint.json enabled interface-name property * adjust interface-name rule adjust interface-name rule to "interface-name": [true, "never-prefix"] * remove I from interface name remove I from interface name * added new line to last line added new line to last line --- types/jquery-cropper/index.d.ts | 54 ++++++++++++++++++++++++++++++ types/jquery-cropper/tsconfig.json | 23 +++++++++++++ types/jquery-cropper/tslint.json | 6 ++++ 3 files changed, 83 insertions(+) create mode 100644 types/jquery-cropper/index.d.ts create mode 100644 types/jquery-cropper/tsconfig.json create mode 100644 types/jquery-cropper/tslint.json 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"] + } +}