[redux-actions@2.3.0] More specific definitions - #25286
Conversation
|
@alexey-pelykh Thank you for submitting this PR! 🔔 @jaysoo @alexgorbatchev @alechill - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
|
After 5 days, no one has reviewed the PR 😞. A maintainer will be reviewing the PR in the next few days and will either merge it or request revisions. Thank you for your patience! |
|
|
||
| // https://github.com/redux-utilities/redux-actions/blob/v2.3.0/src/combineActions.js#L27 | ||
| export interface CombinedActionType { | ||
| // NOTE: Done on purpose to avoid empty interface declaration |
There was a problem hiding this comment.
This will still match basically everything though -- false would match for example.
There was a problem hiding this comment.
Very true, on one hand that's useless, on other hand, returned object is not a string after all
There was a problem hiding this comment.
Super-open for suggestions, that is
There was a problem hiding this comment.
If this interface is meant to be created by the library and not by the user, you could add a _combinedActionType: void field to make this a pseudo-nominal interface.
There was a problem hiding this comment.
Like this?
export interface CombinedActionType {
_dummy: undefined;
toString(): string;
}
There was a problem hiding this comment.
Yeah -- at that point toString is unnecessary since it's inherited from Object anyway:
interface I {}
function f(i: I): string { return i.toString(); } // No error|
@Andy-MS, done! |
|
Thanks! |
Please fill in this template.
npm test.)npm run lint package-name(ortscif notslint.jsonis present).Select one of these and delete the others:
If adding a new definition:
.d.tsfiles generated via--declarationdts-gen --dt, not by basing it on an existing project.tslint.jsonshould be present, andtsconfig.jsonshould havenoImplicitAny,noImplicitThis,strictNullChecks, andstrictFunctionTypesset totrue.If changing an existing definition:
tslint.jsoncontaining{ "extends": "dtslint/dt.json" }.If removing a declaration:
notNeededPackages.json.