1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
=== tests/cases/conformance/jsdoc/commonjs.d.ts ===
declare var module: { exports: any};
>module : { exports: any; }
>exports : any
=== tests/cases/conformance/jsdoc/mod1.js ===
/// <reference path="./commonjs.d.ts"/>
/** @typedef {{ type: "a", x: 1 }} A */
/** @typedef {{ type: "b", y: 1 }} B */
/** @typedef {A | B} Both */
module.exports = C
>module.exports = C : typeof C
>module.exports : typeof C
>module : { "tests/cases/conformance/jsdoc/mod1": typeof C; }
>exports : typeof C
>C : typeof C
function C() {
>C : typeof C
this.p = 1
>this.p = 1 : 1
>this.p : any
>this : any
>p : any
>1 : 1
}
=== tests/cases/conformance/jsdoc/mod2.js ===
/// <reference path="./commonjs.d.ts"/>
/** @typedef {{ type: "a", x: 1 }} A */
/** @typedef {{ type: "b", y: 1 }} B */
/** @typedef {A | B} Both */
export function C() {
>C : typeof C
this.p = 1
>this.p = 1 : 1
>this.p : any
>this : any
>p : any
>1 : 1
}
=== tests/cases/conformance/jsdoc/mod3.js ===
/// <reference path="./commonjs.d.ts"/>
/** @typedef {{ type: "a", x: 1 }} A */
/** @typedef {{ type: "b", y: 1 }} B */
/** @typedef {A | B} Both */
exports.C = function() {
>exports.C = function() { this.p = 1} : typeof C
>exports.C : typeof C
>exports : typeof import("tests/cases/conformance/jsdoc/mod3")
>C : typeof C
>function() { this.p = 1} : typeof C
this.p = 1
>this.p = 1 : 1
>this.p : any
>this : any
>p : any
>1 : 1
}
=== tests/cases/conformance/jsdoc/use.js ===
/** @type {import('./mod1').Both} */
var both1 = { type: 'a', x: 1 };
>both1 : { type: "a"; x: 1; } | { type: "b"; y: 1; }
>{ type: 'a', x: 1 } : { type: "a"; x: 1; }
>type : "a"
>'a' : "a"
>x : 1
>1 : 1
/** @type {import('./mod2').Both} */
var both2 = both1;
>both2 : { type: "a"; x: 1; } | { type: "b"; y: 1; }
>both1 : { type: "a"; x: 1; }
/** @type {import('./mod3').Both} */
var both3 = both2;
>both3 : { type: "a"; x: 1; } | { type: "b"; y: 1; }
>both2 : { type: "a"; x: 1; }
|