You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.
type2docfx (v0.9.79) has a problem with function types described with an interface.
For example, we have a module:
exportinterfaceObservableGetter<T>{(): T;}exportinterfaceObservableSetter<T>{(v: T): void;}exportinterfaceObservableProperty<T>extendsObservableSetter<T>,ObservableGetter<T>{}exportdefaultclassObservable{staticaccessor<T>(name: string): ObservableProperty<T>;staticaccessor(name: string){returnfunction(v?){if(arguments.length){// call internal set method}else{// call internal get method}}}}
Run typedoc (v0.11.1) on it with json output and get result api.json.
If we pass that api.json to type2docfx, we get an error:
> type2docfx api.json .\
Class: test.Observable
- Method: test.Observable.accessor
Interface: test.ObservableGetter
Interface: test.ObservableProperty
...\type2docfx\dist\jsonTraverse.js:220
method.syntax.parameters = fillParameters(node.signatures[signatureIndex].parameters);
^
TypeError: Cannot set property 'parameters' of undefined
at extractInformationFromSignature (...\type2docfx\dist\jsonTraverse.js:220:30)
at traverse (...\type2docfx\dist\jsonTraverse.js:199:17)
at ...\type2docfx\dist\jsonTraverse.js:210:17
at Array.forEach (<anonymous>)
at Object.traverse (...\type2docfx\dist\jsonTraverse.js:205:23)
at Object.<anonymous> (...\type2docfx\dist\main.js:78:20)
at Module._compile (module.js:649:30)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
The text was updated successfully, but these errors were encountered:
Having the same problem. Not entirely sure why, but the "syntax" property isn't initialized in this case. Just adding an initializer in the jsonTraverse.ts file in the extractInformationFromSignature seems to fix (but might not be the best way)...
// init syntax object if it's not already there...
method.syntax = method.syntax || {};
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
type2docfx (v0.9.79) has a problem with function types described with an interface.
For example, we have a module:
Run typedoc (v0.11.1) on it with json output and get result api.json.
If we pass that api.json to type2docfx, we get an error:
The text was updated successfully, but these errors were encountered: