Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

Commit fe3b22e

Browse files
committed
build: Customize docs generator
1 parent d728edd commit fe3b22e

File tree

4 files changed

+48
-3
lines changed

4 files changed

+48
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"build-data": "mkdir -p ./dist/data && cp ./data/* ./dist/data",
3737
"build": "npm run build-data && tsc && tsc -p tsconfig-esm.json",
3838
"dev": "npm run build-data && tsc --watch",
39-
"build-docs": "rm -rf ./docs && typedoc --out docs",
39+
"build-docs": "rm -rf ./docs && typedoc",
4040
"publish-docs": "npm run build-docs && gh-pages -d docs",
4141
"prepublishOnly": "npm run build",
4242
"postpublish": "npm run publish-docs",

src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import { NetworkMetadata, NetworkMetadataMap, Token, TokenMap } from './types'
2+
3+
/**
4+
* @internal
5+
*/
26
const networks = require('../data/networks.json')
7+
8+
/**
9+
* @internal
10+
*/
311
const tokens = require('../data/tokens.json')
412

513
export * from './types'

src/types.ts

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,40 @@ export interface PromiseResolver {
7878
* This reflects the data structures inside the `tokens.json` data file.
7979
*/
8080
export interface Token {
81+
/**
82+
* Token id.
83+
*/
8184
id: string,
85+
/**
86+
* No. of digits to the right of the decimal point in the standard unit of this token.
87+
*
88+
* For example, for eGLD the value should be 18. This also means the smallest unit of
89+
* denomination is 1 / 10^18.
90+
*/
8291
decimals: number,
92+
/**
93+
* The display-friendly symbol.
94+
*/
8395
symbol: string,
84-
symbolFormatting?: string,
96+
/**
97+
* Display-friendly name.
98+
*/
8599
name: string,
100+
/**
101+
* How the symbol should be formatted.
102+
*
103+
* This is specified as a string template utilising {value} and {symbol}
104+
*
105+
* Default is `{value} {symbol}`.
106+
*/
107+
symbolFormatting?: string,
108+
/**
109+
* The id to use for this token when fetching its exchange rate from Coingecko.
110+
*/
86111
rateApiName?: string,
87-
rateMultiplier?: number
112+
/**
113+
* Either path to or a Base64-encoded string for an image representing the token.
114+
*/
88115
img?: string,
89116
}
90117

typedoc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"inputFiles": [
3+
"./src"
4+
],
5+
"excludeProtected": true,
6+
"stripInternal": true,
7+
"theme": "minimal",
8+
"mode": "file",
9+
"out": "docs"
10+
}

0 commit comments

Comments
 (0)