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
|
|
|
|
*/
|
|
|
|
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>;
|
|
|
|
private whenLoadedDeferred;
|
2016-10-11 23:41:30 +00:00
|
|
|
constructor(nameArg: string, cwdArg?: string);
|
|
|
|
/**
|
|
|
|
* 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;
|
|
|
|
}
|