Types for JQuery ElevateZoom Plus Plugin

This commit is contained in:
AndersonFriaca
2018-03-04 00:08:05 -04:00
parent fbba9f55be
commit ce1b7e8971
4 changed files with 207 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
import { Options } from "ez-plus";
$(document).ready(() => {
// basic usage
$('#image').ezPlus();
// with options
const options: Options = {
zoomLens: true,
zoomType: 'lens',
cursor: 'crosshair'
};
$('#image').ezPlus(options);
});
+167
View File
@@ -0,0 +1,167 @@
// Type definitions for jQuery ElevateZoom Plus Plugin 1.2
// Project: https://github.com/igorlino/elevatezoom-plus
// Definitions by: Anderson Friaça <https://github.com/AndersonFriaca>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="jquery" />
export interface Options {
/**
* Activate responsivenes
*/
responsive?: boolean;
/**
* Activate zoom on mouse scroll
*/
scrollZoom?: boolean;
/**
* Activate simultaneous crossfade of images on gallery change
*/
imageCrossfade?: boolean;
/**
* Activate spinner icon
*/
loadingIcon?: boolean;
/**
* Activate easing
*/
easing?: boolean;
easingType?: string;
easingDuration?: number;
/**
* Used when zoomType set to lens
*/
lensSize?: number;
/**
* Width of the zoomWindow
*/
zoomWindowWidth?: number;
/**
* Height of the zoomWindow
*/
zoomWindowHeight?: number;
/**
* x-axis offset of the zoom window
*/
zoomWindowOffsetX?: number;
/**
* y-axis offset of the zoom window
*/
zoomWindowOffsetY?: number;
zoomWindowPosition?: number|string;
/**
* Speed of Lens fadeIn
*/
lensFadeIn?: number;
/**
* Speed of Lens fadeOut
*/
lensFadeOut?: number;
/**
* Speed of Window fadeIn
*/
zoomWindowFadeIn?: number;
/**
* Speed of Window fadeOut
*/
zoomWindowFadeOut?: number;
/**
* Speed of Tint fadeIn
*/
zoomTintFadeIn?: number;
/**
* Speed of Tint fadeOut
*/
zoomTintFadeOut?: number;
/**
* Border Size of the ZoomBox
*/
borderSize?: number;
/**
* Enable Lens
*/
zoomLens?: boolean;
/**
* Border Colour
*/
borderColour?: string;
/**
* Width in pixels of the lens border
*/
lensBorder?: number;
/**
* Type of lens
*/
lensShape?: 'square' | 'round';
/**
* Type of zoom
*/
zoomType?: 'lens' | 'window' | 'inner';
containLensZoom?: boolean;
/**
* Colour of the lens background
*/
lensColour?: string;
/**
* Opacity of lens
*/
lensOpacity?: number;
lenszoom?: boolean;
/**
* Enable a tint overlay
*/
tint?: boolean;
/**
* Colour of the tin
*/
tintColour?: string;
/**
* Opacity of the tint
*/
tintOpacity?: number;
/**
* This assigns a set of gallery links to the zoom image
*/
gallery?: string;
/**
* Type of cursor
*/
cursor?: 'default' | 'cursor' | 'crosshair';
}
declare global {
interface JQuery {
/**
* Initialize ElevateZoom Plugin
*/
ezPlus(options?: Options): JQuery;
}
}
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true
},
"files": [
"index.d.ts",
"ez-plus-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{"extends": "dtslint/dt.json"}