Skip to content

Commit e210484

Browse files
committed
add declaration emit test
1 parent 4ddd9ae commit e210484

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

tests/baselines/reference/renamingDestructuredPropertyInFunctionType.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,59 @@ interface I {
3232
}
3333

3434
//// [renamingDestructuredPropertyInFunctionType.js]
35+
36+
37+
//// [renamingDestructuredPropertyInFunctionType.d.ts]
38+
declare type O = {
39+
a: string;
40+
b: number;
41+
c: number;
42+
};
43+
declare type F1 = (arg: number) => any;
44+
declare type F2 = ({ a }: O) => any;
45+
declare type F3 = ({ a, b, c }: O) => any;
46+
declare type F4 = ({ a }: O) => any;
47+
declare type F5 = ({ a, b, c }: O) => any;
48+
declare type F6 = ({ a }: {
49+
a: any;
50+
}) => typeof string;
51+
declare type F7 = ({ a, b }: {
52+
a: any;
53+
b: any;
54+
}) => typeof number;
55+
declare type F8 = ({ a, b }: {
56+
a: any;
57+
b: any;
58+
}) => typeof number;
59+
declare type F9 = ([a, b, c]: [any, any, any]) => void;
60+
declare type G1 = (arg: number) => any;
61+
declare type G2 = ({ a }: O) => any;
62+
declare type G3 = ({ a, b, c }: O) => any;
63+
declare type G4 = ({ a }: O) => any;
64+
declare type G5 = ({ a, b, c }: O) => any;
65+
declare type G6 = ({ a }: {
66+
a: any;
67+
}) => typeof string;
68+
declare type G7 = ({ a, b }: {
69+
a: any;
70+
b: any;
71+
}) => typeof number;
72+
declare type G8 = ({ a, b }: {
73+
a: any;
74+
b: any;
75+
}) => typeof number;
76+
declare type G9 = ([a, b, c]: [any, any, any]) => void;
77+
interface I {
78+
method1(arg: number): any;
79+
method2({ a }: {
80+
a: any;
81+
}): any;
82+
(arg: number): any;
83+
({ a }: {
84+
a: any;
85+
}): any;
86+
new (arg: number): any;
87+
new ({ a }: {
88+
a: any;
89+
}): any;
90+
}

tests/cases/compiler/renamingDestructuredPropertyInFunctionType.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @declaration: true
12
type O = { a: string; b: number; c: number; };
23
type F1 = (arg: number) => any; // OK
34
type F2 = ({ a: string }: O) => any; // Error

0 commit comments

Comments
 (0)