Различное поведение переопределения в Typescript и Typescript в jsdoc.Я думаю, что я делаю что-то не так.В документации о Typescriptin jsdoc не так много информации.См. Пример ниже.
Версия машинописного текста: 3.5.3
.tsconfig.json
{
"compilerOptions": {
"target": "ES2017",
"module": "commonjs",
"lib": ["es2017", "dom"],
"allowJs": true,
"checkJs": true,
"noEmit": true,
"strict": false,
"noImplicitThis": true,
"alwaysStrict": true,
"esModuleInterop": true
},
"include": [
"*.js",
"*.ts"
]
}
допустимый машинописный текст в js-файле
class A {
/**
* @param {number} a
* @returns {string}
*/
apply(a) {
return "";
}
}
/**
* @extends {A}
*/
class B extends A {
/**
* @param {object} a
* @returns {string}
*/
apply(a) {
return "";
}
}
неверныймашинопись в файле ts
class A {
apply(a: number): string {
return "";
}
}
class E extends A {
apply(some: object) { // got error here as function signature is different
return "";
}
}
ожидаем такую же ошибку в A.js