NoA IgniteAccelerator Docs
Contact ↗
GitHubGitHub
  • Get Started
    • README
      • README
      • README
        • Events
      • README
      • Context
      • PaymentEmbed
      • README
        • createGetCentraWebhookEvents
      • README
      • createRenderBlock
      • createRequiredContext
      • createSvgIcon
      • getReactElementRef
      • isRefObject
      • setRef
      • useElementSize
      • useFocusReturn
      • useForkRef
      • useInert
      • useIntersectionObserver
      • useInterval
      • useIsomorphicEffect
      • useMediaQuery
      • useMutationObserver
      • useRTL
      • useResizeObserver
      • useSticky
      • useTimeout
      • useVisualViewport
      • useWindowSize
      • README
      • typography
      • AnyFunction
      • Concatenate
      • DistributiveOmit
      • Entries
      • HintedNumber
      • HintedString
      • KeyOfAny
      • Keys
      • MapKeys
      • Maybe
      • OverridableStringUnion
      • Overwrite
      • Prettify
      • PropsFrom
      • README
      • Repeat
      • Split
      • WithFallback
      • Writeable
      • README
      • URLSearchParamsFromObject
      • assert
      • calculateContrast
      • calculateLuminance
      • capitalize
      • chunk
      • clamp
      • colorContrast
      • deepmerge
      • hexToRGB
      • isObject
      • isPlainObject
      • lerp
      • mapRange
      • normalize
      • normalizeToArray
      • objectFromURLSearchParams
      • omit
      • pick
      • random
      • range
      • sleep

On This Page

  • Keys
  • Example
Question? Give us feedback →
@noaignitetypesKeys

Keys

A type helper that returns an array of keys for the properties of a given object type T. Useful in conjunction with Object.keys when one needs to preserve the types of the keys.

Example

const breakpoints = {
  xs: 500,
  md: 1000,
}
 
const keys = Object.keys(breakpoints) as Keys<typeof breakpoints>
 
for (const key of keys) {
  console.log(key) // Typed as: "xs" | "md"
}
KeyOfAnyMapKeys

Accelerator Docs