Skip to content
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

Typescript Support? #29

Open
inferrinizzard opened this issue Jul 25, 2020 · 5 comments
Open

Typescript Support? #29

inferrinizzard opened this issue Jul 25, 2020 · 5 comments

Comments

@inferrinizzard
Copy link

Would like to use this in .ts and .tsx files but the loader does not generate typings for compatibility.
Maybe get in touch with DefinitelyTyped to get some help on support?

@eemeli
Copy link
Owner

eemeli commented Jul 27, 2020

How did you envision that this would work?

TypeScript does not provide a plugin support for custom types (microsoft/TypeScript#10939), so you're probably either asking for a process that would generate a custom foo.yaml.d.ts file as a side product of the build, or then you're really looking for a generic ambient module definition. The latter's easy, for the former it would be best to package it as a separate library.

@lenaschimmel
Copy link

Note: If you came here for a solution and a generic ambient module definition is not easy for you, here's an example. (the last part of that answer refers to yaml-ts-loader, ignore it if you are using yaml-loader.)

@kaminion
Copy link

kaminion commented Mar 1, 2022

Do not define generic ambient module for every time,
I'm make that module for yaml of typescript
If you need a detail declare, you should use to another module Or add to type declares
but, It's possible Immediately type-check and make prototype

You can refer below link
https://www.npmjs.com/package/types-generic-yaml

I want @eemeli Opinion.

@kaminion
Copy link

kaminion commented Mar 3, 2022

@eemeli It better to replace this module with PR?

@await-ovo
Copy link

I have build a simple plugin that can provides type information to IDEs , but cannot generate type files:

image

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

5 participants