You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.
I'll be using asynquence in Typescript in addition to Javascript.
A definition file is a header file. A file like this (asynquence.d.ts) would tell Typescript what the asynquence API looks like, so that it can auto-complete, give compiler errors if you pass the wrong type, leave off a parameter, etc. It will obviously take some familiarity with Typescript to write one. There are definition files for most popular frameworks/libraries: DefinitelyTyped project.
I will start playing with generating one, and will post back here if I have much luck.
The text was updated successfully, but these errors were encountered:
I don't know typescript, so I cannot say for sure, but the types file seems to indicate some assumptions of usage that are not strictly required. For example, the val(..) method can accept either a function or an immediate value, but the types seem to indicate it only takes a function.
Is the intention of a TS file to provide a guideline that restricts someone's usage of an API to a potentially safer subset, or is the intention to encode all of the possible types for any input or output operation?
If the former, then this particular opinionated usage seems like it should be at a minimum some optional thing, like maybe in a folder of possible definitions that someone could pick from to opt-in to.
If the latter, I don't think from what I'm reading that it adequately does that. Moreover, as many of the inputs/outputs can in fact be "Any" (function, sequence, regular value), does that mean that having type definitions for this API is not particularly helpful? What's the point of having a bunch of "Any"s all over the definition file?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'll be using asynquence in Typescript in addition to Javascript.
A definition file is a header file. A file like this (asynquence.d.ts) would tell Typescript what the asynquence API looks like, so that it can auto-complete, give compiler errors if you pass the wrong type, leave off a parameter, etc. It will obviously take some familiarity with Typescript to write one. There are definition files for most popular frameworks/libraries: DefinitelyTyped project.
I will start playing with generating one, and will post back here if I have much luck.
The text was updated successfully, but these errors were encountered: