knitwork icon indicating copy to clipboard operation
knitwork copied to clipboard

feat: add support for jsdoc in interfaces

Open luxass opened this issue 8 months ago • 0 comments

resolves #110

I have a leftover question about whether we should support jsdoc on more that interfaces? Maybe it would make sense to also have it on generated objects?

There is one thing i could think about that this will break, and that is if you want to generate an interface like this:

interface FooInterface {
  foo?: {
    type: "string",
    jsdoc: "string"
  }
}

But since we generate jsdoc when we receive an object with type and jsdoc, that's no longer possible. Maybe we should take a different approach and use a withJSDOC function which returns an object with a special symbol which we can use to differentiate between jsdoc or not.

Let me know what you think about this approach!

luxass avatar May 05 '25 15:05 luxass