From 44e3445a4d7b29b0ddbc9b21ed590ae9cfd9b36a Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Mon, 29 Mar 2021 16:12:47 +0800 Subject: [PATCH] fix: strip internal types from external declaration --- web3.js/rollup.config.js | 1 + web3.js/src/connection.ts | 2 +- web3.js/src/stake-program.ts | 1 + web3.js/src/system-program.ts | 1 + web3.js/src/transaction.ts | 4 ++-- web3.js/tsconfig.d.json | 6 ++++++ 6 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 web3.js/tsconfig.d.json diff --git a/web3.js/rollup.config.js b/web3.js/rollup.config.js index 383268c7b..808fb16ad 100644 --- a/web3.js/rollup.config.js +++ b/web3.js/rollup.config.js @@ -28,6 +28,7 @@ function generateConfig(configType, format) { generateTypescript ? typescript({ browserslist: false, + tsconfig: './tsconfig.d.json', }) : undefined, babel({ diff --git a/web3.js/src/connection.ts b/web3.js/src/connection.ts index 4ebd699e7..7ae7c90b7 100644 --- a/web3.js/src/connection.ts +++ b/web3.js/src/connection.ts @@ -1266,7 +1266,7 @@ const ParsedConfirmedTransactionMetaResult = pick({ /** * Expected JSON RPC response for the "getConfirmedBlock" message */ -export const GetConfirmedBlockRpcResult = jsonRpcResult( +const GetConfirmedBlockRpcResult = jsonRpcResult( nullable( pick({ blockhash: string(), diff --git a/web3.js/src/stake-program.ts b/web3.js/src/stake-program.ts index ec07edfff..00b3d99b8 100644 --- a/web3.js/src/stake-program.ts +++ b/web3.js/src/stake-program.ts @@ -398,6 +398,7 @@ export type StakeInstructionType = /** * An enumeration of valid stake InstructionType's + * @internal */ export const STAKE_INSTRUCTION_LAYOUTS: { [type in StakeInstructionType]: InstructionType; diff --git a/web3.js/src/system-program.ts b/web3.js/src/system-program.ts index b71946137..e358784a4 100644 --- a/web3.js/src/system-program.ts +++ b/web3.js/src/system-program.ts @@ -546,6 +546,7 @@ export type SystemInstructionType = /** * An enumeration of valid system InstructionType's + * @internal */ export const SYSTEM_INSTRUCTION_LAYOUTS: { [type in SystemInstructionType]: InstructionType; diff --git a/web3.js/src/transaction.ts b/web3.js/src/transaction.ts index 872cb7fb4..698310980 100644 --- a/web3.js/src/transaction.ts +++ b/web3.js/src/transaction.ts @@ -104,9 +104,9 @@ export class TransactionInstruction { } /** - * @internal + * Pair of signature and corresponding public key */ -type SignaturePubkeyPair = { +export type SignaturePubkeyPair = { signature: Buffer | null; publicKey: PublicKey; }; diff --git a/web3.js/tsconfig.d.json b/web3.js/tsconfig.d.json new file mode 100644 index 000000000..8283ec15d --- /dev/null +++ b/web3.js/tsconfig.d.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "stripInternal": true, + } +}