Edge Runtime logoEdge Runtime
GitHubGitHub (opens in a new tab)
  • Introduction
  • Getting Started
  • Command-line Interface
  • Features
    • Edge Runtime APIs
    • Polyfills
    • TypeScript support
    • Upgrading Nextjs
  • Packages
    • @edge-runtime/cookies
    • @edge-runtime/feature-detector
    • @edge-runtime/format
    • @edge-runtime/jest-environment
    • @edge-runtime/jest-expect
    • @edge-runtime/node-utils
    • @edge-runtime/ponyfill
    • @edge-runtime/primitives
    • edge-runtime
    • @edge-runtime/types
    • @edge-runtime/user-agent
    • @edge-runtime/vm
  • Changelog (opens in a new tab)
  • Introduction
  • Getting Started
  • Command-line Interface
  • Features
    • Edge Runtime APIs
    • Polyfills
    • TypeScript support
    • Upgrading Nextjs
  • Packages
    • @edge-runtime/cookies
    • @edge-runtime/feature-detector
    • @edge-runtime/format
    • @edge-runtime/jest-environment
    • @edge-runtime/jest-expect
    • @edge-runtime/node-utils
    • @edge-runtime/ponyfill
    • @edge-runtime/primitives
    • edge-runtime
    • @edge-runtime/types
    • @edge-runtime/user-agent
    • @edge-runtime/vm
  • Changelog (opens in a new tab)
Question? Give us feedback → (opens in a new tab)Edit this page on GitHub
Features
TypeScript support

TypeScript support

The Edge Runtime includes TypeScript types. In fact, the library is written in TypeScript!

Just in case you need to have these types loaded as part of the global context, you can add them inside tsconfig.json (opens in a new tab):

{
  "compilerOptions": {
    "types": ["@edge-runtime/types"]
  }
}

Alternatively, you can load them using triple-slash directive (opens in a new tab) as well:

/// <reference types="@edge-runtime/types" />
PolyfillsUpgrading Nextjs