How can I efficiently organize and maintain the function's arguments below without utilizing Typescript? Can this be achieved using Interfaces?
// external file
export interface TSomeFunctionArgs {
someKey: string
// there should also be a type for a function here
}
// main file
import { TSomeFunctionArgs } from "pathToFile"
const someFunction = (args: TSomeFunctionArgs) => {
// ... function's logic
}
someFunction({ someKey: "some string" }, someAnotherFunction)
In this scenario, I am passing two arguments - an object with a specific key-value pair as the first argument, and any function as the second argument.
Is there a way to accurately describe this setup in the Interface defined above?