Coder Social home page Coder Social logo

Migrate to TypeScript about media-codecs HOT 5 CLOSED

ferferga avatar ferferga commented on September 23, 2024
Migrate to TypeScript

from media-codecs.

Comments (5)

ferferga avatar ferferga commented on September 23, 2024 1

@dmnsgn Apologize for no replying in a long time. I didn't forget about this, but I got it sidetracked due to exams.

Will check your fix when time permits and report back, no matter if for good or bad. If I recall correctly, I think I also have some improvement ideas for HEVC, so you might see a PR from me as well :P.

Thank you very much for your fix!

from media-codecs.

dmnsgn avatar dmnsgn commented on September 23, 2024

Hi, for a package with a small and simple API surface like this one, I don't intend to migrate to TS as it would add complexity for little benefits.
But types are exported alongside the package, auto generated from JSDoc. In my test (new ts project, importing the usage from README and compiling), I don't have any issue seeing the types in VSCode, do you have any more details on that TS issue?

from media-codecs.

ferferga avatar ferferga commented on September 23, 2024

Can you share with me the repo of that barebones project so I can try to reproduce it on top of it?

from media-codecs.

dmnsgn avatar dmnsgn commented on September 23, 2024

Here you go test-media-codecs.zip
Running tsc (Version 5.4.5) and I don't see any errors.
If you can share your tsconfig.json, tsc version and maybe a reduced test case, that could help. And also the full error.

I have a hunch that since typescript 4.7, things have changed on how TS is resolving types, and I might need to change my exports field in package.json for it to work?

from media-codecs.

dmnsgn avatar dmnsgn commented on September 23, 2024

The above ts(7016) error should be fixed and you can import types at the root: import type { AVCCodecOptions } from "media-codecs";

from media-codecs.

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.