2017-04-08 16:52:38 +02:00
|
|
|
type Banana = {
|
|
|
|
|
eat: string => boolean,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type Hex = {n: 0x01};
|
|
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
type T1 = { method: (a) => void };
|
2017-04-08 16:52:38 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
type T2 = { method(a): void };
|
2017-04-08 16:52:38 +02:00
|
|
|
|
|
|
|
|
declare class X { method(a): void }
|
|
|
|
|
|
|
|
|
|
declare function f(a): void;
|
|
|
|
|
|
|
|
|
|
var f: (a) => void;
|
|
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
interface F1 { m(string): number }
|
2017-04-08 16:52:38 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
interface F2 { m: (string) => number }
|
2017-04-08 16:52:38 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
function f1(o: { f: (string) => void }) {}
|
2017-04-08 16:52:38 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
function f2(o: { f(string): void }) {}
|
2017-04-08 16:52:38 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
type f3 = (...arg) => void;
|
2017-04-08 16:52:38 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
type f4 = (/* comment */ arg) => void;
|
2017-04-08 16:52:38 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
type f5 = (arg /* comment */) => void;
|
2017-04-08 16:52:38 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
type f6 = (?arg) => void;
|
2017-04-20 16:46:41 -05:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
class Y {
|
2017-04-20 16:46:41 -05:00
|
|
|
constructor(
|
|
|
|
|
ideConnectionFactory: child_process$ChildProcess => FlowIDEConnection =
|
|
|
|
|
defaultIDEConnectionFactory,
|
|
|
|
|
) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface F {
|
|
|
|
|
ideConnectionFactoryLongLongLong: (child_process$ChildProcess) => FlowIDEConnection
|
|
|
|
|
}
|
2017-05-29 16:59:45 -07:00
|
|
|
|
|
|
|
|
type ExtractType = <A>(B<C>) => D
|
2018-05-14 16:25:16 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
type T3 = ?(() => A);
|
2018-05-14 16:25:16 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
type T4 = ?(() => A) | B;
|
2018-05-14 16:25:16 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
type T5 = ?() => A | B;
|
2018-05-14 16:25:16 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
type T6 = (?() => A) | B;
|
2018-05-14 16:25:16 +02:00
|
|
|
|
|
|
|
|
// https://github.com/babel/babel/issues/7924
|
|
|
|
|
//type T = ??() => A;
|
|
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
type T7 = ?(?(() => A));
|
2018-05-14 16:25:16 +02:00
|
|
|
|
2019-10-09 19:52:11 +08:00
|
|
|
type T8 = ?(?() => A) | B;
|