xk6-faker icon indicating copy to clipboard operation
xk6-faker copied to clipboard

Type definition partially not working with xk-ts due to number type collision

Open lvogt opened this issue 6 months ago • 1 comments

When using the type definition provided here together with xk6-ts (maybe also when using webpack or another bundler?) you cannot use the faker.number generator as the type clashes with the built-in Typescript number type.

export declare class Faker {
  [...]
  readonly number: number;
  [...]
}

[...]

export declare interface Number {
  [...]
}

This can easily be fixed "in-place" by renaming the the interface to something else (for example Numbers).

If I understood that correctly the index.d.ts is generated by some go code, but I lack any go experience to adjust the codegen.

If adjusting the index.d.ts directly is fine, I am happy to create a PR (but probably only after my two week long vacation)

lvogt avatar Jul 26 '24 06:07 lvogt