question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support of "nullable types" or optional paramaters ({?number}, {string} [myParam], etc)

See original GitHub issue

Hi,

First things first: thanks for this lib. It works beautifully, even if still “experimental”.

I started using it to get autocompletion from VSCode intellisense accross my pure javascript object services/controllers (AngularJS app). I recently implemented Flowtype in this same projet and noticed that I could simply use the generated tsd file as a flow-typed definition. Which is quite a good thing, as the flowtype parser/checker use it to operate type-checking accross all my documented code (it was not possible, by default, with pure javascript object services or controllers).

I’m having an issue, though, with nullable types, like:

/**
 * @param {?number} eventValue Value attached to the target event (might be null).
 */

which are converted (in the tsd file) to

/**
 * @param {number} eventValue Value attached to the target event (might be null).
 */

Is there anything I missed about the proper way to use the lib? May I do a PR if I create a clean fix for this?

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
NewFuturecommented, Aug 12, 2017

fixed

2reactions
NewFuturecommented, Aug 7, 2017

sure, I create an issue in dts-dom https://github.com/RyanCavanaugh/dts-dom/issues/27

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nullable types and optional parameters/properties (TypeScript)
An overview of how TypeScript deals with null, undefined and optional parameters/properties.
Read more >
c# - How to deal with optional arguments when wanting to ...
Making the parameter nullable by annotating the type with ? takes all of the goodness away. Another idea is to turn all methods...
Read more >
Classes - Puppet
An optional parameter list, which consists of: An opening parenthesis. A comma-separated list of parameters, such as String $myparam = "value" . Each...
Read more >
Documentation - TypeScript 2.0
TypeScript has two special types, Null and Undefined, that have the ... Optional parameters and properties automatically have undefined added to their types...
Read more >
16.11 Annotation-based controller configuration - Spring
This annotation support is available for both Servlet MVC and Portlet MVC. ... GET) public String setupForm(@RequestParam("petId") int petId, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found