Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTypescript declaration files status #637
Comments
This comment has been minimized.
This comment has been minimized.
can you describe your use case here? the original motivation is typescript requires user to have .d.ts file to get it working, so generating .d.ts will make typescript happy. We can improve the .d.ts here (at least for primitive type), but the benefit is not clear |
This comment has been minimized.
This comment has been minimized.
I'm looking for our current pain points to try using BS/Reason in our typescript backend, and typescript doesn't have run time type checking. My idea is to have a type checker using a json decoder, so if I have: { "id": 1, "name": "foo"} I would create a decoder in Ocaml with a .d.ts something like this: type IdName = {
id: number,
name: string
}
export var id_name_checker: (json: string) => IdName It's just an idea, maybe not a good one, and I can find another place where I can get BS in my code base. Btw thanks for this project |
paparga
closed this
Aug 13, 2016
bobzhang
reopened this
Aug 27, 2016
This comment has been minimized.
This comment has been minimized.
@chenglou Reopened this issue is for tracking generate .t.ds files for Flow. To make it sound, we have to use |
bobzhang
referenced this issue
Aug 27, 2016
Closed
Ideas: allow users to use GADT for typing externals #686
This comment has been minimized.
This comment has been minimized.
Is this something that will be improved upon? It would be nice if the .t.ds files have better types. If I want to use bucklescript generated code in typescript, I'm back to adding the types myself, while they are already known... |
paparga commentedAug 12, 2016
Hi!
I've been playing with the compiler using -bs-gen-tds, for
currently I get
It is planned to improve the types anytime soon?
Thanks!
Pablo