Let's suppose I have declared a type containing defining a specific type of function
type Callback = (err: Error | null, result: any)
type UselessFunction = (event: string, context: any, callback: Callback) => void
I would like to declare functions that must comply to the type UselessFunction
I only found in the documentation how to assign a type to a function using arrow syntax
const someFunction: UselessFunction = (evt, ctx, cb) => {}
How can a type be assigned be function declaration? I cannot find the syntax in the docs
function someFunction (event, context, cb) {
}
someFunction, it should gain the typeUselessFunctionwhere necessary by duck typing