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

Create co.json #757

Merged
merged 1 commit into from
Sep 5, 2016
Merged

Create co.json #757

merged 1 commit into from
Sep 5, 2016

Conversation

blakeembrey
Copy link
Member

Typings URL: https://github.com/types/npm-co

Questions (for new typings):

  • Does the README explain the purpose of the typings and have a link to the JavaScript project?
  • Do the typings follow the source structure (e.g. index.js <-> index.d.ts)?
  • Are they external or global modules according the source (e.g. see README sources)?

Change Summary (for existing typings):

If anyone is interested, it's a pretty decent demonstration of TypeScript generics and how to unravel a type (E.g using <T> (arg: Promise<T> | T): Promise<T> to unravel promises and other types - in this case, thunks, iterables, etc). However, the type definition itself isn't very effective because of the limitations on generator functions in TypeScript. It appears the return type isn't even considered. Also, yielded values can't get any types either - they are always any and the input to IterableIterators is also always any.

/cc @mhegazy am I using the generators correctly? Is it possible to use the return type only or otherwise specify the result of yields?

@blakeembrey blakeembrey merged commit 5539f04 into master Sep 5, 2016
@blakeembrey blakeembrey deleted the blakeembrey-patch-1 branch September 5, 2016 04:52
@mhegazy
Copy link

mhegazy commented Sep 6, 2016

Currently generators only capture the type of the yield expression. issue microsoft/TypeScript#2983 tracks handling it correctly and capturing the return expression type as well.

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