mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-18 14:17:30 +00:00
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
38 lines
537 B
JavaScript
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>;
|