File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,22 @@ import { config } from './config'
6
6
import { extract } from './extract'
7
7
import { checkIsolatedDeclarations , getAllTypeScriptFiles , writeToFile } from './utils'
8
8
9
+ /**
10
+ * Generate declaration files from TypeScript files.
11
+ * @param options - Generation options.
12
+ * @returns Promise<void>
13
+ * @example ```ts
14
+ * // Generate declaration files from all TypeScript files in the src directory.
15
+ * const options = {
16
+ * cwd: process.cwd(),
17
+ * root: './src',
18
+ * outdir: './dist',
19
+ * clean: true,
20
+ * verbose: false,
21
+ * }
22
+ *
23
+ * await generateDeclarationsFromFiles(options)
24
+ */
9
25
export async function generateDeclarationsFromFiles ( options ?: DtsGenerationConfig ) : Promise < void > {
10
26
try {
11
27
// Check for isolatedModules setting
@@ -51,6 +67,22 @@ export async function generateDeclarationsFromFiles(options?: DtsGenerationConfi
51
67
}
52
68
}
53
69
70
+ /**
71
+ * Generate TypeScript declaration files.
72
+ * @param options - Generation options.
73
+ * @returns Promise<void>
74
+ * @example ```ts
75
+ * // Generate declaration files from all TypeScript files in the src directory.
76
+ * const options = {
77
+ * cwd: process.cwd(),
78
+ * root: './src',
79
+ * outdir: './dist',
80
+ * clean: true,
81
+ * verbose: false,
82
+ * }
83
+ *
84
+ * await generate(options)
85
+ */
54
86
export async function generate ( options ?: DtsGenerationOption ) : Promise < void > {
55
87
await generateDeclarationsFromFiles ( { ...config , ...options } )
56
88
}
You can’t perform that action at this time.
0 commit comments