Skip to main content

Fn

함수의 타입을 정의합니다.

Signature

type Fn<P extends any[] = any[], R = any> = (...params: P) => R;

Example

// 함수의 타입 정의
type AddFn = Fn<[x: number, y: number], number>;

// 함수의 사용 예시
const add: AddFn = (x, y) => x + y;