Skip to content
This repository has been archived by the owner on Sep 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #110 from comit-network/feature/typedoc
Browse files Browse the repository at this point in the history
Autogenerated API Documentation
  • Loading branch information
mergify[bot] authored Feb 11, 2020
2 parents 5d4783d + ef086fd commit 7210cb6
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ node_modules/

.idea/

docs/
dist/

# This is a library
yarn.lock
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
gen/
dist/
docs/
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"scripts": {
"prepare": "tsc",
"fix": "tslint -p . --fix && prettier --write '**/*.{ts,js,json,yml}'",
"test": "tsc --noEmit && tslint -p . && prettier --check '**/*.{ts,js,json,yml}' && jest"
"test": "tsc --noEmit && tslint -p . && prettier --check '**/*.{ts,js,json,yml}' && jest",
"docs:clean": "rm -rf docs/",
"docs": "npm run docs:clean && typedoc --plugin none && open docs/index.html",
"docs:md": "npm run docs:clean && typedoc --plugin typedoc-plugin-markdown"
},
"dependencies": {
"axios": "^0.19.0",
Expand All @@ -37,6 +40,8 @@
"ts-jest": "^24.1.0",
"tslint": "^5.20.0",
"tslint-config-prettier": "^1.18.0",
"typedoc": "^0.16.9",
"typedoc-plugin-markdown": "^2.2.16",
"typescript": "^3.6.3"
}
}
6 changes: 6 additions & 0 deletions src/tokens/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ export interface Token {
address: string;
decimals: number;
}

/**
* @description Returns information about an ERC20 token.
* @returns ERC20 token object.
* @param symbol - ERC20 ticker symbol.
*/
export function getToken(symbol: string): Token | undefined {
const defs = definitions as Token[];
return defs.find((token: Token) => {
Expand Down
21 changes: 21 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"inputFiles": ["./src"],
"mode": "modules",
"out": "docs",
"exclude": "**/*+(index|.spec|.e2e|.d).ts",
"tsconfig": "./tsconfig.json",
"includeDeclarations": true,
"excludeExternals": true,
"excludeNotExported": false,
"excludePrivate": true,
"excludeProtected": false,
"ignoreCompilerErrors": false,
"media": "TODO",
"includes": "TODO, include for literate style documentation",
"theme": "default",
"includeVersion": true,
"readme": "README.md",
"categorizeByGroup": false,
"defaultCategory": "Other",
"hideGenerator": true
}

0 comments on commit 7210cb6

Please sign in to comment.