given a type like:
type SomeFunctionType = (arg: string) => string
it it possible to apply this type to a function within an object inline? Basically apply the type SomeFunction to someFunction below.
const someObject = {
someFunction: (arg) => arg
}
The only ways I've found is either to have the function outside the object:
const someFunction: SomeFunctionType = (arg) => arg
const someObject = {
someFunction
}
or to type the object:
const someObject: { someFunction: SomeFunctionType } = {
someFunction: (arg) => arg
}
but it feels like there should be a shorter way.