From f972e749a07d45566ba63dd6cfa921a5a240e9cb Mon Sep 17 00:00:00 2001 From: Roland Zwaga Date: Thu, 8 May 2014 11:53:49 +0200 Subject: [PATCH 1/2] Added definitions for ocLazyLoad (https://github.com/ocombe/ocLazyLoad) --- oclazyload/oclazyload-tests.ts | 23 +++++++++++++++++++++++ oclazyload/oclazyload.d.ts | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 oclazyload/oclazyload-tests.ts create mode 100644 oclazyload/oclazyload.d.ts diff --git a/oclazyload/oclazyload-tests.ts b/oclazyload/oclazyload-tests.ts new file mode 100644 index 000000000..3879a564b --- /dev/null +++ b/oclazyload/oclazyload-tests.ts @@ -0,0 +1,23 @@ +/// + +var lazyloader:Function = ()=>{}; + +var config1: oc.ILazyLoadConfig = { + asyncLoader: lazyloader +}; + +var config2:oc.ILazyLoadConfig = { + asyncLoader: lazyloader, + loadedModules: ['module1', 'module2'] +}; + +var moduleConfig:oc.ILazyLoadModuleConfig = { + name:'testmodule', + files:['testmodule'] +} + +var config2:oc.ILazyLoadConfig = { + asyncLoader: lazyloader, + loadedModules: ['module1', 'module2'], + modules: [moduleConfig] +}; diff --git a/oclazyload/oclazyload.d.ts b/oclazyload/oclazyload.d.ts new file mode 100644 index 000000000..22ac45f9d --- /dev/null +++ b/oclazyload/oclazyload.d.ts @@ -0,0 +1,34 @@ +// Type definitions for oc.LazyLoad +// Project: https://github.com/ocombe/ocLazyLoad +// Definitions by: Roland Zwaga +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module oc { + + interface ILazyLoadConfig { + asyncLoader:any; + loadedModules?:string[]; + modules?:ILazyLoadModuleConfig[]; + } + + interface ILazyLoadModuleConfig { + name:string; + files:string[]; + } + + interface ILazyLoad { + load(module:any):ng.IPromise; + loadTemplateFile(url:string, config:ILazyLoadModuleConfig):ng.IPromise; + loadTemplateFile(urls:string[], config:ILazyLoadModuleConfig):ng.IPromise; + getModuleName(moduleName:string):string; + getModules():string[]; + getModuleConfig(name:string):ILazyLoadModuleConfig; + setModuleConfig(config:ILazyLoadModuleConfig):void; + } + + interface ILazyLoadProvider { + config(config:ILazyLoadConfig):void; + } +} \ No newline at end of file From cbdb55c47ee07af8694e8af7b0e2154edcdb6b48 Mon Sep 17 00:00:00 2001 From: Roland Zwaga Date: Mon, 12 May 2014 12:25:05 +0200 Subject: [PATCH 2/2] Update CONTRIBUTORS.md Added entry for ocLazyLoad --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bc6288274..2d9fdd4fe 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -225,6 +225,7 @@ All definitions files include a header with the author and editors, so at some p * [notify.js](https://github.com/alexgibson/notify.js) (by [soundTricker](https://github.com/soundTricker)) * [NProgress](https://github.com/rstacruz/nprogress) (by [Judah Gabriel Himango](https://github.com/judahgabriel)) * [Numeral.js](https://github.com/adamwdraper/Numeral-js) (by [Vincent Bortone](https://github.com/vbortone/)) +* [ocLazyLoad](https://github.com/ocombe/ocLazyLoad) (by [Roland Zwaga](https://github.com/rolandzwaga/)) * [OpenLayers](https://github.com/openlayers/openlayers) (by [Ilya Bolkhovsky](https://github.com/bolhovsky/)) * [Optimist](https://github.com/substack/node-optimist) (by [Carlos Ballesteros Velasco](https://github.com/soywiz)) * [Passport](http://passportjs.org/) (by [Hiroki Horiuchi](https://github.com/horiuchi/))