From 5ce60e032b7b5523876f8269a2c4b25edeaa02ba Mon Sep 17 00:00:00 2001 From: Steven Salat Date: Tue, 7 Jul 2015 17:42:10 -0700 Subject: [PATCH] Updating jquery.autosize to the new API in 3.0.7 --- jquery.autosize/jquery.autosize-tests.ts | 13 +++++++++++++ jquery.autosize/jquery.autosize.d.ts | 24 +++++++++++------------- 2 files changed, 24 insertions(+), 13 deletions(-) create mode 100755 jquery.autosize/jquery.autosize-tests.ts diff --git a/jquery.autosize/jquery.autosize-tests.ts b/jquery.autosize/jquery.autosize-tests.ts new file mode 100755 index 000000000..df4aef5b2 --- /dev/null +++ b/jquery.autosize/jquery.autosize-tests.ts @@ -0,0 +1,13 @@ +/// + +// from a NodeList +autosize(document.querySelectorAll('textarea')); + +// from a single Node +autosize(document.querySelector('textarea')); + +// from a jQuery collection +autosize($('textarea')); + +// from a single element +autosize(document.getElementById('my-textarea')); \ No newline at end of file diff --git a/jquery.autosize/jquery.autosize.d.ts b/jquery.autosize/jquery.autosize.d.ts index 5b9f9adfb..508677b4a 100644 --- a/jquery.autosize/jquery.autosize.d.ts +++ b/jquery.autosize/jquery.autosize.d.ts @@ -1,21 +1,19 @@ -// Type definitions for jquery.autosize (un-versioned) +// Type definitions for jquery.autosize 3.0.7 // Project: http://www.jacklmoore.com/autosize/ // Definitions by: Aaron T. King // Definitions: https://github.com/borisyankov/DefinitelyTyped /// - -interface AutosizeOptions { - className?: string; - append?: string; - callback?: Function; +declare module autosize { + interface AutosizeStatic { + (el: Element): void; + (el: NodeList): void; + (el: JQuery): void; + } } -interface Autosize { - (): JQuery; - (options: AutosizeOptions): JQuery; -} +declare var autosize: autosize.AutosizeStatic; -interface JQuery { - autosize: Autosize; -} \ No newline at end of file +declare module 'autosize' { + export = autosize; +}