Open bartocc opened 2 years ago
Thx! And you are right. Would you be up for putting together a pr?
Yes, definitely
I am a bit confused though… there are 2 type definition files
The later is more complete than the former
Do they serve different purposes or are they duplicates?
@snewcomer could you help me understand why these 2 definition files exist?
The way I see it, they could/should be merged… but I might be missing something…
Thx
Seems like they could in index.d.ts
https://github.com/poteto/ember-changeset/blob/master/package.json#L21
It would also be great to add correct typings for Changeset
function, namely its last parameter - option
, since the addon supports passing a custom changeset
class into it:
if (options.changeset) {
return new options.changeset(obj, validateFn, validationMap, options);
}
Current definition only exposes two keys for the hash:
export type Config = {
skipValidate?: boolean;
changesetKeys?: string[];
};
PR https://github.com/poteto/ember-changeset/pull/635 just did this @azhiv
Ok, cool! Looking forward to get a fresh release with all the changes.
It is great to have a type definitions file
index.d.ts
, but it looks like it has not been updated since a long time and is now quite incomplete.In our codebase, we often use the imports listed below and they generate TS errors.
Version
3.15.0
Steps to reproduce
Add the following imports in a *.ts file
Expected Behavior
No TS error
Actual Behavior
Module '"ember-changeset"' has no exported member 'Changeset'. Module '"ember-changeset"' has no exported member 'EmberChangeset'.