File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -847,14 +847,18 @@ const usage = makeTgenerator<string>()
847847// 'usage' is of type: (next: () => string) => string
848848```
849849
850- ## Comment Type
850+ ## Typing pure JS files (i.e. without transpilation)
851851
852- Flow supports a comment-based syntax:
852+ ### Flow
853+
854+ Flow supports a comment-based syntax, by encapsulating type annotations in ` /* */ ` -style comments:
853855
854856``` js
855857const f = (x /* : number */ , y /* : number */ ) /* : number */ => x + y
856858```
857859
860+ ### TypeScript
861+
858862TypeScript can check types with JavaScript files annotated with JSDoc comments:
859863
860864``` js
@@ -878,7 +882,7 @@ JSDoc's overloaded function comment syntax is not supported:
878882function notSupported (input ) { /* omit */ }
879883```
880884
881- However, we can express [ function overloading type in TypeScript's from ] [ spec ] in a tricky way:
885+ However, we can express [ function overloading type in TypeScript's form ] [ spec ] in a tricky way:
882886
883887``` js
884888/** @type {{
You can’t perform that action at this time.
0 commit comments