type DeprecationPayload = Partial < { suggest : string ; doc : string ; } > ; export const deprecationWarning = ( name , payload ? ) => { let message = `Deprecation warning: ${ name } will be deprecated in future relases.` ; const { suggest , doc } = payload ; if ( suggest ) { message += ` Please use ${ suggest } instead.` ; } if ( doc ) { message += `(${ doc })` ; } console . warn ( message ) ; } ;