Skip to content
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

Typings and documentation issue in custom plugins #827

Open
Karnaukhov-kh opened this issue Sep 30, 2024 · 0 comments
Open

Typings and documentation issue in custom plugins #827

Karnaukhov-kh opened this issue Sep 30, 2024 · 0 comments
Labels
🐛 bug something isn't working

Comments

@Karnaukhov-kh
Copy link

What happened?

  1. When trying to feed the table with array of objects it throws typing error. So I need to use as any.

image

  1. When trying to inspect the source code I see next very messy signatures

image

What would you expect to happen?

  1. Objects array just works.
  2. 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?

  1. 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

@Karnaukhov-kh Karnaukhov-kh added the 🐛 bug something isn't working label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant