question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Export Request and Obj types?

See original GitHub issue

Hi,

We LOVE itty! Would it be possible to export your types from your .d.ts file? We often do handlers in separate handler files and we’d love to be able to do things like this:

import { Request as IttyRequest } from 'itty-router';
...
async buildSomeResponse(req: IttyRequest): Promise<Response> { ... }

VSCode in particular gets confused with the type of the Request arg, and barking about req.query not existing in an example like the above.

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kwhitleycommented, Aug 9, 2021
0reactions
kwhitleycommented, Aug 10, 2021

Should be exported as of 2.4

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get the export object definition from an integrator.io REST API ...
This tutorial sends a GET request to the integrator.io REST API for an example export created in the user interface, in order to...
Read more >
export - JavaScript - MDN Web Docs
Every module can have two different types of export, named export and default export. You can have multiple named exports per module but ......
Read more >
Exporting object definitions, views, and applications
To export object definitions. In BMC Remedy Developer Studio select File > Export. Export wizard (Click the image to expand it.)
Read more >
Declaration file: Export both object and types with same the ...
I'm trying to add types to an existing JS library. I'm typing the library by creating .d.ts files to align with each .js...
Read more >
Exporting Objects - Software AG Documentation
Field/Option Description Description Passwords selected Export passwords. Passwords not selected Do not export passwords. with Schedules selected Export schedules (default).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found