I have two types in TypeScript:
type PublicMethods = 'Time' | 'Assets' | 'AssetPairs' ;
type PrivateMethods = 'Balance' | 'TradeBalance';
I would like to use the same api
function to handle these types, but the behaviour is different for each. Something along the lines of:
public api = (method: PublicMethods | PrivateMethods, params: any) => {
// ...how do I create a type guard here?
if(method instanceof PublicMethods) { //