import type * as d from '../../declarations' ; param doc param cmps returns export const getUsedComponents = ( doc , cmps ) : string [ ] => { const tags = new Set ( cmps . map ( ( cmp ) => cmp . tagName . toUpperCase ( ) ) ) ; const found = [ ] ; const searchComponents = ( el ) => { if ( tags . has ( el . tagName ) ) { found . push ( el . tagName . toLowerCase ( ) ) ; } for ( let i = 0 ; i < el . childElementCount ; i ++ ) { searchComponents ( el . children [ i ] ) ; } } ; searchComponents ( doc . documentElement ) ; return found ; } ;