@@ -268,61 +268,6 @@ function prunePrivateImports<
268268 }
269269}
270270
271- /**
272- * Iterates over the provided symbols and returns named declarations for these
273- * symbols if they are missing from `currentClass`. This allows us to merge
274- * class hierarchies for classes whose inherited types are not part of the
275- * public API.
276- *
277- * This method relies on a private API in TypeScript's `codefix` package.
278- */
279- function convertPropertiesForEnclosingClass (
280- program : ts . Program ,
281- host : ts . CompilerHost ,
282- sourceFile : ts . SourceFile ,
283- parentClassSymbols : ts . Symbol [ ] ,
284- currentClass : ts . ClassDeclaration
285- ) : ts . ClassElement [ ] {
286- const newMembers : ts . ClassElement [ ] = [ ] ;
287- // The `codefix` package is not public but it does exactly what we want. It's
288- // the same package that is used by VSCode to fill in missing members, which
289- // is what we are using it for in this script. `codefix` handles missing
290- // properties, methods and correctly deduces generics.
291- // eslint-disable-next-line @typescript-eslint/no-explicit-any
292- ( ts as any ) . codefix . createMissingMemberNodes (
293- currentClass ,
294- parentClassSymbols ,
295- sourceFile ,
296- { program, host } ,
297- /* userPreferences= */ { } ,
298- /* importAdder= */ undefined ,
299- ( missingMember : ts . ClassElement ) => {
300- const originalSymbol = parentClassSymbols . find (
301- symbol =>
302- symbol . escapedName ==
303- ( missingMember . name as ts . Identifier ) . escapedText
304- ) ;
305- if ( originalSymbol ) {
306- const jsDocComment = extractJSDocComment ( originalSymbol , newMembers ) ;
307- if ( jsDocComment ) {
308- ts . setSyntheticLeadingComments ( missingMember , [
309- {
310- kind : ts . SyntaxKind . MultiLineCommentTrivia ,
311- text : `*\n${ jsDocComment } \n` ,
312- hasTrailingNewLine : true ,
313- pos : - 1 ,
314- end : - 1
315- }
316- ] ) ;
317- }
318-
319- newMembers . push ( missingMember ) ;
320- }
321- }
322- ) ;
323- return newMembers ;
324- }
325-
326271/**
327272 * Iterates over the provided symbols and returns named declarations for these
328273 * symbols if they are missing from `currentInterface`. This allows us to merge
0 commit comments