forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypedefNameless.types
85 lines (71 loc) · 1.37 KB
/
typedefNameless.types
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
=== tests/cases/conformance/jsdoc/a.js ===
/**
* @typedef {number}
*/
var nameless;
>nameless : any
/**
* @typedef {number} named
*/
var this_is_not_the_name = true;
>this_is_not_the_name : boolean
>true : true
nameless = 123; // nameless is not a value
>nameless = 123 : 123
>nameless : any
>123 : 123
/**
* @param {named} p1
* @param {nameless} p2
*/
function abc(p1, p2) {}
>abc : (p1: number, p2: number) => void
>p1 : number
>p2 : number
/**
* @param {named} p1
* @param {nameless} p2
*/
export function breakThings(p1, p2) {}
>breakThings : (p1: number, p2: number) => void
>p1 : number
>p2 : number
/** @typedef {number} */
var notOK = 1;
>notOK : any
>1 : 1
/** @typedef {string} */
let thisIsOK;
>thisIsOK : any
/** @typedef {{L: number}} */
const notLegalButShouldBe;
>notLegalButShouldBe : any
=== tests/cases/conformance/jsdoc/b.js ===
/**
* @typedef {{
* p: string
* }}
*/
export var type1;
>type1 : any
=== tests/cases/conformance/jsdoc/c.js ===
import { type1 as aliased } from './b';
>type1 : any
>aliased : any
/**
* @param {aliased} pt1
*/
function f1(pt1) {}
>f1 : (pt1: { p: string; }) => void
>pt1 : { p: string; }
/** @type {{ p2?: any }} */
var k = {};
>k : { p2?: any; }
>{} : {}
/**
* @typedef {aliased}
*/
k.p2;
>k.p2 : any
>k : { p2?: any; }
>p2 : any