forked from microsoft/TypeScript
/
jsxGenericQuickInfo.tsx
34 lines (32 loc) · 1.32 KB
/
jsxGenericQuickInfo.tsx
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
/// <reference path="fourslash.ts" />
//@Filename: file.tsx
//// declare module JSX {
//// interface Element { }
//// interface IntrinsicElements {
//// }
//// interface ElementAttributesProperty { props }
//// }
//// interface PropsA<T> {
//// /** comments for A */
//// name: 'A',
//// items: T[];
//// renderItem: (item: T) => string;
//// }
//// interface PropsB<T> {
//// /** comments for B */
//// name: 'B',
//// items: T[];
//// renderItem: (item: T) => string;
//// }
//// class Component<T> {
//// constructor(props: PropsA<T> | PropsB<T>) {}
//// props: PropsA<T> | PropsB<T>;
//// }
//// var b = new Component({items: [0, 1, 2], render/*0*/Item: it/*1*/em => item.toFixed(), name/*2*/: 'A',});
//// var c = <Component items={[0, 1, 2]} render/*3*/Item={it/*4*/em => item.toFixed()} name/*5*/="A" />
verify.quickInfoAt("0", "(property) PropsA<number>.renderItem: (item: number) => string");
verify.quickInfoAt("1", "(parameter) item: number");
verify.quickInfoAt("2", `(property) PropsA<T>.name: "A"`, 'comments for A');
verify.quickInfoAt("3", "(property) PropsA<number>.renderItem: (item: number) => string");
verify.quickInfoAt("4", "(parameter) item: number");
verify.quickInfoAt("5", `(property) PropsA<T>.name: "A"`, 'comments for A');