cli
cli copied to clipboard
Typings and documentation issue in custom plugins
What happened?
- When trying to feed the table with array of objects it throws typing error. So I need to use as
any.
- When trying to inspect the source code I see next very messy signatures
What would you expect to happen?
- Objects array just works.
- When going to sources, I'd like to see a normal ts-doc style documentation of each field. like Angular does, I.e.
export declare interface Injectable {
/**
* Determines which injectors will provide the injectable.
*
* - `Type<any>` - associates the injectable with an `@NgModule` or other `InjectorType`. This
* option is DEPRECATED.
* - 'null' : Equivalent to `undefined`. The injectable is not provided in any scope automatically
* and must be added to a `providers` array of an [@NgModule](api/core/NgModule#providers),
* [@Component](api/core/Directive#providers) or [@Directive](api/core/Directive#providers).
*
* The following options specify that this injectable should be provided in one of the following
* injectors:
* - 'root' : The application-level injector in most apps.
* - 'platform' : A special singleton platform injector shared by all
* applications on the page.
* - 'any' : Provides a unique instance in each lazy loaded module while all eagerly loaded
* modules share one instance. This option is DEPRECATED.
*
*/
providedIn?: Type<any> | 'root' | 'platform' | 'any' | null;
}
What steps did you take?
- Tried to create a custom plugin and fill in the output table with my output array of objects ¯_(ツ)_/¯.
Shape of objects
export interface ElementOutput {
"Start Date": string;
"End Date": string;
app_version: string;
target_element: string;
page_group: string;
p10: number;
p25: number;
p50: number;
p75: number;
p95: number;
IQR: string;
CQV: string;
Events: number;
"Events (%)": string;
"Poor (%)": string;
"NeedsImprovement (%)": string;
"Good (%)": string;
}
const inpAuditOutput: AuditOutput = {
slug: cruxINPSlug,
score: +report[report.length - 1]["UX Score"] / 100,
value: +report[report.length - 1]["UX Points (300 max)"],
displayValue: displayValue(
+report[report.length - 1]["UX Points (300 max)"]
),
details: {
table: {
title: "Data summary",
rows: report as any, // here throws
},
},
};
Code PushUp package version
0.50.0
What operation system are you on?
Windows
Node version
18.17.0
Relevant log output
No response