Closed KnorpelSenf closed 3 years ago
@trgwii @wojpawlik please have a look at this
This is very cool! As long as it's somewhat easy to verify that it doesn't break this should be perfect (maybe just deno run --reload deno/index.d.ts
as part of some test script is enough?)
I see that point.
We don't want to download all the types upon npm install
, then everyone would get the types twice. How would we work around that?
Haven't found any elegant workaround. You could publish these somewhere else (extra complexity). You could also use import specifiers with extensions, and generate *.d.ts.ts
or *.d.ts.d.ts
files for Node :P
I'd advise you to wait until we'll be porting Telegraf to Deno. stream
is already polyfilled in Deno, but http
and https
aren't, so this would require moving all webhook logic to a separate file and providing a Deno reimplementaion.
https://cdn.skypack.dev/typegram@3?dts sets x-typescript-types
header for Deno. Trying to use it results in
error: TS2304 [ERROR]: Cannot find name 'Location'.
location: Location;
~~~~~~~~
at https://cdn.skypack.dev/-/typegram@v3.1.1-GjjXhW5hOQqkCsqEA1pP/dist=es2020,mode=types/manage.d.ts:258:13
So all you need to do is fix that (and ensure anything similar won't happen again) and explain Deno support in README.
URL imports are great!
That sounds good.
It does not look like I will need to use Deno myself in the near future, so I'd rather avoid spending time fiddling around with deno-specific configuration.
Please open a new PR that solves this problem if it is still relevant to you.
In case anyone finds this by now and looks for a Deno read bot framework: I used typegram as a base for building https://deno.land/x/grammy
Adds a quick and dirty script to derive deno-compliant TypeScript files from the current declaration files.