I might be missing something obvious, but when trying to define a route handler in a separate file, it's not possible in Typescript at the moment as the types aren't exported.
import { RouterHandler } from '@tsndr/cloudflare-worker-router'
I get a type not found error. When I look at the d.ts file I can see all the types, but none of them are exported from there.. I think that might be the issue.
I might be missing something obvious, but when trying to define a route handler in a separate file, it's not possible in Typescript at the moment as the types aren't exported.
I'm trying to do this:
But unfortunately, when doing:
I get a type not found error. When I look at the d.ts file I can see all the types, but none of them are exported from there.. I think that might be the issue.
When I change it from this:
To this:
It works, but I'm not sure that's how you're actually supposed to do it! You would have thought anything in d.ts would be 'public' and importable