Skip to content

Type error when passing a Progress with payload type to BarItem #17

@zcbenz

Description

@zcbenz
const progress = new Progress<{name: string}>({total});
new BarItem(progress);

results in error:

src/index.ts:158:25 - error TS2345: Argument of type 'Progress<{ name: string; }>' is not assignable to parameter of type 'IProgress<object> | IProgress<object>[]'.
  Type 'Progress<{ name: string; }>' is not assignable to type 'IProgress<object>'.
    Types of property 'set' are incompatible.
      Type '(count: number, payload?: { name: string; } | undefined) => IProgress<{ name: string; }>' is not assignable to type '(count: number, payload: object) => IProgress<object>'.
        Types of parameters 'payload' and 'payload' are incompatible.
          Property 'name' is missing in type '{}' but required in type '{ name: string; }'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions