Use an ambient module

suggest change

If you just want to indicate the intent of an import (so you don’t want to declare a global) but don’t wish to bother with any explicit definitions, you can import an ambient module.

// in a declarations file (like declarations.d.ts)
declare module "jquery";    // note that there are no defined exports

You can then import from the ambient module.

// some other .ts file
import {$, jQuery} from "jquery";

Anything imported from the declared module (like $ and jQuery) above will be of type any

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents