I have a utility class containing various static methods:
export default class MyHelper {
private constructor() {}
private static privateMethod() {}
public static publicHelperMethod() {}
}
In my React component, I am using the publicHelperMethod and need to ensure that it is included in my props declaration.
I initially tried this approach:
type LoggerMethod = MyHelper.publicHelperMethod;
However, this resulted in an error stating that MyHelper is being used as a namespace.
As an alternative, I can define the entire class as a type:
type Helper = MyHelper;
Yet, my focus is solely on the logger method (the public helper within this abstraction).
Is there a way to designate a method within a class as a type? If so, what would be the correct syntax?
Or perhaps there is a different approach I should be considering?