test.js 1018 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. type Banana = {
  2. eat: string => boolean,
  3. };
  4. type Hex = {n: 0x01};
  5. type T = { method: (a) => void };
  6. type T = { method(a): void };
  7. declare class X { method(a): void }
  8. declare function f(a): void;
  9. var f: (a) => void;
  10. interface F { m(string): number }
  11. interface F { m: (string) => number }
  12. function f(o: { f: (string) => void }) {}
  13. function f(o: { f(string): void }) {}
  14. type f = (...arg) => void;
  15. type f = (/* comment */ arg) => void;
  16. type f = (arg /* comment */) => void;
  17. type f = (?arg) => void;
  18. class X {
  19. constructor(
  20. ideConnectionFactory: child_process$ChildProcess => FlowIDEConnection =
  21. defaultIDEConnectionFactory,
  22. ) {
  23. }
  24. }
  25. interface F {
  26. ideConnectionFactoryLongLongLong: (child_process$ChildProcess) => FlowIDEConnection
  27. }
  28. type ExtractType = <A>(B<C>) => D
  29. type T = ?(() => A);
  30. type T = ?(() => A) | B;
  31. type T = ?() => A | B;
  32. type T = (?() => A) | B;
  33. // https://github.com/babel/babel/issues/7924
  34. //type T = ??() => A;
  35. type T = ?(?(() => A));
  36. type T = ?(?() => A) | B;