Skip to main content
Module

x/ts_toolbelt_unofficial/mod.ts>F.Parameters

👷 TypeScript's largest type utility library, now on Deno
Latest
type alias F.Parameters
import { type F } from "https://deno.land/x/ts_toolbelt_unofficial@1.1.0/mod.ts";
const { Parameters } = F;

Extract parameters from a [[Function]]

Examples

Example 1

import {F} from 'ts-toolbelt.ts'

const fn = (name: string, age: number) => {}

type test0 = F.ParamsOf<typeof fn>                         // [string, number]

type test1 = F.ParamsOf<(name: string, age: number) => {}> // [string, number]
definition: F extends ((...args: infer L) => any) ? L : never