namespace ts . refactor { const refactors = new Map < string , Refactor > ( ) ; param name export function registerRefactor ( name , refactor ) { refactors . set ( name , refactor ) ; } export function getApplicableRefactors ( context ) { return arrayFrom ( flatMapIterator ( refactors . values ( ) , refactor => context . cancellationToken && context . cancellationToken . isCancellationRequested ( ) || ! refactor . kinds ?. some ( kind => refactorKindBeginsWith ( kind , context . kind ) ) ? undefined : refactor . getAvailableActions ( context ) ) ) ; } export function getEditsForRefactor ( context , refactorName , actionName ) { const refactor = refactors . get ( refactorName ) ; return refactor && refactor . getEditsForAction ( context , actionName ) ; } }