mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #2152 from rolandzwaga/oclazyload
Added definitions for ocLazyLoad (https://github.com/ocombe/ocLazyLoad)
This commit is contained in:
@@ -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/))
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/// <reference path="oclazyload.d.ts" />
|
||||
|
||||
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]
|
||||
};
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
// Type definitions for oc.LazyLoad
|
||||
// Project: https://github.com/ocombe/ocLazyLoad
|
||||
// Definitions by: Roland Zwaga <https://github.com/rolandzwaga>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../angularjs/angular.d.ts" />
|
||||
|
||||
declare module oc {
|
||||
|
||||
interface ILazyLoadConfig {
|
||||
asyncLoader:any;
|
||||
loadedModules?:string[];
|
||||
modules?:ILazyLoadModuleConfig[];
|
||||
}
|
||||
|
||||
interface ILazyLoadModuleConfig {
|
||||
name:string;
|
||||
files:string[];
|
||||
}
|
||||
|
||||
interface ILazyLoad {
|
||||
load(module:any):ng.IPromise<any>;
|
||||
loadTemplateFile(url:string, config:ILazyLoadModuleConfig):ng.IPromise<any>;
|
||||
loadTemplateFile(urls:string[], config:ILazyLoadModuleConfig):ng.IPromise<any>;
|
||||
getModuleName(moduleName:string):string;
|
||||
getModules():string[];
|
||||
getModuleConfig(name:string):ILazyLoadModuleConfig;
|
||||
setModuleConfig(config:ILazyLoadModuleConfig):void;
|
||||
}
|
||||
|
||||
interface ILazyLoadProvider {
|
||||
config(config:ILazyLoadConfig):void;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user