[xpcom] Add a helper interface to carry type information for conversion methods