Skip to content

Commit d12116d

Browse files
committed
Fix all internal JSDoc comments
If these are regular comments, then they won't appear in our d.ts files. But, now we are relying on an external d.ts bundler to produce our final merged, so they need to be present in the "input" d.ts files, meaning they have to be JSDoc comments. These comments only work today because all of our builds load their TS files from scratch, so they see the actual source files and their non-JSDoc comments. The comments also need to be attached to a declaration, not floating, otherwise they won't be used by api-extractor, so move them if needed.
1 parent 231fa27 commit d12116d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2850
-2116
lines changed

scripts/failed-tests.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const os = require("os");
1010
reporter?: Mocha.ReporterConstructor | keyof Mocha.reporters;
1111
reporterOptions?: any; // TODO(jakebailey): what?
1212
}} ReporterOptions */
13+
void 0;
1314

1415
/**
1516
* .failed-tests reporter

scripts/processDiagnosticMessages.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import fs from "fs";
99
isEarly?: boolean;
1010
elidedInCompatabilityPyramid?: boolean;
1111
}} DiagnosticDetails */
12+
void 0;
1213

1314
/** @typedef {Map<string, DiagnosticDetails>} InputDiagnosticMessageTable */
1415

scripts/word2md.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const sys = (() => {
6060
subscript?: boolean;
6161
};
6262
}} FindReplaceOptions */
63+
void 0;
6364

6465
/**
6566
* @param {Word.Document} doc

src/compiler/builder.ts

+27-12
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ export interface ReusableDiagnosticRelatedInformation {
3939
/** @internal */
4040
export type ReusableDiagnosticMessageChain = DiagnosticMessageChain;
4141

42-
/** @internal */
43-
/** Signature (Hash of d.ts emitted), is string if it was emitted using same d.ts.map option as what compilerOptions indicate, otherwise tuple of string */
42+
/**
43+
* Signature (Hash of d.ts emitted), is string if it was emitted using same d.ts.map option as what compilerOptions indicate, otherwise tuple of string
44+
*
45+
* @internal
46+
*/
4447
export type EmitSignature = string | [signature: string];
4548

4649
/** @internal */
@@ -105,9 +108,10 @@ export const enum BuilderFileEmit {
105108
All = AllJs | AllDts,
106109
}
107110

108-
/** @internal */
109111
/**
110112
* State to store the changed files, affected files and cache semantic diagnostics
113+
*
114+
* @internal
111115
*/
112116
// TODO: GH#18217 Properties of this interface are frequently asserted to be defined.
113117
export interface BuilderProgramState extends BuilderState, ReusableBuilderProgramState {
@@ -174,8 +178,11 @@ export type SavedBuildProgramEmitState = Pick<BuilderProgramState,
174178
"hasChangedEmitSignature"
175179
> & { changedFilesSet: BuilderProgramState["changedFilesSet"] | undefined };
176180

177-
/** @internal */
178-
/** Get flags determining what all needs to be emitted */
181+
/**
182+
* Get flags determining what all needs to be emitted
183+
*
184+
* @internal
185+
*/
179186
export function getBuilderFileEmit(options: CompilerOptions) {
180187
let result = BuilderFileEmit.Js;
181188
if (options.sourceMap) result = result | BuilderFileEmit.JsMap;
@@ -186,8 +193,11 @@ export function getBuilderFileEmit(options: CompilerOptions) {
186193
return result;
187194
}
188195

189-
/** @internal */
190-
/** Determing what all is pending to be emitted based on previous options or previous file emit flags */
196+
/**
197+
* Determing what all is pending to be emitted based on previous options or previous file emit flags
198+
*
199+
* @internal
200+
*/
191201
export function getPendingEmitKind(optionsOrEmitKind: CompilerOptions | BuilderFileEmit, oldOptionsOrEmitKind: CompilerOptions | BuilderFileEmit | undefined): BuilderFileEmit {
192202
const oldEmitKind = oldOptionsOrEmitKind && (isNumber(oldOptionsOrEmitKind) ? oldOptionsOrEmitKind : getBuilderFileEmit(oldOptionsOrEmitKind));
193203
const emitKind = isNumber(optionsOrEmitKind) ? optionsOrEmitKind : getBuilderFileEmit(optionsOrEmitKind);
@@ -821,11 +831,12 @@ export type ProgramBuildInfoFileId = number & { __programBuildInfoFileIdBrand: a
821831
export type ProgramBuildInfoFileIdListId = number & { __programBuildInfoFileIdListIdBrand: any };
822832
/** @internal */
823833
export type ProgramBuildInfoDiagnostic = ProgramBuildInfoFileId | [fileId: ProgramBuildInfoFileId, diagnostics: readonly ReusableDiagnostic[]];
824-
/** @internal */
825834
/**
826835
* fileId if pending emit is same as what compilerOptions suggest
827836
* [fileId] if pending emit is only dts file emit
828837
* [fileId, emitKind] if any other type emit is pending
838+
*
839+
* @internal
829840
*/
830841
export type ProgramBuilderInfoFilePendingEmit = ProgramBuildInfoFileId | [fileId: ProgramBuildInfoFileId] | [fileId: ProgramBuildInfoFileId, emitKind: BuilderFileEmit];
831842
/** @internal */
@@ -840,15 +851,17 @@ export type ProgramMultiFileEmitBuildInfoBuilderStateFileInfo = Omit<BuilderStat
840851
*/
841852
signature: string | false | undefined;
842853
};
843-
/** @internal */
844854
/**
845855
* [fileId, signature] if different from file's signature
846856
* fileId if file wasnt emitted
857+
*
858+
* @internal
847859
*/
848860
export type ProgramBuildInfoEmitSignature = ProgramBuildInfoFileId | [fileId: ProgramBuildInfoFileId, signature: EmitSignature | []];
849-
/** @internal */
850861
/**
851862
* ProgramMultiFileEmitBuildInfoFileInfo is string if FileInfo.version === FileInfo.signature && !FileInfo.affectsGlobalScope otherwise encoded FileInfo
863+
*
864+
* @internal
852865
*/
853866
export type ProgramMultiFileEmitBuildInfoFileInfo = string | ProgramMultiFileEmitBuildInfoBuilderStateFileInfo;
854867
/** @internal */
@@ -866,15 +879,17 @@ export interface ProgramMultiFileEmitBuildInfo {
866879
// Because this is only output file in the program, we dont need fileId to deduplicate name
867880
latestChangedDtsFile?: string | undefined;
868881
}
869-
/** @internal */
870882
/**
871883
* ProgramBundleEmitBuildInfoFileInfo is string if !FileInfo.impliedFormat otherwise encoded FileInfo
884+
*
885+
* @internal
872886
*/
873887
export type ProgramBundleEmitBuildInfoFileInfo = string | BuilderState.FileInfo;
874-
/** @internal */
875888
/**
876889
* false if it is the emit corresponding to compilerOptions
877890
* value otherwise
891+
*
892+
* @internal
878893
*/
879894
export type ProgramBuildInfoBundlePendingEmit = BuilderFileEmit | false;
880895
/** @internal */

src/compiler/builderPublic.ts

+16-11
Original file line numberDiff line numberDiff line change
@@ -23,46 +23,51 @@ export interface BuilderProgramHost {
2323
writeFile?: WriteFileCallback;
2424
/**
2525
* disable using source file version as signature for testing
26+
*
27+
* @internal
2628
*/
27-
/*@internal*/
2829
disableUseFileVersionAsSignature?: boolean;
2930
/**
3031
* Store the list of files that update signature during the emit
32+
*
33+
* @internal
3134
*/
32-
/*@internal*/
3335
storeFilesChangingSignatureDuringEmit?: boolean;
3436
/**
3537
* Gets the current time
38+
*
39+
* @internal
3640
*/
37-
/*@internal*/
3841
now?(): Date;
3942
}
4043

4144
/**
4245
* Builder to manage the program state changes
4346
*/
4447
export interface BuilderProgram {
45-
/*@internal*/
48+
/** @internal */
4649
getState(): ReusableBuilderProgramState;
47-
/*@internal*/
50+
/** @internal */
4851
saveEmitState(): SavedBuildProgramEmitState;
49-
/*@internal*/
52+
/** @internal */
5053
restoreEmitState(saved: SavedBuildProgramEmitState): void;
51-
/*@internal*/
54+
/** @internal */
5255
hasChangedEmitSignature?(): boolean;
5356
/**
5457
* Returns current program
5558
*/
5659
getProgram(): Program;
5760
/**
5861
* Returns current program that could be undefined if the program was released
62+
*
63+
* @internal
5964
*/
60-
/*@internal*/
6165
getProgramOrUndefined(): Program | undefined;
6266
/**
6367
* Releases reference to the program, making all the other operations that need program to fail.
68+
*
69+
* @internal
6470
*/
65-
/*@internal*/
6671
releaseProgram(): void;
6772
/**
6873
* Get compiler options of the program
@@ -122,13 +127,13 @@ export interface BuilderProgram {
122127
* in that order would be used to write the files
123128
*/
124129
emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult;
125-
/*@internal*/
130+
/** @internal */
126131
emitBuildInfo(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken): EmitResult;
127132
/**
128133
* Get the current directory of the program
129134
*/
130135
getCurrentDirectory(): string;
131-
/*@internal*/
136+
/** @internal */
132137
close(): void;
133138
}
134139

src/compiler/builderStatePublic.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { Diagnostic, WriteFileCallbackData } from "./_namespaces/ts";
33
export interface EmitOutput {
44
outputFiles: OutputFile[];
55
emitSkipped: boolean;
6-
/* @internal */ diagnostics: readonly Diagnostic[];
6+
/** @internal */ diagnostics: readonly Diagnostic[];
77
}
88

99
export interface OutputFile {
1010
name: string;
1111
writeByteOrderMark: boolean;
1212
text: string;
13-
/* @internal */ data?: WriteFileCallbackData;
13+
/** @internal */ data?: WriteFileCallbackData;
1414
}

0 commit comments

Comments
 (0)