diff --git a/lib/AppLoader.d.ts b/lib/AppLoader.d.ts index 17e503f..49140e3 100644 --- a/lib/AppLoader.d.ts +++ b/lib/AppLoader.d.ts @@ -15,14 +15,14 @@ export declare class AppLoader; protected synchronizer?: Synchronizer; protected contextBuilder: (store: DbStore) => Cxt; - private nsSocket; + private nsSocket?; private requireSth; protected makeContext(cxtStr?: string, headers?: IncomingHttpHeaders): Promise; /** * 后台启动的configuration,统一放在这里读取 */ private getConfiguration; - constructor(path: string, nsSubscribe: Namespace, nsSocket: Namespace, nsServer?: Namespace); + constructor(path: string, nsSubscribe?: Namespace, nsSocket?: Namespace, nsServer?: Namespace); protected registerTrigger(trigger: Trigger): void; protected initTriggers(): void; protected initSocket(): void; diff --git a/src/AppLoader.ts b/src/AppLoader.ts index a508c9a..bf1094f 100644 --- a/src/AppLoader.ts +++ b/src/AppLoader.ts @@ -29,7 +29,7 @@ export class AppLoader; protected synchronizer?: Synchronizer; protected contextBuilder: (store: DbStore) => Cxt; - private nsSocket: Namespace; + private nsSocket?: Namespace; private requireSth(filePath: string): any { const depFilePath = join(this.path, filePath); @@ -85,7 +85,7 @@ export class AppLoader