Skip to content

Commit 8cb0a6e

Browse files
authored
chore(typings): add EggLoader interface (#221)
* chore(typings): add EggLoader interface * add generics constraint
1 parent ca04a45 commit 8cb0a6e

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

index.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,14 +362,19 @@ export interface ContextLoader {
362362
new (options: ContextLoaderOption): ContextLoaderBase;
363363
}
364364

365-
export class EggLoader<T = EggCore, Config = any> {
365+
export class EggLoader<
366+
T extends EggCore = EggCore,
367+
Config = any,
368+
Options extends EggLoaderOptions = EggLoaderOptions
369+
> {
366370
app: T;
367371
eggPaths: string[];
368372
pkg: PlainObject;
369373
appInfo: EggAppInfo;
370374
serverScope: string;
371375
plugins: Plugins;
372376
config: Config;
377+
options: Options;
373378

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

437+
getEggPaths(): string[];
438+
439+
getServerEnv(): string;
440+
432441
/**
433442
* Load files using {@link FileLoader}, inject to {@link Application}
434443
* @param {String|Array} directory - see {@link FileLoader}

0 commit comments

Comments
 (0)