문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top