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.

[Discussion]: export decorators typings

See original GitHub issue

I’m submitting a…


[ ] Regression 
[ ] Bug report
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Decorators typings are not exported such as here, here and here for example.

Expected behavior

I think it would be great if interfaces for this typings could be exposed as decorators are.

Minimal reproduction of the problem with instructions

Try import { SwaggerEnumType } from '@nestjs/swagger'

What is the motivation / use case for changing the behavior?

As these typings are not private (used in decorators), I am wondering if they could be exported ? I think this could be great as I am currently duplicating these models inside my code. As you mentioned in CONTRIBUTING.MD, I think this is a major feature and that’s why I wanted your opinion on this before submitting a PR.

Environment


Nest version: latest

 
For Tooling issues:
- Node version: 10.15.1  
- Platform:  Mac, Linux, Windows

Others:

Thanks anyway for the great job

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kamilmysliwieccommented, Oct 30, 2019

Added in the next version (to install run npm i @nestjs/swagger@next). Note: remember to update @nestjs/common, @nestjs/core and typescript as well to ensure that you’re using the latest versions.

Steps to migrate: https://github.com/nestjs/swagger/pull/355#issuecomment-547925879

0reactions
lock[bot]commented, Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

deco before or after export keyword? · Issue #69 - GitHub
export is static, so I think decorating it is impossible. I think that's better to have the class's decorators just before the class...
Read more >
A practical guide to TypeScript decorators - LogRocket Blog
TypeScript decorators enable you to do cools things such as calculate execution time, perform runtime type assertion, guard against errors, ...
Read more >
Documentation - Decorators - TypeScript
A Decorator is a special kind of declaration that can be attached to a class declaration, method, accessor, property, or parameter. Decorators use...
Read more >
Converting TypeScript decorators into static code!
We can do the same with our own decorators by using TypeScript transforms! This post is the story of my adventures with custom...
Read more >
Chapter 5. Decorators and advanced types - TypeScript Quickly
What the TypeScript decorators are for; How to create a new type based on an existing one using mapped types; How conditional types...
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