stencil
stencil copied to clipboard
bug: Using Angular output target, EventEmitters typed with short array type notation are not binded properly
trafficstars
Prerequisites
- [X] I have read the Contributing Guidelines.
- [X] I agree to follow the Code of Conduct.
- [X] I have searched for existing issues that already report this problem, without success.
Stencil Version
2.10.0
Current Behavior
Using @stencil/angular-output-target:
@Component()
export class MyComponent {
fails!: EventEmitter<MyInterface[]>;
works!: EventEmitter<Array<MyInterface>>;
}
Gets compiled to:
import type { MyInterface as IMyComponentMyInterface } from '@library/my-library';
export declare interface LibMyComponent extends Components.LibMyComponent {
fails: EventEmitter<CustomEvent<MyInterface>>;
works: EventEmitter<CustomEvent<Array<IMyComponentMyInterface>>>;
}
in /packages/angular-workspace/projects/component-library/src/lib/stencil-generated/components.ts.
Expected Behavior
I would expect it to work with short array type notation:
import type { MyInterface as IMyComponentMyInterface } from '@library/my-library';
export declare interface LibMyComponent extends Components.LibMyComponent {
worksAgain: EventEmitter<CustomEvent<MyInterface[]>>; // Or `EventEmitter<CustomEvent<Array<MyInterface>>>`, i don't mind
works: EventEmitter<CustomEvent<Array<IMyComponentMyInterface>>>;
}
Steps to Reproduce
Follow the Angular documentation here and type an EventEmitter with short array type notation.
Code Reproduction URL
intentionally left blank
Additional Information
No response