Interface ModuleDefinition

Hierarchy

Properties

bootstrap?: Function | ClassType<any>

Module bootstrap class|function. This class is instantiated or function executed on bootstrap and can set up various injected services.

config?: ClassType<any>

Configuration definition.

Example


class MyModuleConfig {
debug: boolean = false;
});

class MyModule extends createModule({
config: MyModuleConfig
});
controllers?: ClassType<any>[]

CLI controllers.

exports?: ExportType[]

Export providers (its token provide value) or modules you imported first.

listeners?: (ClassType<any> | EventListener<any>)[]

Event listeners.

Example

with simple functions

{
listeners: [
onEvent.listen((event: MyEvent) => {console.log('event triggered', event);}),
]
}

Example

with services


class MyListener {
@eventDispatcher.listen(onEvent)
onEvent(event: typeof onEvent['type']) {
console.log('event triggered', event);
}
}

{
listeners: [
MyListener,
]
}
middlewares?: MiddlewareFactory[]

HTTP middlewares.

providers?: ProviderWithScope<any>[]

Providers.

workflows?: WorkflowDefinition<any>[]

Register created workflows. This allows the Framework Debugger to collect debug information and display the graph of your workflow.

Generated using TypeDoc