so apparently (i'm beginner) ts doesn't support static methods in the interface however there is a workaround explained it Val's answer. it works when your class has only static methods. but if my class is a combination of static and non-satic methods this will throw an error:
Class 'MyClass' incorrectly implements interface 'sampleInterface'.
Property 'staticFunction' is missing in type 'MyClass' but required in type 'sampleInterface'
any idea how to support this?
export function staticDecorator<T>() {
return (constructor: T) => {};
}
interface sampleInterface {
staticFynction(/*something*/): promise<void>;
nonStaticFynction(/*something*/): promise<void>;
}
@staticDecorator()
class MyClass implements sampleInterface {
public static staticFynction(/*something*/): promise<void>{
//something
}
public nonStaticFynction(/*something*/): promise<void>{
//something
}
}