Giter VIP home page Giter VIP logo

Comments (4)

tpluscode avatar tpluscode commented on August 20, 2024

This has nothing to do with Typescript. The output nquads.d.ts is exactly the same.

The generic type argument was added in DefinitelyTyped/DefinitelyTyped#45260. I would guess that you need to upgrade @types/rdf-js on your end to ^3.0.1

from rdf-string.

retog avatar retog commented on August 20, 2024

With typescript 3.9.5 it generates the following in nquads.d.ts:

export declare const nquads: (strings: TemplateStringsArray, ...values: Value<TemplateResult<NQuadsOptions>, NamedNode | Literal | BlankNode>[]) => TemplateResult<NQuadsOptions>;

With typescript 3.8.3 and all else being the same:

export declare const nquads: (strings: TemplateStringsArray, ...values: Value<TemplateResult<NQuadsOptions>, BlankNode | Literal | NamedNode<string>>[]) => TemplateResult<NQuadsOptions>;

A patch update (3.0.0 -> 3.01) should not break the API and it seems that it doesn't as long as a newer TypeScript version is used. Things would be different if you would use the type parameter in the code, but like that, it seems pointless to add such a type parameter in the .d.ts.-file

from rdf-string.

tpluscode avatar tpluscode commented on August 20, 2024

Oh, you're right, sorry. I hilariously failed to check the builds properly 🤦

It is a coincidence though that a newer version typescript does not insert the default type argument values. I would not say it was a bug. After all, NamedNode and NamedNode<string> are equal in the latest types.

I wonder, what is the output of npm ls @types/rdf-js or yarn why @types/rdf-js in your repo?

from rdf-string.

tpluscode avatar tpluscode commented on August 20, 2024

I merged you PR but I see that this will not (yet) solve the problem. For example lib/syntax/xsd.d.ts

declare const _default: {
    string: import("rdf-js").NamedNode<string>;

Every single package will have to rebuilt to remove the unnecessary generics? 😞

from rdf-string.

Related Issues (5)

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.