2016-10-11 23:41:30 +00:00
|
|
|
/// <reference types="q" />
|
2016-10-12 12:07:54 +00:00
|
|
|
import 'typings-global';
|
2016-10-11 23:41:30 +00:00
|
|
|
import * as q from 'q';
|
|
|
|
/**
|
|
|
|
* defines a LazyModule
|
|
|
|
*/
|
2016-10-14 01:07:37 +00:00
|
|
|
export declare type TLoader = 'npm' | 'systemjs';
|
2016-10-11 23:41:30 +00:00
|
|
|
export declare class LazyModule<T> {
|
|
|
|
name: string;
|
2016-10-12 12:01:15 +00:00
|
|
|
nameIsPath: boolean;
|
2016-10-11 23:41:30 +00:00
|
|
|
cwd: string;
|
2016-10-12 12:01:15 +00:00
|
|
|
whenLoaded: q.Promise<T>;
|
2016-10-14 01:07:37 +00:00
|
|
|
loader: TLoader;
|
2016-10-12 12:01:15 +00:00
|
|
|
private whenLoadedDeferred;
|
2016-12-10 18:46:47 +00:00
|
|
|
constructor(nameArg: string, cwdArg: string);
|
2016-10-14 01:07:37 +00:00
|
|
|
setLoader(loaderArg: TLoader): void;
|
2016-10-11 23:41:30 +00:00
|
|
|
/**
|
|
|
|
* loads the module
|
|
|
|
*/
|
|
|
|
load(): q.Promise<T>;
|
|
|
|
/**
|
|
|
|
* loads additional lazy modules specified as arguments and returns them in the promise for easy use
|
|
|
|
*/
|
|
|
|
loadAlso(...args: LazyModule<any>[]): void;
|
|
|
|
}
|