Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example with jsdoc #40

Open
jantimon opened this issue Nov 20, 2020 · 1 comment
Open

Add example with jsdoc #40

jantimon opened this issue Nov 20, 2020 · 1 comment

Comments

@jantimon
Copy link

jantimon commented Nov 20, 2020

It is possible to get full IDE support without setting up any transpilers.
Typescript supports .js files if they add the /// @ts-check comment and use JSDoc.

Maybe the following example would be a good reference for fast typesafe implementation without bundling/transpiling:

npm install --save-dev @types/akamai-edgeworkers
/// @ts-check
/// <reference types="akamai-edgeworkers" />

/**
 * @param {EW.ImmutableRequest & EW.HasRespondWith} request 
 * @param {EW.Response} response 
 */
export function onClientRequest(
  request,
  response
) {
  request.respondWith(
    200,
    {},
    "<html><body><h1>Hello World From Akamai EdgeWorkers</h1></body></html>"
  );
}

edge

@dctheobald
Copy link
Contributor

Hi @jantimon - sorry for the lag here. I'll look into this and get back with you. Seems like a logical suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants