You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "Types and Type Declarations" page has a section called "Providing types when importing". That section uses the following example:
// @deno-types="./coolLib.d.ts"
What about when you don't have the *.d.ts file locally though? For example, suppose you want to reference a remote file, or use an npm specifier? Is that possible? If so, I think the docs should describe how and give an example. If not, I think the docs should 1) say so and 2) recommend a workaround.
I tried the following without success:
// @deno-types="npm:@types/react"
import React, { useState } from "react";
The "Types and Type Declarations" page has a section called "Providing types when importing". That section uses the following example:
What about when you don't have the
*.d.ts
file locally though? For example, suppose you want to reference a remote file, or use an npm specifier? Is that possible? If so, I think the docs should describe how and give an example. If not, I think the docs should 1) say so and 2) recommend a workaround.I tried the following without success:
But if I use:
instead of:
I get the types and don't need to use
@deno-types
(see Discord).The text was updated successfully, but these errors were encountered: