From eb2d3502caf0dbc723cf03897f1d27fa5042584f Mon Sep 17 00:00:00 2001 From: Stefan Steinhart Date: Thu, 2 Jul 2015 21:26:28 +0200 Subject: [PATCH] + typings for angular-throttle --- angular-throttle/angular-throttle-tests.ts | 8 ++++++++ angular-throttle/angular-throttle.d.ts | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 angular-throttle/angular-throttle-tests.ts create mode 100644 angular-throttle/angular-throttle.d.ts diff --git a/angular-throttle/angular-throttle-tests.ts b/angular-throttle/angular-throttle-tests.ts new file mode 100644 index 000000000..5577e08c5 --- /dev/null +++ b/angular-throttle/angular-throttle-tests.ts @@ -0,0 +1,8 @@ +/// +/// + +var throttledFn = angular.throttle(function (someArg:any) { + return someArg; +}, 100); + +var result = throttledFn(10); diff --git a/angular-throttle/angular-throttle.d.ts b/angular-throttle/angular-throttle.d.ts new file mode 100644 index 000000000..eeca0d1bc --- /dev/null +++ b/angular-throttle/angular-throttle.d.ts @@ -0,0 +1,12 @@ +// Type definitions for angular-throttle +// Project: https://github.com/BaggersIO/angular.throttle +// Definitions by: Stefan Steinhart +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module angular { + interface IAngularStatic { + throttle:( fn:Function, throttle:number, options?:{leading?:boolean; trailing?:boolean;} ) => Function; + } +}