Imagine a scenario where a specific type of function is declared within a type
type Callback = (err: Error | null, result: any)
type UselessFunction = (event: string, context: any, callback: Callback) => void
The objective is to declare functions that adhere to the UselessFunction
type
The documentation only provides information on how to assign a type to a function using arrow syntax
const someFunction: UselessFunction = (evt, ctx, cb) => {}
Is there a way to assign a type to a function declaration? The syntax is not clear in the documentation
function someFunction (event, context, cb) {
}