import type { DeprecationsDetails , RegisterDeprecationsConfig , GetDeprecationsContext , } from './types' ; export class DeprecationsRegistry { private readonly deprecationContexts : RegisterDeprecationsConfig [ ] = [ ] ; public registerDeprecations = ( deprecationContext ) => { if ( typeof deprecationContext . getDeprecations !== 'function' ) { throw new Error ( `getDeprecations must be a function in registerDeprecations(context)` ) ; } this . deprecationContexts . push ( deprecationContext ) ; } ; public getDeprecations = async ( dependencies ) : Promise < Array < PromiseSettledResult < DeprecationsDetails [ ] > > > => { return await Promise . allSettled ( this . deprecationContexts . map ( async ( deprecationContext ) => await deprecationContext . getDeprecations ( dependencies ) ) ) ; } ; }