documentation/test/fixture/flow-types.input.js
Tom MacWright 70cc7d0718 Infer Flow type aliases into typedefs. Fixes #227
Given the `type` tag introduced with Flow, this can infer
a typedef statement, as well as infer its potentially
nested properties and their types.

This also includes

* Refactor of Markdown AST generation that fixes #228
* Refactor of nest.js to handle multi-level nesting
2015-11-04 11:25:32 -05:00

38 lines
537 B
JavaScript

/**
* This function returns the number one.
*/
function addThem(a: Point, b: string, c: ?boolean, d: Array<number>, e: Object, f: Named): number {
return a + b + c + d + e;
}
/**
* A 2D point.
*
* @property {number} x this is a prop
*/
type Point = {
x: number,
y: number,
rgb: {
hex: string
},
props: {
radius: {
x: number
}
}
};
/**
* A type with entirely derived properties
*/
type Two = {
x: number,
y: number
};
/**
* Just an alias for an array of strings
*/
type T = Array<string>;