Question

I'm creating a method in TypeScript that should receive a jQuery selector as a parameter and I want to make it strongly typed by using DefinitelyTyped. How should my method be like?

Example:

class Foo {
    constructor($el: jQuerySelector) {
    }
}

What should I replace jQuerySelector with?

Était-ce utile?

La solution

e.g. $('div') in the DefinitelyTyped jquery.d.ts is named JQuery.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top