1. function takes input as function index.tsexport type MutateFunction = (v: number) => numberconst arrayMutate = (numbers: number[], mutate: MutateFunction) => { return numbers.map(mutate)} // On other file we import `MutateFunction` typeconst myMutateFunction: MutateFunction = (v: number) => v*10console.log(arrayMutate([2,3,4], myMutateFunction)) 2. function returns as function index.tsexport type AdderFunction = (val: number) => numberconst createAdder = (num: number): AdderFunction => { return (val: number) => num + val} // On other file we import `AdderFunction` typeconst addTwo: AdderFunction = createAdder(2)console.log(addTwo(5))console.log(addTwo(10))