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.

TS definitions support?

See original GitHub issue

Is your feature request related to a problem? Please describe. It’s almost a universal expectation for modules to have types so they can be used in a TS application.

Describe the solution you’d like If you are coding in TS, ship with declaration: true but you can also add it separately to https://github.com/DefinitelyTyped.

Describe alternatives you’ve considered I will have a go at creating something and will let you know when I have something.

Additional context No.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Enteeecommented, Jan 28, 2020

I am not quite sure which return statement you mean, but the return statement of parse exposed by the module is here which really just forwards the returned parsed tree according to the parsing expression grammar. The actual parser is here, but since that’s all auto generated you don’t want to look at that.

For your purpose it’s probably best if you have a look at:

In case you need examples, there is a wealth of them in the test/fixtures directory.

1reaction
Enteeecommented, Jan 25, 2020

Are the possible options the ones listed here and listed here?

It’s both. The option object will be forwarded to the generated parser. And also to the Tracer . I found that the two options don’t intersect and both silently ignore unknown options, therefore I merged the two in one object. I could actually really improve the documentation around that.

What data types are expected from the allowedStartRules and plugins properties?

Those are both options for the parser generator, not the parser itself. The supported options are documented here. But I would actually not expose startRule to the user, since that will almost always break the parser.

Which means what I would expose and document in the type is the following (mostly tracer options)

  • verbose
  • hiddenPaths
  • useColor
  • showTrace
  • maxSourceLines
  • maxPathLength
  • matchesNode
Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - Type Declarations - TypeScript
.d.ts files are declaration files that contain only type information. ... TypeScript automatically finds type definitions under node_modules/@types ...
Read more >
Support for TypeScript definition files · Issue #7 · facebook/flow
Are you planning to support .d.ts definitions to make type headers unified? And what about es6 state? Does flow support it?
Read more >
Serverless service file Typescript definitions will never be ...
Serverless service file Typescript definitions will never be outdated again! ... Since v1.72.0, the Serverless framework accepts serverless.ts as ...
Read more >
TypeScript Definitions (d.ts)? – IDEs Support (IntelliJ Platform)
TypeScript Definitions (d.ts)? Follow ... Hey I've just started developing a HTML5 game using WebStorm and I want to use TypeScript as my ......
Read more >
TypeScript - webpack
Let's set up a configuration to support JSX and compile TypeScript down to ES5 ... that there is no default export present in...
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