From edf6a27cca6204a1b47e2844f1222866b3bb8f33 Mon Sep 17 00:00:00 2001 From: Francois Lecroart Date: Wed, 10 Aug 2016 18:23:53 +0200 Subject: [PATCH] Add TypeDefinition for autosize plugin of jackmoore original jquery-autosize plugin requred jquery but the new version didn't need it anymore. So I add a new definition for the new version of the plugin see #10023 --- autosize/autosize-tests.ts | 10 ++++++++++ autosize/autosize.d.ts | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 autosize/autosize-tests.ts create mode 100644 autosize/autosize.d.ts diff --git a/autosize/autosize-tests.ts b/autosize/autosize-tests.ts new file mode 100644 index 0000000000..23686fbd88 --- /dev/null +++ b/autosize/autosize-tests.ts @@ -0,0 +1,10 @@ +/// + +// from a NodeList +autosize(document.querySelectorAll('textarea')); + +// from a single Node +autosize(document.querySelector('textarea')); + +// from a single element +autosize(document.getElementById('my-textarea')); diff --git a/autosize/autosize.d.ts b/autosize/autosize.d.ts new file mode 100644 index 0000000000..0a8a696c3d --- /dev/null +++ b/autosize/autosize.d.ts @@ -0,0 +1,17 @@ +// Type definitions for jquery.autosize 3.0.7 +// Project: http://www.jacklmoore.com/autosize/ +// Definitions by: Aaron T. King +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace autosize { + interface AutosizeStatic { + (el: Element): void; + (el: NodeList): void; + } +} + +declare var autosize: autosize.AutosizeStatic; + +declare module 'autosize' { + export = autosize; +}