Skip to content
This repository has been archived by the owner on Jul 20, 2020. It is now read-only.

Auto-generating descriptors from @types/three .d.ts files? #36

Open
johnrees opened this issue Oct 25, 2017 · 6 comments
Open

Auto-generating descriptors from @types/three .d.ts files? #36

johnrees opened this issue Oct 25, 2017 · 6 comments

Comments

@johnrees
Copy link
Contributor

johnrees commented Oct 25, 2017

I think you might be able to generate descriptors (or anything really) by walking the AST of the @types/three .d.ts files. They'll probably still need extra 'human work' but maybe it could be a good starting point?

This is an extremely fragile proof of concept that can quickly spit out files like https://github.com/johnrees/three-parser/blob/master/descriptors/geometries/sphereGeometry.ts. Its current major shortcomings are -

  • it doesn't yet recursively look for parent classes or shared interfaces etc
  • I'm cheating by using a static template rather than generating proper Typescript with the Typescript compiler

What do you think @toxicFork? Would it be useful if I worked on this?

@johnrees
Copy link
Contributor Author

I also had a very quick look at extracting properties from the docs html, but there are some inconsistencies because they're manually curated https://github.com/johnrees/three-docs-parser/blob/master/index.js

@toxicFork
Copy link
Collaborator

toxicFork commented Oct 25, 2017 via email

@toxicFork
Copy link
Collaborator

And yes it'd be very useful to work on this. Let's do that together? :)

johnrees added a commit to johnrees/react-three-renderer-fiber that referenced this issue Oct 26, 2017
@johnrees
Copy link
Contributor Author

Fantastic, yes that would be great! Not sure the best way to tackle this but I started a PR with some info here 0569dda#diff-370a1a3a7683bd722dc6d74ff5984f61

I guess it makes sense to keep the work in the main repository. Although it should go to a new topic branch rather than master #38

@johnrees
Copy link
Contributor Author

The README is garbage and probably doesn't make a great deal of sense haha I was just spewing out what was in my head 😬

@toxicFork
Copy link
Collaborator

Great work :) I'm going to take a break for a few days but when I come back this is the first thing I'll look at!

johnrees added a commit to johnrees/react-three-renderer-fiber that referenced this issue Nov 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants