Comments (4)
I've also had this issue. NextJS uses the isolatedModules
compiler option which doesn't allow const enums, causing our dashboard to have magical numbers thrown around when doing things like filtering and displaying channels, each one requiring comments explaining what its representing. It also prevents dynamic lists using ts-enum-util for something like an option type dropdown, or using enums for validation with @IsEnum
from class-validator
For now I've just stuck with copy/pasting enums without const
for validation and some dynamic lists or not using them at all for filtering and other static use cases with isolatedModules
enabled, but it would be really nice if it just wasn't an issue to begin with.
from discord-api-types.
Would be great to do this for sure especially now that discordjs/discord.js#7270 is done
from discord-api-types.
What's the use case for this? Getting the PascalCase names? The reason these enums are const and will most likely stay that way is to inline their values in the compiled code when using TS 👀
from discord-api-types.
I need to convert a string type such as INTEGER
to it's type number so I can send that off to the discord api @vladfrangu
the commands are dynamically imported and processed at runtime so it can't be done at compile time
I wonder how discord.js does it for non typescript users providing INTEGER
(how it resolves that to it's type number to send to the api
from discord-api-types.
Related Issues (20)
- APIInteractionDataResolvedGuildMember is missing any way to identify user
- GuildFeature is not a two-way enum HOT 5
- Cannot use RESTError HOT 3
- Gateway Documentation changed HOT 1
- FormattingPatterns.SlashCommand no longer matches official documentation example HOT 2
- Interface to associate GatewayDispatchEvents and relevant DataPayload (proposed code below) HOT 5
- APIChannel types could be more "strict" HOT 1
- Documentation broken.... like litreally.... HOT 2
- GatewayDispatchPayload doesn't include GatewayGuildAuditLogEntryCreateDispatch HOT 1
- APIRole - Missing Type - APIRole["permissions_new"] HOT 3
- Make types more specific and useful for type narrowing
- importsNotUsedAsValues deprecation HOT 1
- Website not displaying `<` chars
- AutoMod Trigger Type Limit Error HOT 2
- Broken types for thread events
- Route extension typings HOT 2
- Workflow for dev releases is failing HOT 2
- Dependency Dashboard
- types masquerading as cjs HOT 1
- Action Required: Fix Renovate Configuration
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discord-api-types.