Thursday, November 2, 2017

How do I extend for a single file?

Leave a Comment

I have a site with 10 pages, which share a Typescript file, and also each page has its own specific Typescript file. One page has a JQuery plugin, timepicker, so I extend the JQuery object using:

interface JQuery {     timepicker(options:any):JQuery; } 

However I don't want any of the other TypeScript files to have timepicker on the JQuery object. How can I extend it just for this file?

It doesn't let me extend JQuery inside a namespace.

Can modules help? I have no need to import or export anything, so I am not sure it is appropriate, or how to use modules.

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment