Closed CoderIllusionist closed 9 months ago
Thanks - issues should be fixed when using typedoc 0.25.6
and typedoc-plugin-markdown 4.0.0-next.39
.
Thanks, closing.
@tgreyuk i didn't noticed it earlier, but i noticed it always generates (event
) => void
without the actual typing. BstSimpleComponentCustomEvent contains an detail
and target
ok - i'll re-open and investigate...
FYI - here's the type decleration file generated by stencil for reference;
/* eslint-disable */
/* tslint:disable */
/**
* This is an autogenerated file created by the Stencil compiler.
* It contains typing information for all components that exist in this project.
*/
import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
import { InputValues } from "./components/my-component/my-component";
export { InputValues } from "./components/my-component/my-component";
export namespace Components {
interface MyComponent {
/**
* The first name
*/
"first": string;
/**
* The last name
*/
"last": string;
/**
* The middle name
*/
"middle": string;
}
}
export interface MyComponentCustomEvent<T> extends CustomEvent<T> {
detail: T;
target: HTMLMyComponentElement;
}
declare global {
interface HTMLMyComponentElementEventMap {
"inputEvent": InputValues;
}
interface HTMLMyComponentElement extends Components.MyComponent, HTMLStencilElement {
addEventListener<K extends keyof HTMLMyComponentElementEventMap>(type: K, listener: (this: HTMLMyComponentElement, ev: MyComponentCustomEvent<HTMLMyComponentElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
removeEventListener<K extends keyof HTMLMyComponentElementEventMap>(type: K, listener: (this: HTMLMyComponentElement, ev: MyComponentCustomEvent<HTMLMyComponentElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
var HTMLMyComponentElement: {
prototype: HTMLMyComponentElement;
new (): HTMLMyComponentElement;
};
interface HTMLElementTagNameMap {
"my-component": HTMLMyComponentElement;
}
}
declare namespace LocalJSX {
interface MyComponent {
/**
* The first name
*/
"first"?: string;
/**
* The last name
*/
"last"?: string;
/**
* The middle name
*/
"middle"?: string;
/**
* A input event
*/
"onInputEvent"?: (event: MyComponentCustomEvent<InputValues>) => void;
}
interface IntrinsicElements {
"my-component": MyComponent;
}
}
export { LocalJSX as JSX };
declare module "@stencil/core" {
export namespace JSX {
interface IntrinsicElements {
"my-component": LocalJSX.MyComponent & JSXBase.HTMLAttributes<HTMLMyComponentElement>;
}
}
}
We use LocalJSX
namespace and ignore documentation generated for the namespace Components
Source code:
import { Component, Prop, h, Event, EventEmitter } from '@stencil/core';
import { format } from '../../utils/utils';
export type InputValue = undefined | null | boolean | string | number | string[] | Date;
export type InputValues<V = InputValue> = { value: V; oldValue: V };
@Component({
tag: 'my-component',
styleUrl: 'my-component.css',
shadow: true,
})
export class MyComponent {
/**
* The first name
*/
@Prop() first: string;
/**
* The middle name
*/
@Prop() middle: string;
/**
* The last name
*/
@Prop() last: string;
/**
* A input event
*/
@Event() inputEvent: EventEmitter<InputValues>
private getText(): string {
return format(this.first, this.middle, this.last);
}
render() {
return <div>Hello, World! I'm {this.getText()}</div>;
}
}
Hi, any update on this, can I help in any way?
I did update so the param type is displayed in the signature but not sure if this is sufficient. What would be really useful though is an example repo to test against.
@tgreyuk I created a repo; https://stackblitz.com/github/CoderIllusionist/typedoc-plugin-demo
It's already fixed indeed, just made the example repo so you could check it. I noticed that the sort
typedoc options doesn't work entirely for the properties / events? let me know if i need to create a separate issue for this, you can see the sorting in the demo.
@CoderIllusionist thanks for putting the repo together - that is super useful.
So this is an interesting one. The entry point in this case is a d.ts file generated by stencil which has already been sorted alphbetically. So infact source-order
is behaving correctly in this instance:
No problem :). Yes indeed, I noticed that after I posted the comment, my bad 😃 . For us the events are fixed, you can close this issue if you want to, I'll try to keep the example repo up and running if you need it.
Ok thanks @CoderIllusionist i will close this one. All this feedback is appreciated and obviously please do continue raising new issues as you find stuff.
Hi,
Given the following interface;
Will resolve to
As you can see the description is empty and it doesn't take
@deprecated
into account. Any idea how to fix that ? The interface itself is generated by StencilJS. P.S. when not adding the@eventProperty
it wont register an event