Skip to content

Commit

Permalink
feat: namespace types
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Aug 15, 2024
1 parent b59b680 commit 0784292
Show file tree
Hide file tree
Showing 21 changed files with 532 additions and 677 deletions.
57 changes: 5 additions & 52 deletions src/Bytes.ts
Original file line number Diff line number Diff line change
@@ -1,65 +1,29 @@
export {
type ConcatErrorType,
type ConcatReturnType,
concat,
} from './internal/data/concat.js'
export { concat } from './internal/data/concat.js'

export {
type IsBytesErrorType,
isBytes,
} from './internal/data/isBytes.js'
export { isBytes } from './internal/data/isBytes.js'

export {
type IsBytesEqualErrorType as IsEqualErrorType,
isBytesEqual as isEqual,
} from './internal/data/isBytesEqual.js'
export { isBytesEqual as isEqual } from './internal/data/isBytesEqual.js'

export {
type PadLeftErrorType,
type PadLeftReturnType,
type PadRightErrorType,
type PadRightReturnType,
padLeft,
padRight,
} from './internal/data/pad.js'

export {
type SliceErrorType,
slice,
} from './internal/data/slice.js'
export { slice } from './internal/data/slice.js'

export {
type SizeErrorType,
size,
} from './internal/data/size.js'
export { size } from './internal/data/size.js'

export {
type TrimLeftErrorType,
type TrimLeftReturnType,
type TrimRightErrorType,
type TrimRightReturnType,
trimLeft,
trimRight,
} from './internal/data/trim.js'

export {
type RandomBytesErrorType,
randomBytes,
randomBytes as random,
} from './internal/data/random.js'

export {
type FromBytesErrorType,
type FromBytesOptions,
type FromBytesReturnType,
type BytesToBigIntErrorType,
type BytesToBigIntOptions,
type BytesToBooleanErrorType,
type BytesToBooleanOptions,
type BytesToNumberErrorType,
type BytesToNumberOptions,
type BytesToStringErrorType,
type BytesToStringOptions,
fromBytes,
fromBytes as to,
bytesToBigInt,
Expand All @@ -73,15 +37,6 @@ export {
} from './internal/bytes/fromBytes.js'

export {
type BooleanToBytesErrorType,
type BooleanToBytesOptions,
type HexToBytesErrorType,
type HexToBytesOptions,
type NumberToBytesErrorType,
type StringToBytesErrorType,
type StringToBytesOptions,
type ToBytesErrorType,
type ToBytesOptions,
booleanToBytes,
booleanToBytes as fromBoolean,
hexToBytes,
Expand All @@ -96,8 +51,6 @@ export {
} from './internal/bytes/toBytes.js'

export {
type BytesToHexErrorType,
type BytesToHexOptions,
bytesToHex,
bytesToHex as toHex,
} from './internal/hex/toHex.js'
Expand Down
41 changes: 7 additions & 34 deletions src/Data.ts
Original file line number Diff line number Diff line change
@@ -1,50 +1,23 @@
export {
type ConcatErrorType,
type ConcatReturnType,
concat,
} from './internal/data/concat.js'
export { concat } from './internal/data/concat.js'

export { type IsBytesErrorType, isBytes } from './internal/data/isBytes.js'
export { isBytes } from './internal/data/isBytes.js'

export {
type IsHexOptions,
type IsHexErrorType,
isHex,
} from './internal/data/isHex.js'
export { isHex } from './internal/data/isHex.js'

export {
type PadLeftErrorType,
type PadLeftReturnType,
type PadRightErrorType,
type PadRightReturnType,
padLeft,
padRight,
} from './internal/data/pad.js'

export {
type IsBytesEqualErrorType,
isBytesEqual,
} from './internal/data/isBytesEqual.js'
export { isBytesEqual } from './internal/data/isBytesEqual.js'

export {
type RandomBytesErrorType,
randomBytes,
} from './internal/data/random.js'
export { randomBytes } from './internal/data/random.js'

export { type SizeErrorType, size } from './internal/data/size.js'
export { size } from './internal/data/size.js'

export {
type SliceOptions,
type SliceErrorType,
type SliceReturnType,
slice,
} from './internal/data/slice.js'
export { slice } from './internal/data/slice.js'

export {
type TrimLeftErrorType,
type TrimLeftReturnType,
type TrimRightErrorType,
type TrimRightReturnType,
trimLeft,
trimRight,
} from './internal/data/trim.js'
57 changes: 5 additions & 52 deletions src/Hex.ts
Original file line number Diff line number Diff line change
@@ -1,59 +1,24 @@
export {
type ConcatErrorType,
type ConcatReturnType,
concat,
} from './internal/data/concat.js'
export { concat } from './internal/data/concat.js'

export {
type IsHexErrorType,
isHex,
} from './internal/data/isHex.js'
export { isHex } from './internal/data/isHex.js'

export {
type IsBytesEqualErrorType as IsEqualErrorType,
isBytesEqual as isEqual,
} from './internal/data/isBytesEqual.js'
export { isBytesEqual as isEqual } from './internal/data/isBytesEqual.js'

export {
type PadLeftErrorType,
type PadLeftReturnType,
type PadRightErrorType,
type PadRightReturnType,
padLeft,
padRight,
} from './internal/data/pad.js'

export {
type SliceErrorType,
slice,
} from './internal/data/slice.js'
export { slice } from './internal/data/slice.js'

export {
type SizeErrorType,
size,
} from './internal/data/size.js'
export { size } from './internal/data/size.js'

export {
type TrimLeftErrorType,
type TrimLeftReturnType,
type TrimRightErrorType,
type TrimRightReturnType,
trimLeft,
trimRight,
} from './internal/data/trim.js'

export {
type FromHexErrorType,
type FromHexOptions,
type FromHexReturnType,
type HexToBigIntErrorType,
type HexToBigIntOptions,
type HexToBooleanErrorType,
type HexToBooleanOptions,
type HexToNumberErrorType,
type HexToNumberOptions,
type HexToStringErrorType,
type HexToStringOptions,
fromHex,
fromHex as to,
hexToBigInt,
Expand All @@ -67,23 +32,11 @@ export {
} from './internal/hex/fromHex.js'

export {
type HexToBytesErrorType,
type HexToBytesOptions,
hexToBytes,
hexToBytes as toBytes,
} from './internal/bytes/toBytes.js'

export {
type BooleanToHexErrorType,
type BooleanToHexOptions,
type BytesToHexErrorType,
type BytesToHexOptions,
type NumberToHexErrorType,
type NumberToHexOptions,
type StringToHexErrorType,
type StringToHexOptions,
type ToHexErrorType,
type ToHexParameters,
booleanToHex,
booleanToHex as fromBoolean,
bytesToHex,
Expand Down
8 changes: 0 additions & 8 deletions src/Rlp.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
export {
type FromRlpErrorType,
type FromRlpReturnType,
type RlpToBytesErrorType,
type RlpToHexErrorType,
fromRlp,
fromRlp as decode,
rlpToBytes,
Expand All @@ -13,10 +9,6 @@ export {

export {
type RecursiveArray,
type BytesToRlpErrorType,
type HexToRlpErrorType,
type ToRlpErrorType,
type ToRlpReturnType,
toRlp,
toRlp as encode,
bytesToRlp,
Expand Down
Loading

0 comments on commit 0784292

Please sign in to comment.