Skip to content

Commit

Permalink
fix: flow types
Browse files Browse the repository at this point in the history
  • Loading branch information
janmazak committed Dec 12, 2022
1 parent 4735504 commit 33e0c2d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@
},
"homepage": "https://github.com/cardano-foundation/ledgerjs-hw-app-cardano",
"scripts": {
"prepack": "yarn build:flowtypes && yarn flow",
"prepack": "yarn build:flowtypes && yarn flow && yarn build",
"lint": "yarn eslint . --max-warnings=0",
"clean": "rm -rf dist/",
"build": "yarn tsc -p src/tsconfig.json",
"build:flowtypes": "find . -type f -not -path './node_modules/*' -not -path './example-node/*' -name '*.d.ts' -exec sh -c 'yarn flowgen --add-flow-header --no-inexact $1 -o ${1%.*.*}.js.flow' _ '{}' \\;",
"build": "yarn tsc -p src/tsconfig.json --removeComments",
"build-with-comments": "yarn tsc -p src/tsconfig.json",
"build:flowtypes": "yarn build-with-comments && find . -type f -not -path './node_modules/*' -not -path './example-node/*' -name '*.d.ts' -exec sh -c 'yarn flowgen --add-flow-header --no-inexact $1 -o ${1%.*.*}.js.flow' _ '{}' \\;",
"flow": "flow --show-all-errors dist/",
"gen-docs": "yarn typedoc",
"prepublish": "yarn run clean && yarn run build",
Expand Down
5 changes: 4 additions & 1 deletion src/Ada.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,14 @@ async function interact<T>(
* @category Main
*/
export class Ada {
/** @ignore */
// we generate flow type annotations for the package
// and it does not work for Transport, so we suppress the error
/** $FlowIgnore[value-as-type] */
transport: Transport;
/** @ignore */
_send: SendFn;

/** $FlowIgnore[value-as-type] */
constructor(transport: Transport, scrambleKey: string = "ADA") {
this.transport = transport
// Note: this is list of methods that should "lock" the transport to avoid concurrent use
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"noUnusedLocals": false,
"outDir": "dist",
"pretty": true,
"removeComments": true,
"removeComments": false,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
Expand Down

0 comments on commit 33e0c2d

Please sign in to comment.