Code Monkey home page Code Monkey logo

Comments (4)

UnschooledGamer avatar UnschooledGamer commented on September 25, 2024

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

[email protected]

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.

AlphaLupine avatar AlphaLupine commented on September 25, 2024

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.

flameface avatar flameface commented on September 25, 2024

try using riffy beta version npm i riffy@beta as it's totally written in ts

from riffy.

feenko avatar feenko commented on September 25, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.