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

TsType of properties should be intelligent #160

Closed
andreespirela opened this issue Sep 9, 2021 · 2 comments
Closed

TsType of properties should be intelligent #160

andreespirela opened this issue Sep 9, 2021 · 2 comments

Comments

@andreespirela
Copy link

Right now, if a property doesn't explicitly specify a type ex: ```const var: Type = ..., deno_doc` doesn't populate the `tsType` field for it.

Sometimes, type is not needed as it can be guessed by the IDE and the typescript compiler as well

const type = "it's a string";

in that scenario, it's known that the default type of that variable is string, thus tsType should use such.

@kitsonk
Copy link
Contributor

kitsonk commented Sep 9, 2021

This is really broad issue, and would be hard to tackle as a whole.

Actually your example works already:

export const a = "a";

Will get you a variable named a with a type of "a". The tests for it are here: https://github.com/denoland/deno_doc/blob/main/src/tests.rs#L1317

Non-simple types are not currently supported. I was going to open up some issues to infer types for specific structures. There is already a request at #92 for object literals.

So my opinion is that this issue is to broad and unactionable.

@kitsonk
Copy link
Contributor

kitsonk commented Sep 11, 2021

As mentioned, I have opened up other issues that are more narrow with specific cases we can try to tackle. I am going to close this in lieu of those other issues.

@kitsonk kitsonk closed this as completed Sep 11, 2021
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