TypeScript

An official TypeScript binding for the EdgeWorkers JavaScript API is available to help you design your EdgeWorkers functions.

TypeScript supports these features to help write, maintain, and refactor your JavaScript code:

  • Autocomplete functions within the supported integrated development environments (IDE) for the EdgeWorkers JavaScript object model.

  • Lint code analysis.

  • A TypeScript compiler to find problems before activating your EdgeWorker version.

For more information about TypeScript go to the language's homepage or you can learn more by reading this introductory blog.

You can review the review the steps to install typescript dependencies in the tutorial.

  1. Enter this command to install the DefinitelyTyped definition for the EdgeWorkers API inside an existing TypeScript project:
$ npm install @types/akamai-edgeworkers
  1. The node_packages/@types/akamai-edgeworkers directory contains the type bindings. Set your tsconfig.json file to use ES2015 as the compilation target and module code generator:
{
    "compilerOptions": {
    "module": "es2015",
    "target": "ES2015",
        //...
    }
}

Did this page help you?