Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 424 Bytes

function-keys.md

File metadata and controls

24 lines (17 loc) · 424 Bytes
category
Get Object Keys

FunctionKeys

Get union type of keys that are functions in object type T.

Usage

import type { FunctionKeys } from '@utype/core'

type Props = {
  name: string;
  setName: (name: string) => void;
  getName: () => string;
}

// Expect: 'setName' | 'getName' // [!code highlight]
type FunctionKeysProps = FunctionKeys<Props>