diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1b35072..72b08b9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,6 +2,8 @@ name: CI on: pull_request: push: + branches: + - master jobs: Tests: diff --git a/README.md b/README.md index ec8c89a..b461f94 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # jsdoc2flow -Convert JSDoc comments into Flow annotations +Convert JSDoc comments into Flow/Typescript annotations ![CI](https://github.com/dannysu/jsdoc2flow/workflows/CI/badge.svg) @@ -98,9 +98,11 @@ Options: -h, --help display help for command ``` +After conversion to Flow, you can convert your code to TypeScript using [`@khanacademy/flow-to-ts`](https://www.npmjs.com/package/@khanacademy/flow-to-ts) + ## API -```javascript +```js const Converter = require("jsdoc2flow") const converter = new Converter(opts) @@ -130,15 +132,13 @@ You can document using `@typedef` to define custom types: - Alias -``` -/** - * @typedef {number} MyNumber - */ +```js +/** @typedef {number} MyNumber */ ``` - Custom Object -``` +```js /** * @typedef {object} MyObject * @property {string} str @@ -148,7 +148,7 @@ You can document using `@typedef` to define custom types: For callback and functions, you can use `@callback`: -``` +```js /** * @callback MyCallback * @param {number} arg1 @@ -158,7 +158,7 @@ For callback and functions, you can use `@callback`: ## @type Annotation -``` +```js /** @type {number} */ const count = 1; /** @type {MyObject} */ diff --git a/package.json b/package.json index b665f04..ade2ea5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jsdoc2flow", - "version": "0.13.2", - "description": "Convert JSDoc comments into Flow annotations", + "version": "1.0.0", + "description": "Convert JSDoc comments into Flow/Typescript annotations", "main": "src/index.js", "scripts": { "format": "prettier --write .", @@ -48,7 +48,11 @@ "jsdoc", "flow", "js2typescript", - "js2ts" + "js2ts", + "typescript", + "ts", + "dts", + "dts-gen" ], "author": "Amin Yahyaabadi , Danny Su ", "license": "MIT",