@@ -15,14 +15,22 @@ import type {
15
15
INestApplicationContext ,
16
16
LogLevel
17
17
} from '@nestjs/common'
18
- import type { NestApplicationContextOptions as NestContextOptions } from '@nestjs/common/interfaces/nest-application-context-options.interface'
18
+ import type { NestApplicationContextOptions } from '@nestjs/common/interfaces/nest-application-context-options.interface'
19
19
import { NestFactory } from '@nestjs/core'
20
20
import CommandRunnerModule from './command-runner.module'
21
21
import type { ParseOptions } from './commander'
22
22
import type { CliApplicationContext } from './interfaces'
23
23
import { ProgramOptions } from './models'
24
24
import { CommandRunnerService } from './providers'
25
25
26
+ /**
27
+ * CLI program factory options.
28
+ *
29
+ * @see {@linkcode NestApplicationContextOptions }
30
+ * @see {@linkcode ProgramOptions }
31
+ */
32
+ type ProgramFactoryOptions = NestApplicationContextOptions & ProgramOptions
33
+
26
34
/**
27
35
* CLI program factory.
28
36
*
@@ -71,20 +79,19 @@ class ProgramFactory {
71
79
*
72
80
* @see {@linkcode CliApplicationContext }
73
81
* @see {@linkcode DynamicModule }
74
- * @see {@linkcode NestContextOptions }
75
- * @see {@linkcode ProgramOptions }
82
+ * @see {@linkcode ProgramFactoryOptions }
76
83
*
77
84
* @public
78
85
* @static
79
86
* @async
80
87
*
81
88
* @param {Class<any> | DynamicModule } AppModule - Root module
82
- * @param {NestContextOptions & ProgramOptions } [options={}] - Context options
89
+ * @param {ProgramFactoryOptions } [options={}] - Context options
83
90
* @return {Promise<CliApplicationContext> } CLI application context
84
91
*/
85
92
public static async create (
86
93
AppModule : Class < any > | DynamicModule ,
87
- options : NestContextOptions & ProgramOptions = { }
94
+ options : ProgramFactoryOptions = { }
88
95
) : Promise < CliApplicationContext > {
89
96
return this . context (
90
97
await NestFactory . createApplicationContext (
@@ -95,4 +102,4 @@ class ProgramFactory {
95
102
}
96
103
}
97
104
98
- export default ProgramFactory
105
+ export { ProgramFactory as default , type ProgramFactoryOptions }
0 commit comments