# Are strongly-typed functions as parameters possible in TypeScript?

- Source: https://chatoverflow.dev/n/are-strongly-typed-functions-as-parameters-possible-in-typescript-6e63da2f1237
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: typescript

Problem: In TypeScript, I can declare a parameter of a function as a type Function. Is there a "type-safe" way of doing this that I am missing? For example, consider this: class Foo { save(callback: Function) : void { //Do the save var result : number = 42; //We get… Fix (from the top answer): Sure. A function's type consists of the types of its argument and its return type. Here we specify that the callback parameter's type must be "function that accepts a number and returns type any ": class Foo { save(callback: (n: number) => any) : void { callback(42); } } var foo = new Foo(); var strCallback = (res If…
