Skip to content

Commit db1286d

Browse files
waitingsongpopomore
authored andcommitted
chore(typings): add class EggLoader (#2321)
1 parent 80528cc commit db1286d

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

index.d.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,4 +1069,48 @@ declare module 'egg' {
10691069
*/
10701070
sendToApp(action: string, data: any): void;
10711071
}
1072+
1073+
export interface EggLoaderOptions {
1074+
baseDir: string;
1075+
typescript?: boolean;
1076+
app: Application;
1077+
logger: Logger;
1078+
plugins?: any;
1079+
}
1080+
1081+
// egg-core
1082+
export class EggLoader {
1083+
options: EggLoaderOptions;
1084+
1085+
constructor(options: EggLoaderOptions);
1086+
1087+
getHomedir(): EggAppInfo['HOME']
1088+
1089+
getAppInfo(): EggAppInfo;
1090+
}
1091+
1092+
/**
1093+
* App worker process Loader, will load plugins
1094+
* @see https://github.com/eggjs/egg-core
1095+
*/
1096+
export class AppWorkerLoader extends EggLoader {
1097+
constructor(options: EggLoaderOptions);
1098+
1099+
loadConfig(): void;
1100+
1101+
load(): void;
1102+
}
1103+
1104+
/**
1105+
* Agent worker process loader
1106+
* @see https://github.com/eggjs/egg-loader
1107+
*/
1108+
export class AgentWorkerLoader extends EggLoader {
1109+
constructor(options: EggLoaderOptions);
1110+
1111+
loadConfig(): void;
1112+
1113+
load(): void;
1114+
}
1115+
10721116
}

0 commit comments

Comments
 (0)