Code Monkey home page Code Monkey logo

Comments (10)

zackradisic avatar zackradisic commented on July 24, 2024

Hi, if you are using this in your project you can set compilerOptions.skipLibCheck to true and this will not type check this lib.

from node-soundcloud-downloader.

kaaax0815 avatar kaaax0815 commented on July 24, 2024

@zackradisic It is set to true and still throws errors. i have "skipLibCheck": true, in my tsconfig

from node-soundcloud-downloader.

zackradisic avatar zackradisic commented on July 24, 2024

@kaaax0815 Ok try importing the lib like this:

import scdl from 'soundcloud-downloader/dist/index'

This will force import of the transpiled JavaScript, instead of the Typescript you will have to compile. This is not an ideal solution and I'm working on v2.0.0 which fixes these problems. Please let me know if you still have problems

from node-soundcloud-downloader.

kaaax0815 avatar kaaax0815 commented on July 24, 2024

@zackradisic Could not find a declaration file for module 'soundcloud-downloader/dist/index'. 'd:/Bernd/BerndPC/Documents/Github/Javascript/Discord-MusicBot/node_modules/soundcloud-downloader/dist/index.js' implicitly has an 'any' type. Try `npm i --save-dev @types/soundcloud-downloader` if it exists or add a new declaration (.d.ts) file containing `declare module 'soundcloud-downloader/dist/index';

But normally only the transpiled javascript gets shipped anyway, so is it for most packages

from node-soundcloud-downloader.

kaaax0815 avatar kaaax0815 commented on July 24, 2024

@zackradisic Do you have any support patch until 2.0.0

from node-soundcloud-downloader.

zackradisic avatar zackradisic commented on July 24, 2024

@kaaax0815 Yeah forgot to mention that importing the transpiled JavaScript means you won't get any typings, and you'll have to declare the module in a .d.ts file. This is probably the best option for right now.

If you still want typings for intellisense, I'm working on v2.0.0 on the v2.0.0 branch. You can install the module directly from there npm install zackradisic/node-soundcloud-downloader#v2.0.0. I can't quite remember, but I think I fixed the type errors there. Just keep in mind that I'm developing on this branch and so I'm likely going to be introducing breaking changes.

from node-soundcloud-downloader.

kaaax0815 avatar kaaax0815 commented on July 24, 2024

@zackradisic okay ill go with the custom decleration. but i would recommend you only ship the js with the decleration. that is what most do. but thanks for your help

from node-soundcloud-downloader.

kaaax0815 avatar kaaax0815 commented on July 24, 2024

@zackradisic Do you have a full declaration? because if i import it from the typescript path I get errors again. And If i declare an empty module everything is 'any' which defeats the whole purpose of typescript

Edit:

With:

dts-bundle --name "soundcloud-downloader/dist" --main .\dist\index.d.ts

I get the generall structure but i had to import the Typings from src and then would get errors
So I now what functions want as arguments and the response type but not the typings itself

Edit2:

I am wrong I get typing but no errors. I dont know how and why but it works as expected

from node-soundcloud-downloader.

zackradisic avatar zackradisic commented on July 24, 2024

Yeah so the declarations file was lazily made and imports the .ts files, which does not help your problem 😅

Have never heard of dts-bundle, but it seems to have done the job, nice find!

from node-soundcloud-downloader.

kaaax0815 avatar kaaax0815 commented on July 24, 2024

Why do you need to make a own declaration? in my projects the tsc declaration is perfectly fine

from node-soundcloud-downloader.

Related Issues (20)

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.