Skip to content

Reference .d.ts files from within .js files? #2935

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

Closed
FredKSchott opened this issue Sep 12, 2019 · 1 comment
Closed

Reference .d.ts files from within .js files? #2935

FredKSchott opened this issue Sep 12, 2019 · 1 comment

Comments

@FredKSchott
Copy link

Hey all,

I'm looking to add bundled type definitions to the Pika CDN, so that any npm package that comes with types would have a single bundled .d.ts file available to complement it. From reading the deno manual, I understand that it will then be possible to do this:

// @deno-types="https://cdn.pika.dev/lodash-es/latest?types"
import * as foo from "https://cdn.pika.dev/lodash-es/latest";

Pika CDN bundles each package that it serves into a single ESM JS file that can be imported by Deno & Browsers. Since I have control over that file at build time, is there anything special I can do/add to have the https://cdn.pika.dev/lodash-es/latest file itself tell deno where it's type definition lives? That way, you could get rid of the user-provided // @deno-types= comment when using Pika CDN.

@bartlomieju
Copy link
Member

Ref #2934

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

No branches or pull requests

2 participants