Comments (4)
Issue description
Try to use this library with typescript, in the code example below, the arguement passed into the "get" method will be flagged as its defined as a type String instead of string.
Code sample
this.lavalink = new Riffy(this, lavaNode, { send: (payload) => { const guild = this.guilds.cache.get(payload.d.guild_id); if (guild) guild.shard.send(payload); }, })Versions
Issue priority
Medium (should be fixed soon)
In typescript both string
& String
are seen as valid types it's one of either ways.
But if you compare it, ts will error.
from riffy.
Right, but this is exactly the issue and makes it a pain to use Riffy with Typescript. Because you are not using primitive types (the default type that typescript associates with strings, numbers, booleans etc) I will have to cast any time I pass data to and from your library. It would make sense to just change the type definitions to primitives which I believe is the practice recommended by Microsoft anyway.
from riffy.
try using riffy beta version npm i riffy@beta
as it's totally written in ts
from riffy.
Still having the same issue on riffy@beta
, any changes in that topic?
edit: im on ^1.0.7-beta.2
from riffy.
Related Issues (4)
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 riffy.