You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently using a jQuery flow definition file (https://github.com/marudor/flowInterfaces) and it seems to works great. I would now also need to add definitions for some jQuery plugins and I cannot see how to extend the existing definition with other plugins sharing the jQuery namespace?
More generally asked. If I for example have an existing flowtype definition file like this:
declare class JQueryStatic {
ajax(url: string, settings?: any): any;
/* ... */
}
declare var jQuery: JQueryStatic;
declare var $: JQueryStatic;
How can for example add a new function (ajaxsetup(settings: any);) to this class without changing the existing definition file?
I would have hoped, that something like:
declare class JQueryStatic extends JQueryStatic {
ajaxsetup(settings: any);
}
would work, but do not find anything like this and flow shows the error JQueryStatic name is already bound.
What is the proper way for extending a class, module or type definition in an external flowtype definition file?
The text was updated successfully, but these errors were encountered:
doberkofler
changed the title
How to extend an existing flowtype definition file
How to extend a class, type or interface in an existing flowtype definition file
Sep 11, 2016
I'm currently using a jQuery flow definition file (https://github.com/marudor/flowInterfaces) and it seems to works great. I would now also need to add definitions for some jQuery plugins and I cannot see how to extend the existing definition with other plugins sharing the jQuery namespace?
More generally asked. If I for example have an existing flowtype definition file like this:
How can for example add a new function (
ajaxsetup(settings: any);
) to this class without changing the existing definition file?I would have hoped, that something like:
would work, but do not find anything like this and flow shows the error
JQueryStatic name is already bound
.What is the proper way for extending a class, module or type definition in an external flowtype definition file?
The text was updated successfully, but these errors were encountered: