Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript types for immutable-assign #20

Closed
st-clair-clarke opened this issue Oct 28, 2017 · 6 comments
Closed

typescript types for immutable-assign #20

st-clair-clarke opened this issue Oct 28, 2017 · 6 comments

Comments

@st-clair-clarke
Copy link

Hi, Are there any typing definition to use immutable-assign with typescript?

Thanks

@engineforce
Copy link
Owner

It is already in the immutable-assign npm package, next to the js file.

@st-clair-clarke
Copy link
Author

st-clair-clarke commented Oct 28, 2017

Then why does the import statement starts with require instead of typescript import? Do I have to do something to correct this anamoly?
Thanks

@shroo-paulli
Copy link
Contributor

Do you mean my examples in the README.MD? Those examples are JavaScript examples, because this library can be used in both JavaScript and TypeScript projects.

@st-clair-clarke
Copy link
Author

Hi,
I am using typescript with Webstorm

I try to use the following:// 2.1: Calling iassign() to push items to list1, using overload 2

      let list2 = iassign(
          list1,
          function (l) { l.push(3, 4, 5); return l; }
      );

When I click on iassign symbol Webstorm does the following import

import iassign = require('immutable-assign')

NOT the typescript form of import. I would think the typescript form should be imported since the typescrpt definition file is present.

Cheers

@shroo-paulli
Copy link
Contributor

Please try:
import * as iassign from "immutable-assign";

@st-clair-clarke
Copy link
Author

Thanks for your help. It now works.

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

No branches or pull requests

3 participants