Skip to content

Commit 8e3053d

Browse files
authored
Fixes for comment-based syntax
1 parent 0a6fc9b commit 8e3053d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff 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
855857
const f = (x /*: number */, y /*: number */) /*: number */ => x + y
856858
```
857859

860+
### TypeScript
861+
858862
TypeScript 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:
878882
function 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 {{

0 commit comments

Comments
 (0)