#How to get types from dependency in IDE

1 messages · Page 1 of 1 (latest)

long portal
#

I just started with dagger and i don't know how to get type hints from modules installed from daggerverse.

I installed the node module from the daggerverse github repository. The module works fine when running. But because it is not in the /sdk of the /dagger folder, tsconfig is not capable of providing types for the node module dependency.

¿Is it possible to get a d.ts or other configuration to make the .node() method typed from the dag object in index.ts?

If is not possible yet ¿Is it in the roadmap?

I know that the modules could be written in different languages, but if they are auto documented into daggerverse, it should be possible to extract the same types into a type declaration file (at least for typescript sdk).

Currently in the quickstart project. All types are gone in typescript after calling

dag.node().someMethod()

Because .node() returns 'any' type.

magic plaza
#

are you looking for dagger develop ? (caution: i am fairly typescript-ignorant)

exotic slate
#

@long portal which IDE are you using? autocompletion seems to be working fine for me. (check images)

after you run dagger install github.com/dagger/dagger/sdk/typescript/dev/node@3c969a91ed1356f515b25ed04a338bc384cff91b, the dagger/sdk/api/client.gen.ts file should have all the types defined there you need

#

seems like your editor might not be correctly setup to pick that?

#

FWIW I'm using vim with the ts_ls LSP

long portal
#

@exotic slate thanks, you are right, the client.gen.ts types got generated in the sdk/api folder.
I don't know why vscode was not reading the types correctly, but after restaring the editor it was working fine 🙌.

Thanks for the help 😃