diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index afe73602d..f39e1f53d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -231,6 +231,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/)) 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