This repository has been archived by the owner on Jan 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from webmaster128/rlp-type
Export types used by decode/encode
- Loading branch information
Showing
2 changed files
with
18 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import BN = require('bn.js') | ||
|
||
export type RLPInput = Buffer | string | number | Uint8Array | BN | RLPObject | RLPArray | null | ||
export type Input = Buffer | string | number | Uint8Array | BN | Dictionary | List | null | ||
|
||
export interface RLPArray extends Array<RLPInput> {} | ||
interface RLPObject { | ||
[x: string]: RLPInput | ||
// Use interface extension instead of type alias to | ||
// make circular declaration possible. | ||
export interface List extends Array<Input> {} | ||
|
||
export interface Dictionary { | ||
[x: string]: Input | ||
} | ||
|
||
export interface RLPDecoded { | ||
export interface Decoded { | ||
data: Buffer | Buffer[] | ||
remainder: Buffer | ||
} |