How to import JQuery into a Typescript file?

You have to import it as import * as $ from "jquery";, according to typescript’s documentation, and jquery’s definition file the module is defined as an ambient module:

declare module "jquery" {
    export = $;
}

According to this:

Ambient declarations is a promise that you are making with the compiler.
If these do not exist at runtime and you try to use them, things will break without warning.

Leave a Comment