-
Notifications
You must be signed in to change notification settings - Fork 699
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
Warning states Object is defined and referenced, but not included in the documentation. Why? #1739
Comments
I also get this error a lot and don't understand why. My minimal reproducible example: // types.d.ts
export interface TestInterface {
x: number
}
// index.ts
import { TestInterface } from "./types";
export function test(props: TestInterface) {
console.log(props);
}
With |
Sounds like the expected behaviour and you are looking for this: https://github.com/Gerrit0/typedoc-plugin-missing-exports |
Aha, so by default only exports from the direct entrypoints are included, this clarifies things. Thank you. |
Yep, this is expected behavior. Users of your library will (unless you tell them otherwise) import
This is an artifact of |
Hmm, I just started getting this warning in my library too, but my case is more complex than the minimal repro by @timohausmann. I am curious if you all still think TypeDoc is correct to print a warning. This is in a monorepo that contains packages
import { Validator } from './Validator'
function email(): Validator<string> {
return /* ... */
}
export const Validators = {
email
}
import { Validator } from './Validator'
declare function email(): Validator<string>
export declare const Validators: {
email: typeof email
}
export {}
export * from '@interface-technologies/iti-react-core' And the warning from TypeDoc:
There are no warnings if I run TypeDoc on only |
Hmmm, I finally took a look at the generated documentation like I should have in the first place. TypeDoc is right, I can't tell if TypeDoc is handling this situation in a suboptimal way or if I just need to refactor my code for it to work correctly with TypeDoc. |
Looking at the declaration file - I'd say... yes, for how TypeDoc works today, it is correct to produce a warning here. It could certainly be argued that TypeDoc isn't handling "variable namespaces" optimally here, and should have a special case for this, though (should probably be a new issue, that lays out when variables should be treated as namespaces, and when they shouldn't) |
* fix: discovery for peer-exchange use the bootstrap node as a starter to send a peer-exchange query to, and emit the response peers received from it for further connection to libp2p using the peer-discovery interface * init: test for libp2p bootstrap/discovery for peer-exchange * temp-add: console.logs for easier debugging * add: peer discovery test & rm: console.logs * chore: rm and redundant spec test * add: interval for peer exchange queries we set an interval to query a peer every 5 minutes for peer exchange, and add new peers if found * address: reviews - add `type` for imports not using values - better handling for peer-exchange query interval * chore: fix tsc for peer-exchange use node16 for module resolution * chore: add extra exports to fix typedoc warnings ref: TypeStrong/typedoc#1739
It seems though if I don't want to include certain types in the documentation, e.g. by using tags hidden or internal (with excludeInternal option set), I still get the same warning if these types are used in definition of other publicly visible types. Is there a workaround for this? |
https://typedoc.org/options/validation/#intentionallynotexported, could also turn that validation off with |
Thanks, it works. |
I am receiving quite a few warnings of the same type describing that a component of my code is defined, and referenced within the code, but has not been included in the docs. I am not finding, however, why this is or what I am meant to do to resolve it.
Example of Error:
MyClassSchema, defined at src/lib/MyClass.ts:24, is referenced by MyClass.generate.generate but not included in the documentation
Notice here
generate
is written twice, I found this strange.Here is the Interface that is being defined here:
And here is how it was referenced:
Now possibly why, and worthy of note, is that
MyClass
here is overwriting the definition ofgenerate()
which was defined inCommand
, this may be why we seegenerate
twice, and possibly why it is not being exported? If that is the case, this may be a bug?However, counter example to the immediate above comment: I am also experiencing this in an interface that is being used as a struct on a class.
This too is getting this error:
Warning: IntefaceY, defined at src/lib/X.ts:121, is referenced by X but not included in the documentation.
The text was updated successfully, but these errors were encountered: