Skip to content

[redux-actions@2.3.0] More specific definitions - #25286

Merged
4 commits merged into
DefinitelyTyped:masterfrom
brainbeanapps:redux_actions_2_3
May 8, 2018
Merged

[redux-actions@2.3.0] More specific definitions#25286
4 commits merged into
DefinitelyTyped:masterfrom
brainbeanapps:redux_actions_2_3

Conversation

@alexey-pelykh

Copy link
Copy Markdown
Contributor

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • tslint.json should be present, and tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • Increase the version number in the header if appropriate.
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }.

If removing a declaration:

  • If a package was never on DefinitelyTyped, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • Delete the package's directory.
  • Add it to notNeededPackages.json.

@typescript-bot

typescript-bot commented Apr 25, 2018

Copy link
Copy Markdown
Contributor

@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 Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

@typescript-bot typescript-bot added the Unmerged The author did not merge the PR when it was ready. label May 1, 2018
@typescript-bot

Copy link
Copy Markdown
Contributor

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!

Comment thread types/redux-actions/index.d.ts Outdated

// 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will still match basically everything though -- false would match for example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very true, on one hand that's useless, on other hand, returned object is not a string after all

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super-open for suggestions, that is

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this?

export interface CombinedActionType {
    _dummy: undefined;
    toString(): string;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@typescript-bot typescript-bot removed the Unmerged The author did not merge the PR when it was ready. label May 4, 2018
@alexey-pelykh

Copy link
Copy Markdown
Contributor Author

@Andy-MS, done!

@ghost

ghost commented May 8, 2018

Copy link
Copy Markdown

Thanks!

@ghost
ghost merged commit c5907dd into DefinitelyTyped:master May 8, 2018
@alexey-pelykh
alexey-pelykh deleted the redux_actions_2_3 branch May 8, 2018 14:56
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants