-
Notifications
You must be signed in to change notification settings - Fork 698
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
issues about #2479 #2503
Comments
Please provide minimal reproductions of problems. I don't have time to spend hunting through your project to extract them and get rid of the unnecessary noise. |
declare class base{
not_markdas_Inherited: Number;
}
declare class class_impl extends base {
constructor(a: Number);//double constructors1
}
type call_signature = {
(a: Number): Number;//not in doc of my_class
}
type constructor_impl = {
new(a: Number): my_class;//double constructors2
}
/**
* @class
*/
declare const my_class: typeof class_impl & constructor_impl;
/**
* @class
*/
type my_class= class_impl & call_signature & {
constructor: typeof my_class;
} this may work |
Yes, that's correct. I very intentionally decided to use the variable here, because that's what users will deal with. If that type isn't correct, they're going to have a bad time trying to use your types to work with real values. I have no plans to change this. With the example you've provided, I'd strongly recommend using a real class declaration with declaration merging in your types instead of this jumble of intersections. export interface my_class {
constructor: typeof my_class;
(a: number): number;
}
export declare class my_class extends base {
constructor(a: number);
} (Also, sidenote, don't use |
@Gerrit0 Thank you for your help! I tried using the code you provided, or swapping the order of intersection operations, but the call signature never appears in the documentation declare class my_class extends base {
constructor(a: number);
}
interface my_class {
constructor: typeof my_class;
(a: number): number;
}
export default my_class; code 2: //same as above....
type my_class= call_signature & class_impl & { // swaped!
constructor: typeof my_class;
} |
I copied your "code 1" into a new file, added an empty In "code 2" -- TypeDoc doesn't use declare const my_class: constructor_impl & typeof class_impl; |
Sorry it looks like I misread it before. |
Search terms
marge
Behavior
I tried updating the d.ts file of jsstp to try the new features added in 0.25.8 about #2479, and it looks like there are still some details that may need to be fixed
https://ukatech.github.io/jsstp-lib/doc/EN/classes/ghost_events_queryer_t.html
Somehow there are two constructor declarations for this type, even though they have exactly the same content
https://ukatech.github.io/jsstp-lib/doc/EN/classes/ghost_events_queryer_t.html#constructor
It looks like when there is a variable and a type with the same name that both is marked as class, Typedoc will only use the variable to generate the page, and I prefer it to reference the type or both.
Members inherited from the
ExtensibleFunction
type are not marked as inherited.Steps to reproduce the bug
code: https://github.com/ukatech/jsstp-lib/tree/b94087beefedae3f52d46644718bbd12eb1aba10/src/.decls/en
Environment
^0.25.8
latest
ubuntu-latest
The text was updated successfully, but these errors were encountered: