-
Notifications
You must be signed in to change notification settings - Fork 12.2k
/
jsdocPropertyDescription.ts
56 lines (45 loc) · 2 KB
/
jsdocPropertyDescription.ts
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
///<reference path="fourslash.ts" />
//// export interface StringExample {
//// /** Something generic */
//// [p: string]: any;
//// /** Something specific */
//// property: number;
//// }
//// function stringExample(e: StringExample) {
//// console.log(e./*property*/property); // works, shows type and description on hover
//// console.log(e./*string*/anything); // shows type of property but not description on hover
//// }
////export interface SymbolExample {
//// /** Something generic */
//// [key: symbol]: string;
////}
//// function symbolExample(e: SymbolExample) {
//// console.log(e./*symbol*/anything);
//// }
////export interface LiteralExample {
//// /** Something generic */
//// [key: `data-${string}`]: string;
////}
//// function literalExample(e: LiteralExample) {
//// console.log(e./*literal*/anything);
//// }
////export interface MultipleExample {
//// /** Something generic */
//// [key: string | number | symbol]: string;
////}
//// function multipleExample(e: MultipleExample) {
//// console.log(e./*multiple*/anything);
//// }
////export interface Multiple1Example {
//// /** Something generic */
//// [key: number | symbol | `data-${string}` | `data-${number}`]: string;
////}
//// function multiple1Example(e: Multiple1Example) {
//// console.log(e./*multiple1*/anything);
//// }
verify.quickInfoAt("property", "(property) StringExample.property: number",'Something specific')
verify.quickInfoAt("string", "(index) StringExample[string]: any","Something generic")
verify.quickInfoAt("literal", "(index) LiteralExample[`data-${string}`]: string","Something generic")
verify.quickInfoAt("symbol", "(index) SymbolExample[symbol]: string","Something generic")
verify.quickInfoAt("multiple", "(index) MultipleExample[string | number | symbol]: string","Something generic")
verify.quickInfoAt("multiple1", "(index) Multiple1Example[number | symbol | `data-${string}` | `data-${number}`]: string","Something generic")