Ignore typescript definition error

0 votes

I have a 3rd party typescript definition file (JayData):

declare module MyEntities
{
    export class Container extends $data.EntityContext
    {
        public onReady(): $data.IPromise<any>;
        public onReady(handler: (context: Container) => void): $data.IPromise<any>;

        public Users: $data.EntitySet<Models.UserModel>;
    }
}

But a valid piece of Javascript is how to initialize the MyEntities class:

var db = new MyEntities({ name: 'local', databaseName: 'MyDb' });

But for TS this doesn't make sense, MyEntities is a module and not a class, thus throwing the compile error: Cannot invoke an expression whose type lacks a call signature.

Is there any way around this to ignore this compile error?

Aug 3, 2022 in TypeSript by Elton
• 400 points

edited Mar 4 15 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP