diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 28f7de4506112..42748e495f112 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -154,6 +154,7 @@ export interface ReusableBuilderProgramState extends BuilderState { */ latestChangedDtsFile: string | undefined; /** + * @deprecated * Bundle information either from oldState or current one so it can be used to complete the information in buildInfo when emitting only js or dts files */ bundle?: BundleBuildInfo; diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 864d679c4d51f..bf660faa6abea 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1168,6 +1168,7 @@ export const notImplementedResolver: EmitResolver = { /** * File that isnt present resulting in error or output files * + * @deprecated * @internal */ export type EmitUsingBuildInfoResult = string | readonly OutputFile[]; @@ -1199,7 +1200,7 @@ function createSourceFilesFromBundleBuildInfo(bundle: BundleBuildInfo, buildInfo }); } -/** @internal */ +/** @deprecated @internal */ export function emitUsingBuildInfo( config: ParsedCommandLine, host: CompilerHost, diff --git a/src/compiler/factory/nodeFactory.ts b/src/compiler/factory/nodeFactory.ts index ecafc7f7a098e..571ea07d47cc4 100644 --- a/src/compiler/factory/nodeFactory.ts +++ b/src/compiler/factory/nodeFactory.ts @@ -7273,8 +7273,11 @@ const syntheticFactory: BaseNodeFactory = { export const factory = createNodeFactory(NodeFactoryFlags.NoIndentationOnFreshPropertyAccess, syntheticFactory); +/** @deprecated */ export function createUnparsedSourceFile(text: string): UnparsedSource; +/** @deprecated */ export function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource; +/** @deprecated */ export function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource; export function createUnparsedSourceFile(textOrInputFiles: string | InputFiles, mapPathOrType?: string, mapTextOrStripInternal?: string | boolean): UnparsedSource { let stripInternal: boolean | undefined; @@ -7445,10 +7448,12 @@ function parseOldFileOfCurrentEmit(bundleFileInfo: BundleFileInfo) { } // TODO(rbuckton): Move part of this to factory +/** @deprecated */ export function createInputFiles( javascriptText: string, declarationText: string ): InputFiles; +/** @deprecated */ export function createInputFiles( javascriptText: string, declarationText: string, @@ -7457,6 +7462,7 @@ export function createInputFiles( declarationMapPath: string | undefined, declarationMapText: string | undefined ): InputFiles; +/** @deprecated */ export function createInputFiles( readFileText: (path: string) => string | undefined, javascriptPath: string, @@ -7493,7 +7499,7 @@ export function createInputFiles( declarationMapTextOrBuildInfoPath, ); } -/** @internal */ +/** @deprecated @internal */ export function createInputFilesWithFilePaths( readFileText: (path: string) => string | undefined, javascriptPath: string, @@ -7546,7 +7552,7 @@ export function createInputFilesWithFilePaths( }); return node; } -/** @internal */ +/** @deprecated @internal */ export function createInputFilesWithFileTexts( javascriptPath: string | undefined, javascriptText: string, diff --git a/src/compiler/factory/nodeTests.ts b/src/compiler/factory/nodeTests.ts index 7a8405a4e9105..1e2a505830ca3 100644 --- a/src/compiler/factory/nodeTests.ts +++ b/src/compiler/factory/nodeTests.ts @@ -1011,7 +1011,7 @@ export function isEnumMember(node: Node): node is EnumMember { // Unparsed // TODO(rbuckton): isUnparsedPrologue - +/** @deprecated */ export function isUnparsedPrepend(node: Node): node is UnparsedPrepend { return node.kind === SyntaxKind.UnparsedPrepend; } @@ -1029,6 +1029,7 @@ export function isBundle(node: Node): node is Bundle { return node.kind === SyntaxKind.Bundle; } +/** @deprecated */ export function isUnparsedSource(node: Node): node is UnparsedSource { return node.kind === SyntaxKind.UnparsedSource; } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 8b1c88467cc3a..00ffe991ade69 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -5023,7 +5023,7 @@ export function parseConfigHostFromCompilerHostLike(host: CompilerHostLike, dire }; } -/** @internal */ +/** @deprecated @internal */ export function createPrependNodes( projectReferences: readonly ProjectReference[] | undefined, getCommandLine: (ref: ProjectReference, index: number) => ParsedCommandLine | undefined, diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index dedf7e4729945..66b7926935b35 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -16,6 +16,7 @@ export enum UpToDateStatusType { */ UpToDateWithUpstreamTypes, /** + * @deprecated * The project appears out of date because its upstream inputs are newer than its outputs, * but all of its outputs are actually newer than the previous identical outputs of its (.d.ts) inputs. * This means we can Pseudo-build (just manipulate outputs), as if we had actually built this project. @@ -87,6 +88,7 @@ export namespace Status { } /** + * @deprecated * The project is up to date with respect to its inputs except for prepend output changed (no declaration file change in prepend). */ export interface OutOfDateWithPrepend { diff --git a/src/compiler/tsbuildPublic.ts b/src/compiler/tsbuildPublic.ts index 836b9f3b98bde..159f01714ba83 100644 --- a/src/compiler/tsbuildPublic.ts +++ b/src/compiler/tsbuildPublic.ts @@ -237,8 +237,8 @@ export interface SolutionBuilderHostBase extends Progr // TODO: To do better with watch mode and normal build mode api that creates program and emits files // This currently helps enable --diagnostics and --extendedDiagnostics afterProgramEmitAndDiagnostics?(program: T): void; - /** @internal */ beforeEmitBundle?(config: ParsedCommandLine): void; - /** @internal */ afterEmitBundle?(config: ParsedCommandLine): void; + /** @deprecated @internal */ beforeEmitBundle?(config: ParsedCommandLine): void; + /** @deprecated @internal */ afterEmitBundle?(config: ParsedCommandLine): void; // For testing /** @internal */ now?(): Date; @@ -795,7 +795,7 @@ function setupInitialBuild(state: SolutionBuilderState export enum InvalidatedProjectKind { Build, - UpdateBundle, + /** @deprecated */ UpdateBundle, UpdateOutputFileStamps } @@ -847,6 +847,7 @@ export interface BuildInvalidedProject extends Invalid // emitNextAffectedFile(writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): AffectedFileResult; } +/** @deprecated */ export interface UpdateBundleProject extends InvalidatedProjectBase { readonly kind: InvalidatedProjectKind.UpdateBundle; emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject | undefined; @@ -898,9 +899,9 @@ enum BuildStep { SyntaxDiagnostics, SemanticDiagnostics, Emit, - EmitBundle, + /** @deprecated */ EmitBundle, EmitBuildInfo, - BuildInvalidatedProjectOfBundle, + /** @deprecated */ BuildInvalidatedProjectOfBundle, QueueReferencingProjects, Done } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index e51307eca9467..33bbcdc050f7b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -378,17 +378,17 @@ export const enum SyntaxKind { // Enum EnumMember, // Unparsed - UnparsedPrologue, - UnparsedPrepend, - UnparsedText, - UnparsedInternalText, - UnparsedSyntheticReference, + /** @deprecated */ UnparsedPrologue, + /** @deprecated */ UnparsedPrepend, + /** @deprecated */ UnparsedText, + /** @deprecated */ UnparsedInternalText, + /** @deprecated */ UnparsedSyntheticReference, // Top-level nodes SourceFile, Bundle, - UnparsedSource, - InputFiles, + /** @deprecated */ UnparsedSource, + /** @deprecated */ InputFiles, // JSDoc nodes JSDocTypeExpression, @@ -4408,7 +4408,7 @@ export type ExportedModulesFromDeclarationEmit = readonly Symbol[]; export interface Bundle extends Node { readonly kind: SyntaxKind.Bundle; - readonly prepends: readonly (InputFiles | UnparsedSource)[]; + /** @deprecated */ readonly prepends: readonly (InputFiles | UnparsedSource)[]; readonly sourceFiles: readonly SourceFile[]; /** @internal */ syntheticFileReferences?: readonly FileReference[]; /** @internal */ syntheticTypeReferences?: readonly FileReference[]; @@ -4416,6 +4416,7 @@ export interface Bundle extends Node { /** @internal */ hasNoDefaultLib?: boolean; } +/** @deprecated */ export interface InputFiles extends Node { readonly kind: SyntaxKind.InputFiles; javascriptPath?: string; @@ -4431,6 +4432,7 @@ export interface InputFiles extends Node { /** @internal */ oldFileOfCurrentEmit?: boolean; } +/** @deprecated */ export interface UnparsedSource extends Node { readonly kind: SyntaxKind.UnparsedSource; fileName: string; @@ -4455,29 +4457,34 @@ export interface UnparsedSource extends Node { getLineAndCharacterOfPosition(pos: number): LineAndCharacter; } +/** @deprecated */ export type UnparsedSourceText = | UnparsedPrepend | UnparsedTextLike ; +/** @deprecated */ export type UnparsedNode = | UnparsedPrologue | UnparsedSourceText | UnparsedSyntheticReference ; +/** @deprecated */ export interface UnparsedSection extends Node { readonly kind: SyntaxKind; readonly parent: UnparsedSource; readonly data?: string; } +/** @deprecated */ export interface UnparsedPrologue extends UnparsedSection { readonly kind: SyntaxKind.UnparsedPrologue; readonly parent: UnparsedSource; readonly data: string; } +/** @deprecated */ export interface UnparsedPrepend extends UnparsedSection { readonly kind: SyntaxKind.UnparsedPrepend; readonly parent: UnparsedSource; @@ -4485,11 +4492,13 @@ export interface UnparsedPrepend extends UnparsedSection { readonly texts: readonly UnparsedTextLike[]; } +/** @deprecated */ export interface UnparsedTextLike extends UnparsedSection { readonly kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText; readonly parent: UnparsedSource; } +/** @deprecated */ export interface UnparsedSyntheticReference extends UnparsedSection { readonly kind: SyntaxKind.UnparsedSyntheticReference; readonly parent: UnparsedSource; @@ -8013,7 +8022,7 @@ export interface EmitHost extends ScriptReferenceHost, ModuleSpecifierResolution isEmitBlocked(emitFileName: string): boolean; - getPrependNodes(): readonly (InputFiles | UnparsedSource)[]; + /** @deprecated */ getPrependNodes(): readonly (InputFiles | UnparsedSource)[]; writeFile: WriteFileCallback; getBuildInfo(bundle: BundleBuildInfo | undefined): BuildInfo | undefined; @@ -8671,12 +8680,12 @@ export interface NodeFactory { /** @internal */ createRedirectedSourceFile(redirectInfo: RedirectInfo): SourceFile; - /** @internal */ createUnparsedSource(prologues: readonly UnparsedPrologue[], syntheticReferences: readonly UnparsedSyntheticReference[] | undefined, texts: readonly UnparsedSourceText[]): UnparsedSource; - /** @internal */ createUnparsedPrologue(data?: string): UnparsedPrologue; - /** @internal */ createUnparsedPrepend(data: string | undefined, texts: readonly UnparsedSourceText[]): UnparsedPrepend; - /** @internal */ createUnparsedTextLike(data: string | undefined, internal: boolean): UnparsedTextLike; - /** @internal */ createUnparsedSyntheticReference(section: BundleFileHasNoDefaultLib | BundleFileReference): UnparsedSyntheticReference; - /** @internal */ createInputFiles(): InputFiles; + /** @deprecated @internal */ createUnparsedSource(prologues: readonly UnparsedPrologue[], syntheticReferences: readonly UnparsedSyntheticReference[] | undefined, texts: readonly UnparsedSourceText[]): UnparsedSource; + /** @deprecated @internal */ createUnparsedPrologue(data?: string): UnparsedPrologue; + /** @deprecated @internal */ createUnparsedPrepend(data: string | undefined, texts: readonly UnparsedSourceText[]): UnparsedPrepend; + /** @deprecated @internal */ createUnparsedTextLike(data: string | undefined, internal: boolean): UnparsedTextLike; + /** @deprecated @internal */ createUnparsedSyntheticReference(section: BundleFileHasNoDefaultLib | BundleFileReference): UnparsedSyntheticReference; + /** @deprecated @internal */ createInputFiles(): InputFiles; // // Synthetic Nodes @@ -8697,8 +8706,10 @@ export interface NodeFactory { /** @internal */ updateSyntheticReferenceExpression(node: SyntheticReferenceExpression, expression: Expression, thisArg: Expression): SyntheticReferenceExpression; createCommaListExpression(elements: readonly Expression[]): CommaListExpression; updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression; - createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; - updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; + createBundle(sourceFiles: readonly SourceFile[]): Bundle; + /** @deprecated*/ createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; // eslint-disable-line @typescript-eslint/unified-signatures + updateBundle(node: Bundle, sourceFiles: readonly SourceFile[]): Bundle; + /** @deprecated*/ updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; // eslint-disable-line @typescript-eslint/unified-signatures // // Common operators @@ -9164,10 +9175,10 @@ export interface Printer { /** @internal */ writeList(format: ListFormat, list: NodeArray | undefined, sourceFile: SourceFile | undefined, writer: EmitTextWriter): void; /** @internal */ writeFile(sourceFile: SourceFile, writer: EmitTextWriter, sourceMapGenerator: SourceMapGenerator | undefined): void; /** @internal */ writeBundle(bundle: Bundle, writer: EmitTextWriter, sourceMapGenerator: SourceMapGenerator | undefined): void; - /** @internal */ bundleFileInfo?: BundleFileInfo; + /** @deprecated @internal */ bundleFileInfo?: BundleFileInfo; } -/** @internal */ +/** @deprecated @internal */ export const enum BundleFileSectionKind { Prologue = "prologue", EmitHelpers = "emitHelpers", @@ -9183,51 +9194,51 @@ export const enum BundleFileSectionKind { // comments? } -/** @internal */ +/** @deprecated @internal */ export interface BundleFileSectionBase extends TextRange { kind: BundleFileSectionKind; data?: string; } -/** @internal */ +/** @deprecated @internal */ export interface BundleFilePrologue extends BundleFileSectionBase { kind: BundleFileSectionKind.Prologue; data: string; } -/** @internal */ +/** @deprecated @internal */ export interface BundleFileEmitHelpers extends BundleFileSectionBase { kind: BundleFileSectionKind.EmitHelpers; data: string; } -/** @internal */ +/** @deprecated @internal */ export interface BundleFileHasNoDefaultLib extends BundleFileSectionBase { kind: BundleFileSectionKind.NoDefaultLib; } -/** @internal */ +/** @deprecated @internal */ export interface BundleFileReference extends BundleFileSectionBase { kind: BundleFileSectionKind.Reference | BundleFileSectionKind.Type | BundleFileSectionKind.Lib | BundleFileSectionKind.TypeResolutionModeImport | BundleFileSectionKind.TypeResolutionModeRequire; data: string; } -/** @internal */ +/** @deprecated @internal */ export interface BundleFilePrepend extends BundleFileSectionBase { kind: BundleFileSectionKind.Prepend; data: string; texts: BundleFileTextLike[]; } -/** @internal */ +/** @deprecated @internal */ export type BundleFileTextLikeKind = BundleFileSectionKind.Text | BundleFileSectionKind.Internal; -/** @internal */ +/** @deprecated @internal */ export interface BundleFileTextLike extends BundleFileSectionBase { kind: BundleFileTextLikeKind; } -/** @internal */ +/** @deprecated @internal */ export type BundleFileSection = BundleFilePrologue | BundleFileEmitHelpers @@ -9236,31 +9247,31 @@ export type BundleFileSection = | BundleFilePrepend | BundleFileTextLike; -/** @internal */ +/** @deprecated @internal */ export interface SourceFilePrologueDirectiveExpression extends TextRange { text: string; } -/** @internal */ +/** @deprecated @internal */ export interface SourceFilePrologueDirective extends TextRange { expression: SourceFilePrologueDirectiveExpression; } -/** @internal */ +/** @deprecated @internal */ export interface SourceFilePrologueInfo { file: number; text: string; directives: SourceFilePrologueDirective[]; } -/** @internal */ +/** @deprecated @internal */ export interface SourceFileInfo { // List of helpers in own source files emitted if no prepend is present helpers?: string[]; prologues?: SourceFilePrologueInfo[]; } -/** @internal */ +/** @deprecated @internal */ export interface BundleFileInfo { sections: BundleFileSection[]; hash?: string; @@ -9268,7 +9279,7 @@ export interface BundleFileInfo { sources?: SourceFileInfo; } -/** @internal */ +/** @deprecated @internal */ export interface BundleBuildInfo { js?: BundleFileInfo; dts?: BundleFileInfo; @@ -9278,6 +9289,7 @@ export interface BundleBuildInfo { /** @internal */ export interface BuildInfo { + /** @deprecated */ bundle?: BundleBuildInfo; program?: ProgramBuildInfo; version: string; @@ -9356,7 +9368,7 @@ export interface PrinterOptions { /** @internal */ extendedDiagnostics?: boolean; /** @internal */ onlyPrintJsDocStyle?: boolean; /** @internal */ neverAsciiEscape?: boolean; - /** @internal */ writeBundleFileInfo?: boolean; + /** @deprecated @internal */ writeBundleFileInfo?: boolean; /** @internal */ recordInternalSection?: boolean; /** @internal */ stripInternal?: boolean; /** @internal */ preserveSourceNewlines?: boolean; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 80dda6c449dbe..fe3e58ea54deb 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -7406,7 +7406,7 @@ export function getNameOfAccessExpression(node: AccessExpression) { return node.argumentExpression; } -/** @internal */ +/** @deprecated @internal */ export function isBundleFileTextLike(section: BundleFileSection): section is BundleFileTextLike { switch (section.kind) { case BundleFileSectionKind.Text: diff --git a/src/compiler/utilitiesPublic.ts b/src/compiler/utilitiesPublic.ts index 0aeccfe090146..ba56503e7e4ed 100644 --- a/src/compiler/utilitiesPublic.ts +++ b/src/compiler/utilitiesPublic.ts @@ -1373,6 +1373,7 @@ export function isNamedExportBindings(node: Node): node is NamedExportBindings { return node.kind === SyntaxKind.NamespaceExport || node.kind === SyntaxKind.NamedExports; } +/** @deprecated */ export function isUnparsedTextLike(node: Node): node is UnparsedTextLike { switch (node.kind) { case SyntaxKind.UnparsedText: @@ -1383,6 +1384,7 @@ export function isUnparsedTextLike(node: Node): node is UnparsedTextLike { } } +/** @deprecated */ export function isUnparsedNode(node: Node): node is UnparsedNode { return isUnparsedTextLike(node) || node.kind === SyntaxKind.UnparsedPrologue || diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index e4a39293edfcc..89c5264cabe90 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -4330,15 +4330,15 @@ declare namespace ts { ShorthandPropertyAssignment = 300, SpreadAssignment = 301, EnumMember = 302, - UnparsedPrologue = 303, - UnparsedPrepend = 304, - UnparsedText = 305, - UnparsedInternalText = 306, - UnparsedSyntheticReference = 307, + /** @deprecated */ UnparsedPrologue = 303, + /** @deprecated */ UnparsedPrepend = 304, + /** @deprecated */ UnparsedText = 305, + /** @deprecated */ UnparsedInternalText = 306, + /** @deprecated */ UnparsedSyntheticReference = 307, SourceFile = 308, Bundle = 309, - UnparsedSource = 310, - InputFiles = 311, + /** @deprecated */ UnparsedSource = 310, + /** @deprecated */ InputFiles = 311, JSDocTypeExpression = 312, JSDocNameReference = 313, JSDocMemberName = 314, @@ -6105,9 +6105,10 @@ declare namespace ts { } interface Bundle extends Node { readonly kind: SyntaxKind.Bundle; - readonly prepends: readonly (InputFiles | UnparsedSource)[]; + /** @deprecated */ readonly prepends: readonly (InputFiles | UnparsedSource)[]; readonly sourceFiles: readonly SourceFile[]; } + /** @deprecated */ interface InputFiles extends Node { readonly kind: SyntaxKind.InputFiles; javascriptPath?: string; @@ -6119,6 +6120,7 @@ declare namespace ts { declarationMapPath?: string; declarationMapText?: string; } + /** @deprecated */ interface UnparsedSource extends Node { readonly kind: SyntaxKind.UnparsedSource; fileName: string; @@ -6134,28 +6136,35 @@ declare namespace ts { readonly syntheticReferences?: readonly UnparsedSyntheticReference[]; readonly texts: readonly UnparsedSourceText[]; } + /** @deprecated */ type UnparsedSourceText = UnparsedPrepend | UnparsedTextLike; + /** @deprecated */ type UnparsedNode = UnparsedPrologue | UnparsedSourceText | UnparsedSyntheticReference; + /** @deprecated */ interface UnparsedSection extends Node { readonly kind: SyntaxKind; readonly parent: UnparsedSource; readonly data?: string; } + /** @deprecated */ interface UnparsedPrologue extends UnparsedSection { readonly kind: SyntaxKind.UnparsedPrologue; readonly parent: UnparsedSource; readonly data: string; } + /** @deprecated */ interface UnparsedPrepend extends UnparsedSection { readonly kind: SyntaxKind.UnparsedPrepend; readonly parent: UnparsedSource; readonly data: string; readonly texts: readonly UnparsedTextLike[]; } + /** @deprecated */ interface UnparsedTextLike extends UnparsedSection { readonly kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText; readonly parent: UnparsedSource; } + /** @deprecated */ interface UnparsedSyntheticReference extends UnparsedSection { readonly kind: SyntaxKind.UnparsedSyntheticReference; readonly parent: UnparsedSource; @@ -7882,8 +7891,10 @@ declare namespace ts { updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression; createCommaListExpression(elements: readonly Expression[]): CommaListExpression; updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression; - createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; - updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; + createBundle(sourceFiles: readonly SourceFile[]): Bundle; + /** @deprecated*/ createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; + updateBundle(node: Bundle, sourceFiles: readonly SourceFile[]): Bundle; + /** @deprecated*/ updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; createComma(left: Expression, right: Expression): BinaryExpression; createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment; createAssignment(left: Expression, right: Expression): AssignmentExpression; @@ -8589,7 +8600,9 @@ declare namespace ts { function isNonNullChain(node: Node): node is NonNullChain; function isBreakOrContinueStatement(node: Node): node is BreakOrContinueStatement; function isNamedExportBindings(node: Node): node is NamedExportBindings; + /** @deprecated */ function isUnparsedTextLike(node: Node): node is UnparsedTextLike; + /** @deprecated */ function isUnparsedNode(node: Node): node is UnparsedNode; function isJSDocPropertyLikeTag(node: Node): node is JSDocPropertyLikeTag; /** @@ -8657,11 +8670,17 @@ declare namespace ts { name: Identifier; }; function emitModuleKindIsNonNodeESM(moduleKind: ModuleKind): boolean; + /** @deprecated */ function createUnparsedSourceFile(text: string): UnparsedSource; + /** @deprecated */ function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource; + /** @deprecated */ function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource; + /** @deprecated */ function createInputFiles(javascriptText: string, declarationText: string): InputFiles; + /** @deprecated */ function createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles; + /** @deprecated */ function createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined, buildInfoPath: string | undefined): InputFiles; /** * Create an external source map source file reference @@ -8895,9 +8914,11 @@ declare namespace ts { function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment; function isSpreadAssignment(node: Node): node is SpreadAssignment; function isEnumMember(node: Node): node is EnumMember; + /** @deprecated */ function isUnparsedPrepend(node: Node): node is UnparsedPrepend; function isSourceFile(node: Node): node is SourceFile; function isBundle(node: Node): node is Bundle; + /** @deprecated */ function isUnparsedSource(node: Node): node is UnparsedSource; function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression; function isJSDocNameReference(node: Node): node is JSDocNameReference; @@ -9684,7 +9705,7 @@ declare namespace ts { } enum InvalidatedProjectKind { Build = 0, - UpdateBundle = 1, + /** @deprecated */ UpdateBundle = 1, UpdateOutputFileStamps = 2 } interface InvalidatedProjectBase { @@ -9716,6 +9737,7 @@ declare namespace ts { getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult; emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult | undefined; } + /** @deprecated */ interface UpdateBundleProject extends InvalidatedProjectBase { readonly kind: InvalidatedProjectKind.UpdateBundle; emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject | undefined; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index c0e7e4d5fe88d..c9ea2eeff5691 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -348,15 +348,15 @@ declare namespace ts { ShorthandPropertyAssignment = 300, SpreadAssignment = 301, EnumMember = 302, - UnparsedPrologue = 303, - UnparsedPrepend = 304, - UnparsedText = 305, - UnparsedInternalText = 306, - UnparsedSyntheticReference = 307, + /** @deprecated */ UnparsedPrologue = 303, + /** @deprecated */ UnparsedPrepend = 304, + /** @deprecated */ UnparsedText = 305, + /** @deprecated */ UnparsedInternalText = 306, + /** @deprecated */ UnparsedSyntheticReference = 307, SourceFile = 308, Bundle = 309, - UnparsedSource = 310, - InputFiles = 311, + /** @deprecated */ UnparsedSource = 310, + /** @deprecated */ InputFiles = 311, JSDocTypeExpression = 312, JSDocNameReference = 313, JSDocMemberName = 314, @@ -2123,9 +2123,10 @@ declare namespace ts { } interface Bundle extends Node { readonly kind: SyntaxKind.Bundle; - readonly prepends: readonly (InputFiles | UnparsedSource)[]; + /** @deprecated */ readonly prepends: readonly (InputFiles | UnparsedSource)[]; readonly sourceFiles: readonly SourceFile[]; } + /** @deprecated */ interface InputFiles extends Node { readonly kind: SyntaxKind.InputFiles; javascriptPath?: string; @@ -2137,6 +2138,7 @@ declare namespace ts { declarationMapPath?: string; declarationMapText?: string; } + /** @deprecated */ interface UnparsedSource extends Node { readonly kind: SyntaxKind.UnparsedSource; fileName: string; @@ -2152,28 +2154,35 @@ declare namespace ts { readonly syntheticReferences?: readonly UnparsedSyntheticReference[]; readonly texts: readonly UnparsedSourceText[]; } + /** @deprecated */ type UnparsedSourceText = UnparsedPrepend | UnparsedTextLike; + /** @deprecated */ type UnparsedNode = UnparsedPrologue | UnparsedSourceText | UnparsedSyntheticReference; + /** @deprecated */ interface UnparsedSection extends Node { readonly kind: SyntaxKind; readonly parent: UnparsedSource; readonly data?: string; } + /** @deprecated */ interface UnparsedPrologue extends UnparsedSection { readonly kind: SyntaxKind.UnparsedPrologue; readonly parent: UnparsedSource; readonly data: string; } + /** @deprecated */ interface UnparsedPrepend extends UnparsedSection { readonly kind: SyntaxKind.UnparsedPrepend; readonly parent: UnparsedSource; readonly data: string; readonly texts: readonly UnparsedTextLike[]; } + /** @deprecated */ interface UnparsedTextLike extends UnparsedSection { readonly kind: SyntaxKind.UnparsedText | SyntaxKind.UnparsedInternalText; readonly parent: UnparsedSource; } + /** @deprecated */ interface UnparsedSyntheticReference extends UnparsedSection { readonly kind: SyntaxKind.UnparsedSyntheticReference; readonly parent: UnparsedSource; @@ -3900,8 +3909,10 @@ declare namespace ts { updatePartiallyEmittedExpression(node: PartiallyEmittedExpression, expression: Expression): PartiallyEmittedExpression; createCommaListExpression(elements: readonly Expression[]): CommaListExpression; updateCommaListExpression(node: CommaListExpression, elements: readonly Expression[]): CommaListExpression; - createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; - updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; + createBundle(sourceFiles: readonly SourceFile[]): Bundle; + /** @deprecated*/ createBundle(sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; + updateBundle(node: Bundle, sourceFiles: readonly SourceFile[]): Bundle; + /** @deprecated*/ updateBundle(node: Bundle, sourceFiles: readonly SourceFile[], prepends?: readonly (UnparsedSource | InputFiles)[]): Bundle; createComma(left: Expression, right: Expression): BinaryExpression; createAssignment(left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression): DestructuringAssignment; createAssignment(left: Expression, right: Expression): AssignmentExpression; @@ -4607,7 +4618,9 @@ declare namespace ts { function isNonNullChain(node: Node): node is NonNullChain; function isBreakOrContinueStatement(node: Node): node is BreakOrContinueStatement; function isNamedExportBindings(node: Node): node is NamedExportBindings; + /** @deprecated */ function isUnparsedTextLike(node: Node): node is UnparsedTextLike; + /** @deprecated */ function isUnparsedNode(node: Node): node is UnparsedNode; function isJSDocPropertyLikeTag(node: Node): node is JSDocPropertyLikeTag; /** @@ -4675,11 +4688,17 @@ declare namespace ts { name: Identifier; }; function emitModuleKindIsNonNodeESM(moduleKind: ModuleKind): boolean; + /** @deprecated */ function createUnparsedSourceFile(text: string): UnparsedSource; + /** @deprecated */ function createUnparsedSourceFile(inputFile: InputFiles, type: "js" | "dts", stripInternal?: boolean): UnparsedSource; + /** @deprecated */ function createUnparsedSourceFile(text: string, mapPath: string | undefined, map: string | undefined): UnparsedSource; + /** @deprecated */ function createInputFiles(javascriptText: string, declarationText: string): InputFiles; + /** @deprecated */ function createInputFiles(javascriptText: string, declarationText: string, javascriptMapPath: string | undefined, javascriptMapText: string | undefined, declarationMapPath: string | undefined, declarationMapText: string | undefined): InputFiles; + /** @deprecated */ function createInputFiles(readFileText: (path: string) => string | undefined, javascriptPath: string, javascriptMapPath: string | undefined, declarationPath: string, declarationMapPath: string | undefined, buildInfoPath: string | undefined): InputFiles; /** * Create an external source map source file reference @@ -4913,9 +4932,11 @@ declare namespace ts { function isShorthandPropertyAssignment(node: Node): node is ShorthandPropertyAssignment; function isSpreadAssignment(node: Node): node is SpreadAssignment; function isEnumMember(node: Node): node is EnumMember; + /** @deprecated */ function isUnparsedPrepend(node: Node): node is UnparsedPrepend; function isSourceFile(node: Node): node is SourceFile; function isBundle(node: Node): node is Bundle; + /** @deprecated */ function isUnparsedSource(node: Node): node is UnparsedSource; function isJSDocTypeExpression(node: Node): node is JSDocTypeExpression; function isJSDocNameReference(node: Node): node is JSDocNameReference; @@ -5702,7 +5723,7 @@ declare namespace ts { } enum InvalidatedProjectKind { Build = 0, - UpdateBundle = 1, + /** @deprecated */ UpdateBundle = 1, UpdateOutputFileStamps = 2 } interface InvalidatedProjectBase { @@ -5734,6 +5755,7 @@ declare namespace ts { getSemanticDiagnosticsOfNextAffectedFile(cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean): AffectedFileResult; emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult | undefined; } + /** @deprecated */ interface UpdateBundleProject extends InvalidatedProjectBase { readonly kind: InvalidatedProjectKind.UpdateBundle; emit(writeFile?: WriteFileCallback, customTransformers?: CustomTransformers): EmitResult | BuildInvalidedProject | undefined;