Skip to content

Commit bf75a3f

Browse files
committed
Emit .d.ts file in test
1 parent 936f98d commit bf75a3f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/baselines/reference/strictFunctionTypes1.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,20 @@ var x1 = f1(fo, fs); // (x: string) => void
2323
var x2 = f2("abc", fo, fs); // "abc"
2424
var x3 = f3("abc", fo, fx); // "abc" | "def"
2525
var x4 = f4(fo, fs); // Func<string>
26+
27+
28+
//// [strictFunctionTypes1.d.ts]
29+
declare function f1<T>(f1: (x: T) => void, f2: (x: T) => void): (x: T) => void;
30+
declare function f2<T>(obj: T, f1: (x: T) => void, f2: (x: T) => void): T;
31+
declare function f3<T>(obj: T, f1: (x: T) => void, f2: (f: (x: T) => void) => void): T;
32+
interface Func<T> {
33+
(x: T): void;
34+
}
35+
declare function f4<T>(f1: Func<T>, f2: Func<T>): Func<T>;
36+
declare function fo(x: Object): void;
37+
declare function fs(x: string): void;
38+
declare function fx(f: (x: "def") => void): void;
39+
declare const x1: (x: string) => void;
40+
declare const x2 = "abc";
41+
declare const x3: string;
42+
declare const x4: Func<string>;

tests/cases/compiler/strictFunctionTypes1.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// @strict: true
2+
// @declaration: true
23

34
declare function f1<T>(f1: (x: T) => void, f2: (x: T) => void): (x: T) => void;
45
declare function f2<T>(obj: T, f1: (x: T) => void, f2: (x: T) => void): T;

0 commit comments

Comments
 (0)