Skip to content

Commit

Permalink
chore(typings): add EggLoader interface (#221)
Browse files Browse the repository at this point in the history
* chore(typings): add EggLoader interface

* add generics constraint
  • Loading branch information
monkindey authored Aug 4, 2020
1 parent ca04a45 commit 8cb0a6e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,19 @@ export interface ContextLoader {
new (options: ContextLoaderOption): ContextLoaderBase;
}

export class EggLoader<T = EggCore, Config = any> {
export class EggLoader<
T extends EggCore = EggCore,
Config = any,
Options extends EggLoaderOptions = EggLoaderOptions
> {
app: T;
eggPaths: string[];
pkg: PlainObject;
appInfo: EggAppInfo;
serverScope: string;
plugins: Plugins;
config: Config;
options: Options;

/**
* @constructor
Expand Down Expand Up @@ -429,6 +434,10 @@ export class EggLoader<T = EggCore, Config = any> {
*/
getLoadUnits(): Array<{ path: string; type: string; }>;

getEggPaths(): string[];

getServerEnv(): string;

/**
* Load files using {@link FileLoader}, inject to {@link Application}
* @param {String|Array} directory - see {@link FileLoader}
Expand Down

0 comments on commit 8cb0a6e

Please sign in to comment.