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.
You can review the steps to install typescript dependencies in the development environment tutorial.
- Enter this command to install the
DefinitelyTyped
definition for the EdgeWorkers API inside an existing TypeScript project:
$ npm install @types/akamai-edgeworkers
- The
node_packages/@types/akamai-edgeworkers
directory contains the type bindings. Set yourtsconfig.json
file to usees2022
as the compilation target and module code generator:
{
"compilerOptions": {
"module": "es2022",
"target": "es2022",
//...
}
}
Updated over 1 year ago