I'm trying declare a function type and then use that in a class, and in objects, and interfaces like this:
declare function IUpdateMode(mode: Mode): void;
Then I want to use it like this:
type Foo = {
updateMode: IUpdateMode
}
class Foo extends React.Component<any> {
updateRedMode(mode): IUpdateMode {}
}
function updateGreenMode(mode): IUpdateMode {
}
Is this possible in typescript?