Skip to content

Commit 46ddc89

Browse files
committed
docs: added jsdocs
1 parent d190e65 commit 46ddc89

File tree

18 files changed

+311
-27
lines changed

18 files changed

+311
-27
lines changed

src.ts/abi/fragments.ts

Lines changed: 252 additions & 24 deletions
Large diffs are not rendered by default.

src.ts/abi/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export { Typed } from "./typed.js";
2828

2929
export type {
3030
JsonFragment, JsonFragmentType,
31-
FormatType, FragmentType, FragmentWalkAsyncFunc, FragmentWalkFunc
31+
FormatType, FragmentType, ParamTypeWalkAsyncFunc, ParamTypeWalkFunc
3232
} from "./fragments.js";
3333

3434
export type {

src.ts/crypto/keccak.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ let __keccak256: (data: Uint8Array) => BytesLike = _keccak256;
3636
* keccak256(new Uint8Array([ 0x13, 0x37 ]))
3737
* //_result:
3838
*
39+
* // Strings are assumed to be DataHexString, otherwise it will
40+
* // throw. To hash UTF-8 data, see the note above.
41+
* keccak256("Hello World")
42+
* //_error:
3943
*/
4044
export function keccak256(_data: BytesLike): string {
4145
const data = getBytes(_data, "data");

src.ts/ethers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export {
127127
export type {
128128
JsonFragment, JsonFragmentType,
129129
InterfaceAbi,
130+
ParamTypeWalkFunc, ParamTypeWalkAsyncFunc
130131
} from "./abi/index.js";
131132

132133
export type { Addressable } from "./address/index.js";

src.ts/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* The Application Programming Interface (API) is the collection of
33
* functions, classes and types offered by the Ethers library.
44
*
5-
* @_section: api:API Specification [about-api]
5+
* @_section: api:Application Programming Interface [about-api]
66
* @_navTitle: API
77
*/
88
import * as ethers from "./ethers.js";

src.ts/utils/base64.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* [Base64 encoding](link-base64) using 6-bit words to encode
2+
* [Base64 encoding](link-wiki-base64) using 6-bit words to encode
33
* arbitrary bytes into a string using 65 printable symbols, the
44
* upper-case and lower-case alphabet, the digits ``0`` through ``9``,
55
* ``"+"`` and ``"/"`` with the ``"="`` used for padding.

src.ts/utils/data.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ function zeroPad(data: BytesLike, length: number, left: boolean): string {
173173
/**
174174
* Return the [[DataHexString]] of %%data%% padded on the **left**
175175
* to %%length%% bytes.
176+
*
177+
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is
178+
* thrown.
179+
*
180+
* This pads data the same as **values** are in Solidity
181+
* (e.g. ``uint128``).
176182
*/
177183
export function zeroPadValue(data: BytesLike, length: number): string {
178184
return zeroPad(data, length, true);
@@ -181,6 +187,12 @@ export function zeroPadValue(data: BytesLike, length: number): string {
181187
/**
182188
* Return the [[DataHexString]] of %%data%% padded on the **right**
183189
* to %%length%% bytes.
190+
*
191+
* If %%data%% already exceeds %%length%%, a [[BufferOverrun]] is
192+
* thrown.
193+
*
194+
* This pads data the same as **bytes** are in Solidity
195+
* (e.g. ``bytes16``).
184196
*/
185197
export function zeroPadBytes(data: BytesLike, length: number): string {
186198
return zeroPad(data, length, false);

src.ts/utils/uuid.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Explain UUID and link to RFC here.
3+
*
4+
* @_subsection: api/utils:UUID [about-uuid]
5+
*/
16
import { getBytes, hexlify } from "./data.js";
27

38
import type { BytesLike } from "./index.js";

src.ts/wordlists/lang-cz.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export class LangCz extends WordlistOwl {
1717
*
1818
* Using the constructor should be unnecessary, instead use the
1919
* [[wordlist]] singleton method.
20+
*
21+
* @_ignore:
2022
*/
2123
constructor() { super("cz", words, checksum); }
2224

src.ts/wordlists/lang-en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export class LangEn extends WordlistOwl {
1717
*
1818
* This should be unnecessary most of the time as the exported
1919
* [[langEn]] should suffice.
20+
*
21+
* @_ignore:
2022
*/
2123
constructor() { super("en", words, checksum); }
2224

0 commit comments

Comments
 (0)