Finds the type from the given types that has the best match with the given preferences, based on the calculated weight.
Types for which we want to find the best match.
Preferences to match the types against.
A ValuePreference containing the best match and the corresponding weight. Undefined if there is no match.
Finds the type from the given types that has the best match with the given preferences, based on the calculated weight.