From 6bc6bae5aee45034ce8c687015702b691a9477c3 Mon Sep 17 00:00:00 2001 From: Philip Bulley Date: Tue, 9 May 2017 17:16:49 +0100 Subject: [PATCH 1/2] Adds v2.2.1 methods and option properties --- types/lory.js/index.d.ts | 44 +++++++++++++++++++++++++++++++++- types/lory.js/lory.js-tests.ts | 8 ++++++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/types/lory.js/index.d.ts b/types/lory.js/index.d.ts index 75c07f9eed..6404ae14f8 100644 --- a/types/lory.js/index.d.ts +++ b/types/lory.js/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for lory 0.4.3 +// Type definitions for lory 2.2.1 // Project: https://github.com/meandmax/lory/ // Definitions by: kubosho +// milkisevil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var lory: LoryStatic; @@ -23,6 +24,11 @@ interface LoryStatic { */ slideTo(index: number): void; + /** + * returns the index of the current slide element + */ + returnIndex(): number; + /** * binds eventlisteners, merging default and user options, setup the slides based on DOM (called once during initialisation). Call setup if DOM or user options have changed or eventlisteners needs to be rebinded. */ @@ -32,6 +38,11 @@ interface LoryStatic { * sets the slider back to the starting position and resets the current index (called on resize event). */ reset(): void; + + /** + * unmount/destroy the instance of lory + */ + destroy(): void; } interface LoryOptions { @@ -44,6 +55,12 @@ interface LoryOptions { */ slidesToScroll?: number; + /** + * enabled mouse events + * default: false + */ + enableMouseEvents?: boolean; + /** * time in milliseconds for the animation of a valid slide attempt (default: 300). */ @@ -74,6 +91,31 @@ interface LoryOptions { */ infinite?: boolean | number; + /** + * class name for slider frame + * default: 'js_frame' + */ + classNameFrame?: string; + + /** + * class name for slides container + * default: 'js_slides' + */ + classNameSlideContainer?: string; + + /** + * class name for slider previous control + * default: 'js_prev' + */ + classNamePrevCtrl?: string; + + /** + * class name for slider next control + * default: 'js_next' + */ + classNameNextCtrl?: string; + + ////////////////////////////////////////////////// // Callbacks ////////////////////////////////////////////////// diff --git a/types/lory.js/lory.js-tests.ts b/types/lory.js/lory.js-tests.ts index f67c724e6e..bad97dadf3 100644 --- a/types/lory.js/lory.js-tests.ts +++ b/types/lory.js/lory.js-tests.ts @@ -20,7 +20,11 @@ snapBackSpeed: 200, ease: 'ease', rewind: true, - infinite: false + infinite: false, + classNameFrame: 'js_frame', + classNameSlideContainer: 'js_slides', + classNamePrevCtrl: 'js_prev', + classNameNextCtrl: 'js_next' }); // with callbacks @@ -57,6 +61,8 @@ lory.setup(); lory.prev(); lory.next(); + lory.returnIndex(); lory.reset(); lory.slideTo(1); + lory.destroy(); }()); From 7b9caf31b37c64c6403d57e4edc92fad8fa8ce01 Mon Sep 17 00:00:00 2001 From: Philip Bulley Date: Tue, 9 May 2017 17:40:14 +0100 Subject: [PATCH 2/2] Unified indenting with spaces as per before --- types/lory.js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/lory.js/index.d.ts b/types/lory.js/index.d.ts index 6404ae14f8..6da87b70b8 100644 --- a/types/lory.js/index.d.ts +++ b/types/lory.js/index.d.ts @@ -1,7 +1,7 @@ // Type definitions for lory 2.2.1 // Project: https://github.com/meandmax/lory/ // Definitions by: kubosho -// milkisevil +// philip bulley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var lory: LoryStatic;