Closed whitlockjc closed 6 years ago
Can you give me an example of the input, the output and what you expect it should look like?
https://github.com/whitlockjc/json-refs is a perfect example. index.js
and lib/typedefs.js
end up creating the TypeScript definitions in index.d.ts
. What happens is if you have a @typedef {object}
that is a @memberof module:json-refs
, when the interface
is declared, it should not have a declare
keyword. So declare interface JsonRefsOptions, it should just be interface JsonRefsOptions
. _(Not sure if it should be export interface JsonRefsOptions
, I'm new to TypeScript.
Okay, I will have a look tomorrow
I could easily reproduce this with the following jsdoc
/**
* @module myModule
*/
/**
* @interface myInterfaceInsideAModule
* @memberof module:myModule
*/
which generates the following output
declare module 'myModule' {
declare interface myInterfaceInsideAModule {
}
}
The output should look like
declare module 'myModule' {
interface myInterfaceInsideAModule {
}
}
(the keyword "declare" is omitted for the interface)
@whitlockjc published v1.0.4
. Can you verify it, please?
v1.0.4
fixes my issues.
As reported in https://github.com/whitlockjc/json-refs/issues/140, it seems like a
declare
in amodule
,namespace
, ... causes the error thrown in the title. https://github.com/whitlockjc/json-refs/pull/143 shows how to fix this and has some details.