Giter Club home page Giter Club logo

Comments (4)

HeikoStudt avatar HeikoStudt commented on July 22, 2024

@msssk Can you please approve this PR - it is the same as the other with the hickup.

from typings.

msssk avatar msssk commented on July 22, 2024

@HeikoStudt where are you seeing this? I can't find it in dojo/typings:

new (...args: any[]): Evented & DeclareCreatedObject

Can you add an explanatory comment to the PR? It's an awkward scenario we are in where the existing typings are accurate, but don't work in practice. dojo/Evented is a plain JS constructor function, but it is intended to be used with dojo/_base/declare and declare supports mixing in plain JS constructors. Specifying Evented & _base.DeclareCreatedObject as the return type of the Evented constructor is not accurate and could actually allow invalid code to pass type-checking. I feel like that is a lesser danger than the problem of getting type errors when trying to use modules created with declare that include dojo/Evented though. So if you can add a comment to the PR I think we are good to go:

interface EventedConstructor extends _base.DeclareConstructor<Evented> {
	// While not technically accurate, it is necessary to add `_base.DeclareCreatedObject`
	// to avoid errors when mixing in Evented using declare
	// see https://github.com/dojo/typings/issues/170
	new (params?: Object): Evented & _base.DeclareCreatedObject;
}

from typings.

HeikoStudt avatar HeikoStudt commented on July 22, 2024

Probably, I made a substitution while putting it here. It is from dojo/1.11/_base.d.ts:

new (...args: any[]): T & DeclareCreatedObject;

I put the comment into the PR, thanks a lot!

from typings.

edhager avatar edhager commented on July 22, 2024

I landed the PR

from typings.

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.