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 = (result: string) : void => {
    alert(result);
}
var numCallback = (result: number) : void => {
    alert(result.toString());
}

foo.save(strCallback); // not OK
foo.save(numCallback); // OK

If you want, you can define a type alias to encapsulate this:

type NumberCallback = (n: number) => any;

class Foo {
    // Equivalent
    save(callback: NumberCallback) : void {
        callback(42);
    }
}
Answer from Ryan Cavanaugh on Stack Overflow
🌐
TypeScript
typescriptlang.org › docs › handbook › 2 › functions.html
TypeScript: Documentation - More on Functions
They’re also values, and just like other values, TypeScript has many ways to describe how functions can be called. Let’s learn about how to write types that describe functions. The simplest way to describe a function is with a function type expression. These types are syntactically similar ...
Discussions

How to get argument types from function in Typescript - Stack Overflow
I may have missed something in the docs, but I can't find any way in typescript to get the types of the parameters in a function. That is, I've got a function function test(a: string, b: number) ... More on stackoverflow.com
🌐 stackoverflow.com
Is it a good practice to assign types to function parameters?
is it a good practice to assign types to parameters This is basically the main reason to use typescript More on reddit.com
🌐 r/typescript
30
14
March 25, 2022
Typing one functions params with the type of another function's params?
This is also an option: const a = (foo: string, bar: number) => { return foo + bar } const b: typeof a = (foo, bar) => { return foo + bar } Playground More on reddit.com
🌐 r/typescript
23
14
July 17, 2022
How to make generic function such that parameter types match
i would create a function overload instead of generics for this case. More on reddit.com
🌐 r/typescript
10
1
September 8, 2023
🌐
LogRocket
blog.logrocket.com › home › how to pass a typescript function as a parameter
How to pass a TypeScript function as a parameter - LogRocket Blog
May 15, 2025 - The type keyword in TypeScript ... AddOperator using the type keyword. It represents a function type that takes two parameters (a and b) of type number and returns a value of type number....
🌐
W3Schools
w3schools.com › typescript › typescript_functions.php
TypeScript Functions
function multiply(a: number, b: number) { return a * b; } Try it Yourself » · If no parameter type is defined, TypeScript will default to using any, unless additional type information is available as shown in the Default Parameters and Type Alias sections below.
🌐
Execute Program
executeprogram.com › courses › everyday-typescript › lessons › returntype-and-parameters
Everyday TypeScript: ReturnType and Parameters
Use the Parameters generic type to get the function type's parameter type, using it as the type for the args variable. (You don't need to modify any of the existing code; you only need to add the missing type.)
🌐
TypeScript Tutorial
typescripttutorial.net › home › typescript tutorial › typescript function types
TypeScript Function Types
July 10, 2024 - When declaring a function type, you need to specify both parts with the following syntax: (parameter: type, parameter:type,...) => typeCode language: PHP (php)
Find elsewhere
🌐
Convex
convex.dev › core concepts › functions & methods › function types
Function Types | TypeScript Guide by Convex
Function types define exactly how functions should behave by specifying parameter types and return values. When building backend services with Convex, proper function typing ensures type safety across your entire application.
🌐
Medium
medium.com › @bobjunior542 › how-to-use-the-utility-type-parameters-type-in-typescript-c9384c64b13f
How to Use the Utility Type Parameters<Type> in TypeScript | by Bob Junior | Medium
April 29, 2023 - It takes a function type as its parameter and returns a tuple type containing the types of the function's parameters. Here is the syntax of the Parameters<Type> utility type: type Parameters<Type extends (...args: any) => any> = Type extends ...
🌐
HackerNoon
hackernoon.com › a-guide-on-how-typescript-parameters-type-works
A Guide on How TypeScript Parameters Type Works | HackerNoon
May 3, 2022 - The TypeScript Parameters Type is used to take the parameters or arguments of a function, and create a new type based on them.
🌐
Allthingstypescript
allthingstypescript.dev › all things typescript › looking up the input and output types of a function using the parameters & returntype utility types
Looking up the Input and Output Types of a Function using the Parameters & ReturnType Utility Types
June 5, 2023 - Remember, in Javascript and by extension Typescript, functions are first-class citizens and can be passed around just like any other variable and we need a way to add type annotations to them. In such a case, such as when we are dealing with the function type and not variable, we can drop the typeof operator. type Calculate = (height: number, width: number) => { parameter: number; area: number; }; type SquareReturnType = ReturnType<Calculate>
🌐
TypeScript
typescriptlang.org › docs › handbook › 2 › generics.html
TypeScript: Documentation - Generics
You can read the type of loggingIdentity as “the generic function loggingIdentity takes a type parameter Type, and an argument arg which is an array of Types, and returns an array of Types.” If we passed in an array of numbers, we’d get an array of numbers back out, as Type would bind to number.
🌐
Fjolt
fjolt.com › article › typescript-parameters-utility-type
How the TypeScript Parameters Type Works
April 27, 2022 - The TypeScript Parameters Type is used take the parameters or arguments of a function and create a new type based off them. It is quite useful when we know that the input of a Function conforms to a certain type, and we want to replicate that.
🌐
Medium
medium.com › @AlexanderObregon › typescript-function-parameters-that-depend-on-each-other-a04eea002aeb
TypeScript Function Parameters That Depend on Each Other
July 27, 2025 - Generics are what make this linking possible in the first place. Once you define a type variable like <T>, you can reuse it across parameters, constraints, and return types. That’s what lets TypeScript connect parts of a function together.
🌐
DhiWise
dhiwise.com › post › in-depth-look-at-typescript-function-types-best-practices
TypeScript Function Type: Guide and Best Practices
August 27, 2025 - While I was already familiar with ... · A function type represents how a function should be called. It includes the parameter list and the return type....
🌐
Stack Abuse
stackabuse.com › bytes › passing-functions-as-parameters-in-typescript
Passing Functions as Parameters in TypeScript
August 20, 2023 - Here, the type of the fn parameter in the processGreeting function is inferred to be the same as the type of the greet function using the typeof keyword. In this Byte, we showed how to pass functions as parameters in TypeScript, how to use type aliasing for functions, and how to infer function types with the typeof keyword.
🌐
Dmitri Pavlutin
dmitripavlutin.com › typescript-function-type
TypeScript Function Types: A Beginner's Guide - Dmitri Pavlutin
March 28, 2023 - ... ObjectWithMethod is an object type having a method sum(). The first and second parameter types (a: number, b: number) are numbers, and the return type : number is also a number.
🌐
Medium
umarfarooquekhan.medium.com › what-is-generic-type-parameter-to-the-function-in-typescript-917770037a87
what is Generic Type Parameter to the Function in typescript | by Umar Farooque Khan | Medium
July 4, 2023 - By using a generic type parameter, we can pass arguments of different types to the identity function while preserving the type safety. In the example, we explicitly specify the type argument as number for the first call, and for the second call, ...