#npm specifier import types

13 messages · Page 1 of 1 (latest)

near dust
#

so when I do something like

import * as rx from 'npm:rxjs'

console.log(rx)

I do have the correct code imported, but types are all any. Is this the expected state of npm imports, or is there a bug here? I am running

deno 1.26.1 (release, x86_64-unknown-linux-gnu)
v8 10.7.193.3
typescript 4.8.3
agile frost
#

document says that typescript is not in the current release of npm compatibility but is expected to be in the next one

#

can take the type files from

near dust
#

thanks for that clarification

spice sage
#

@final garnet is working on types support, it will probably ship in V1.27

near dust
#

@spice sage / @final garnet are npm types supported in 1.28? It seems like they are https://github.com/denoland/deno/issues/15960, but imports like

import * as rx from 'npm:rxjs'

or

import { ScriptServer } from 'npm:@scriptserver/core'

seem to still have any types

final garnet
#

if you get a chance could you open a bug (i'm just heading out)? It looks like rxjs has an entry for "types": "index.d.ts",, but then that file doesn't exist in the package, so it looks like in that scenario we should use the exports -> . -> types entry

#

for @scriptserver/core it distributes its types, but then it doesn't have a "types" entry in its package.json, but it seems like typescript still figures it out by resolving the "main" entrypoint and looking for the corresponding declaration file

near dust
#

sure! Sorry for asking questions right before thanksgiving 😅. Ill make an issue

final garnet
#

no, it's ok. I'm in Canada so we already celebrated last month 🙂