TypeScript/tests/cases/conformance/jsdoc/declarations/jsDeclarationsGetterSetter.ts
Wesley Wigham 7f3c03d441
Implement declaration emit for accessors in the js declaration emitter (#33649)
* Implement declaration emit for accessors in the js declaration emitter

* Use `or`
2019-09-30 11:09:35 -07:00

54 lines
789 B
TypeScript

// @allowJs: true
// @checkJs: true
// @outDir: ./out
// @target: es6
// @declaration: true
// @filename: index.js
export class A {
get x() {
return 12;
}
}
export class B {
/**
* @param {number} _arg
*/
set x(_arg) {
}
}
export class C {
get x() {
return 12;
}
set x(_arg) {
}
}
export class D {}
Object.defineProperty(D.prototype, "x", {
get() {
return 12;
}
});
export class E {}
Object.defineProperty(E.prototype, "x", {
/**
* @param {number} _arg
*/
set(_arg) {}
});
export class F {}
Object.defineProperty(F.prototype, "x", {
get() {
return 12;
},
/**
* @param {number} _arg
*/
set(_arg) {}
});