|
4 | 4 |
|
5 | 5 | ```ts |
6 | 6 |
|
| 7 | +import { INodePackageJson } from '@microsoft/node-core-library'; |
7 | 8 | import { JsonSchema } from '@microsoft/node-core-library'; |
8 | 9 | import * as ts from 'typescript'; |
9 | 10 | import * as tsdoc from '@microsoft/tsdoc'; |
10 | 11 |
|
| 12 | +// @public |
| 13 | +export class CompilerState { |
| 14 | + static create(extractorConfig: ExtractorConfig, options?: IExtractorInvokeOptions): CompilerState; |
| 15 | + readonly program: ts.Program; |
| 16 | + } |
| 17 | + |
11 | 18 | // @public |
12 | 19 | export class Extractor { |
13 | | - constructor(config: IExtractorConfig, options?: IExtractorOptions); |
14 | | - readonly actualConfig: IExtractorConfig; |
15 | | - // @deprecated |
16 | | - analyzeProject(options?: IAnalyzeProjectOptions): void; |
17 | | - static generateFilePathsForAnalysis(inputFilePaths: string[]): string[]; |
18 | | - static jsonSchema: JsonSchema; |
19 | | - static loadConfigObject(jsonConfigFile: string): IExtractorConfig; |
| 20 | + static invokeUsingConfig(extractorConfig: ExtractorConfig, options?: IExtractorInvokeOptions): ExtractorResult; |
| 21 | + static invokeUsingConfigFromFile(configFilePath: string, options?: IExtractorInvokeOptions): ExtractorResult; |
20 | 22 | static readonly packageName: string; |
21 | | - processProject(options?: IAnalyzeProjectOptions): boolean; |
22 | | - static processProjectFromConfigFile(jsonConfigFile: string, options?: IExtractorOptions): void; |
23 | 23 | static readonly version: string; |
24 | 24 | } |
25 | 25 |
|
| 26 | +// @public |
| 27 | +export class ExtractorConfig { |
| 28 | + constructor(); |
| 29 | + apiJsonFilePath: string; |
| 30 | + apiReportEnabled: boolean; |
| 31 | + betaTrimmedFilePath: string; |
| 32 | + docModelEnabled: boolean; |
| 33 | + static readonly FILENAME: string; |
| 34 | + // @internal |
| 35 | + _getShortFilePath(absolutePath: string): string; |
| 36 | + static hasDtsFileExtension(filePath: string): boolean; |
| 37 | + static readonly jsonSchema: JsonSchema; |
| 38 | + static loadAndParseConfig(jsonFilePath: string): ExtractorConfig; |
| 39 | + static loadJsonFileWithInheritance(jsonFilePath: string): Partial<IExtractorConfig>; |
| 40 | + mainEntryPointFile: string; |
| 41 | + messages: IExtractorMessagesConfig; |
| 42 | + overrideTsconfig?: {}; |
| 43 | + packageFolder: string; |
| 44 | + packageJson: INodePackageJson; |
| 45 | + static parseConfigObject(options: IExtractorConfigParseConfigOptions): ExtractorConfig; |
| 46 | + publicTrimmedFilePath: string; |
| 47 | + reportFilePath: string; |
| 48 | + rollupEnabled: boolean; |
| 49 | + rootFolder: string; |
| 50 | + skipLibCheck: boolean; |
| 51 | + tempReportFilePath: string; |
| 52 | + testMode: boolean; |
| 53 | + readonly tokens: IExtractorConfigTokens; |
| 54 | + tsdocMetadataEnabled: boolean; |
| 55 | + tsdocMetadataFilePath: string; |
| 56 | + untrimmedFilePath: string; |
| 57 | +} |
| 58 | + |
26 | 59 | // @public |
27 | 60 | export class ExtractorMessage { |
28 | 61 | // Warning: (ae-forgotten-export) The symbol "IExtractorMessageOptions" needs to be exported by the entry point index.d.ts |
@@ -73,123 +106,111 @@ export const enum ExtractorMessageLogLevel { |
73 | 106 | } |
74 | 107 |
|
75 | 108 | // @public |
76 | | -export const enum ExtractorValidationRulePolicy { |
77 | | - allow = "allow", |
78 | | - error = "error" |
79 | | -} |
80 | | - |
81 | | -// @public |
82 | | -export interface IAnalyzeProjectOptions { |
83 | | - projectConfig?: IExtractorProjectConfig; |
| 109 | +export class ExtractorResult { |
| 110 | + // @internal |
| 111 | + constructor(properties: ExtractorResult); |
| 112 | + readonly compilerState: CompilerState; |
| 113 | + readonly errorCount: number; |
| 114 | + readonly extractorConfig: ExtractorConfig; |
| 115 | + readonly succeeded: boolean; |
| 116 | + readonly warningCount: number; |
84 | 117 | } |
85 | 118 |
|
86 | 119 | // @public |
87 | | -export interface IExtractorApiJsonFileConfig { |
| 120 | +export interface IExtractorApiReportConfig { |
88 | 121 | enabled: boolean; |
89 | | - outputFolder?: string; |
| 122 | + reportFileName?: string; |
| 123 | + reportFolder?: string; |
| 124 | + tempFolder?: string; |
90 | 125 | } |
91 | 126 |
|
92 | 127 | // @public |
93 | | -export interface IExtractorApiReviewFileConfig { |
94 | | - apiReviewFolder?: string; |
95 | | - enabled: boolean; |
96 | | - tempFolder?: string; |
| 128 | +export interface IExtractorCompilerConfig { |
| 129 | + overrideTsconfig?: {}; |
| 130 | + rootFolder: string; |
| 131 | + skipLibCheck?: boolean; |
97 | 132 | } |
98 | 133 |
|
99 | 134 | // @public |
100 | 135 | export interface IExtractorConfig { |
101 | | - apiJsonFile?: IExtractorApiJsonFileConfig; |
102 | | - apiReviewFile?: IExtractorApiReviewFileConfig; |
103 | | - compiler: IExtractorTsconfigCompilerConfig | IExtractorRuntimeCompilerConfig; |
| 136 | + apiReport?: IExtractorApiReportConfig; |
| 137 | + compiler?: IExtractorCompilerConfig; |
| 138 | + docModel?: IExtractorDocModelConfig; |
104 | 139 | // @beta |
105 | 140 | dtsRollup?: IExtractorDtsRollupConfig; |
106 | 141 | extends?: string; |
| 142 | + mainEntryPointFile: string; |
107 | 143 | messages?: IExtractorMessagesConfig; |
108 | | - policies?: IExtractorPoliciesConfig; |
109 | | - project: IExtractorProjectConfig; |
110 | | - skipLibCheck?: boolean; |
111 | 144 | testMode?: boolean; |
112 | 145 | // @beta |
113 | 146 | tsdocMetadata?: IExtractorTsdocMetadataConfig; |
114 | | - validationRules?: IExtractorValidationRulesConfig; |
115 | | -} |
116 | | - |
117 | | -// @beta |
118 | | -export interface IExtractorDtsRollupConfig { |
119 | | - enabled: boolean; |
120 | | - mainDtsRollupPath?: string; |
121 | | - publishFolder?: string; |
122 | | - publishFolderForBeta?: string; |
123 | | - publishFolderForInternal?: string; |
124 | | - publishFolderForPublic?: string; |
125 | | - trimming?: boolean; |
126 | 147 | } |
127 | 148 |
|
128 | 149 | // @public |
129 | | -export interface IExtractorMessageProperties { |
130 | | - readonly exportName?: string; |
| 150 | +export interface IExtractorConfigParseConfigOptions { |
| 151 | + // (undocumented) |
| 152 | + mergedConfig: Partial<IExtractorConfig>; |
| 153 | + // (undocumented) |
| 154 | + mergedConfigFullPath: string; |
| 155 | + // (undocumented) |
| 156 | + packageJsonPath: string | undefined; |
131 | 157 | } |
132 | 158 |
|
133 | 159 | // @public |
134 | | -export interface IExtractorMessageReportingRuleConfig { |
135 | | - addToApiReviewFile?: boolean; |
136 | | - logLevel: ExtractorMessageLogLevel; |
| 160 | +export interface IExtractorConfigTokens { |
| 161 | + packageName: string; |
| 162 | + unscopedPackageName: string; |
137 | 163 | } |
138 | 164 |
|
139 | 165 | // @public |
140 | | -export interface IExtractorMessageReportingTableConfig { |
141 | | - [messageId: string]: IExtractorMessageReportingRuleConfig; |
| 166 | +export interface IExtractorDocModelConfig { |
| 167 | + apiJsonFilePath?: string; |
| 168 | + enabled: boolean; |
142 | 169 | } |
143 | 170 |
|
144 | 171 | // @public |
145 | | -export interface IExtractorMessagesConfig { |
146 | | - compilerMessageReporting?: IExtractorMessageReportingTableConfig; |
147 | | - extractorMessageReporting?: IExtractorMessageReportingTableConfig; |
148 | | - tsdocMessageReporting?: IExtractorMessageReportingTableConfig; |
| 172 | +export interface IExtractorDtsRollupConfig { |
| 173 | + betaTrimmedFilePath?: string; |
| 174 | + enabled: boolean; |
| 175 | + publicTrimmedFilePath?: string; |
| 176 | + untrimmedFilePath?: string; |
149 | 177 | } |
150 | 178 |
|
151 | 179 | // @public |
152 | | -export interface IExtractorOptions { |
153 | | - compilerProgram?: ts.Program; |
| 180 | +export interface IExtractorInvokeOptions { |
| 181 | + compilerState?: CompilerState; |
154 | 182 | customLogger?: Partial<ILogger>; |
155 | 183 | localBuild?: boolean; |
156 | | - // @beta |
157 | 184 | typescriptCompilerFolder?: string; |
158 | 185 | } |
159 | 186 |
|
160 | 187 | // @public |
161 | | -export interface IExtractorPoliciesConfig { |
162 | | - namespaceSupport?: 'conservative' | 'permissive'; |
| 188 | +export interface IExtractorMessageProperties { |
| 189 | + readonly exportName?: string; |
163 | 190 | } |
164 | 191 |
|
165 | 192 | // @public |
166 | | -export interface IExtractorProjectConfig { |
167 | | - entryPointSourceFile: string; |
| 193 | +export interface IExtractorMessageReportingRuleConfig { |
| 194 | + addToApiReviewFile?: boolean; |
| 195 | + logLevel: ExtractorMessageLogLevel; |
168 | 196 | } |
169 | 197 |
|
170 | 198 | // @public |
171 | | -export interface IExtractorRuntimeCompilerConfig { |
172 | | - // (undocumented) |
173 | | - configType: 'runtime'; |
| 199 | +export interface IExtractorMessageReportingTableConfig { |
| 200 | + [messageId: string]: IExtractorMessageReportingRuleConfig; |
174 | 201 | } |
175 | 202 |
|
176 | 203 | // @public |
177 | | -export interface IExtractorTsconfigCompilerConfig { |
178 | | - // (undocumented) |
179 | | - configType: 'tsconfig'; |
180 | | - overrideTsconfig?: {}; |
181 | | - rootFolder: string; |
| 204 | +export interface IExtractorMessagesConfig { |
| 205 | + compilerMessageReporting?: IExtractorMessageReportingTableConfig; |
| 206 | + extractorMessageReporting?: IExtractorMessageReportingTableConfig; |
| 207 | + tsdocMessageReporting?: IExtractorMessageReportingTableConfig; |
182 | 208 | } |
183 | 209 |
|
184 | | -// @beta |
| 210 | +// @public |
185 | 211 | export interface IExtractorTsdocMetadataConfig { |
186 | 212 | enabled: boolean; |
187 | | - tsdocMetadataPath?: string; |
188 | | -} |
189 | | - |
190 | | -// @public |
191 | | -export interface IExtractorValidationRulesConfig { |
192 | | - missingReleaseTags?: ExtractorValidationRulePolicy; |
| 213 | + tsdocMetadataFilePath?: string; |
193 | 214 | } |
194 | 215 |
|
195 | 216 | // @public |
|
0 commit comments