@wagmi/core 2.11.7 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/actions/codegen/createWriteContract.js.map +1 -1
- package/dist/esm/actions/watchAsset.js +11 -0
- package/dist/esm/actions/watchAsset.js.map +1 -0
- package/dist/esm/connectors/injected.js +7 -0
- package/dist/esm/connectors/injected.js.map +1 -1
- package/dist/esm/connectors/mock.js +8 -0
- package/dist/esm/connectors/mock.js.map +1 -1
- package/dist/esm/exports/actions.js +1 -0
- package/dist/esm/exports/actions.js.map +1 -1
- package/dist/esm/exports/index.js +1 -0
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/exports/query.js +1 -0
- package/dist/esm/exports/query.js.map +1 -1
- package/dist/esm/query/estimateGas.js.map +1 -1
- package/dist/esm/query/watchAsset.js +10 -0
- package/dist/esm/query/watchAsset.js.map +1 -0
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/actions/codegen/createReadContract.d.ts +2 -2
- package/dist/types/actions/codegen/createReadContract.d.ts.map +1 -1
- package/dist/types/actions/codegen/createSimulateContract.d.ts +2 -2
- package/dist/types/actions/codegen/createSimulateContract.d.ts.map +1 -1
- package/dist/types/actions/codegen/createWatchContractEvent.d.ts +2 -2
- package/dist/types/actions/codegen/createWatchContractEvent.d.ts.map +1 -1
- package/dist/types/actions/codegen/createWriteContract.d.ts +4 -4
- package/dist/types/actions/codegen/createWriteContract.d.ts.map +1 -1
- package/dist/types/actions/connect.d.ts +2 -2
- package/dist/types/actions/connect.d.ts.map +1 -1
- package/dist/types/actions/deployContract.d.ts +2 -2
- package/dist/types/actions/deployContract.d.ts.map +1 -1
- package/dist/types/actions/estimateFeesPerGas.d.ts +5 -5
- package/dist/types/actions/estimateFeesPerGas.d.ts.map +1 -1
- package/dist/types/actions/estimateGas.d.ts +2 -2
- package/dist/types/actions/estimateGas.d.ts.map +1 -1
- package/dist/types/actions/estimateMaxPriorityFeePerGas.d.ts +2 -2
- package/dist/types/actions/estimateMaxPriorityFeePerGas.d.ts.map +1 -1
- package/dist/types/actions/getBalance.d.ts +2 -2
- package/dist/types/actions/getBalance.d.ts.map +1 -1
- package/dist/types/actions/getBlock.d.ts +3 -3
- package/dist/types/actions/getBlock.d.ts.map +1 -1
- package/dist/types/actions/getBlockNumber.d.ts +2 -2
- package/dist/types/actions/getBlockNumber.d.ts.map +1 -1
- package/dist/types/actions/getBlockTransactionCount.d.ts +2 -2
- package/dist/types/actions/getBlockTransactionCount.d.ts.map +1 -1
- package/dist/types/actions/getBytecode.d.ts +2 -2
- package/dist/types/actions/getBytecode.d.ts.map +1 -1
- package/dist/types/actions/getClient.d.ts +2 -2
- package/dist/types/actions/getClient.d.ts.map +1 -1
- package/dist/types/actions/getConnections.d.ts +2 -2
- package/dist/types/actions/getConnections.d.ts.map +1 -1
- package/dist/types/actions/getConnectorClient.d.ts +3 -3
- package/dist/types/actions/getConnectorClient.d.ts.map +1 -1
- package/dist/types/actions/getEnsAddress.d.ts +2 -2
- package/dist/types/actions/getEnsAddress.d.ts.map +1 -1
- package/dist/types/actions/getEnsAvatar.d.ts +2 -2
- package/dist/types/actions/getEnsAvatar.d.ts.map +1 -1
- package/dist/types/actions/getEnsName.d.ts +2 -2
- package/dist/types/actions/getEnsName.d.ts.map +1 -1
- package/dist/types/actions/getEnsResolver.d.ts +2 -2
- package/dist/types/actions/getEnsResolver.d.ts.map +1 -1
- package/dist/types/actions/getEnsText.d.ts +2 -2
- package/dist/types/actions/getEnsText.d.ts.map +1 -1
- package/dist/types/actions/getFeeHistory.d.ts +2 -2
- package/dist/types/actions/getFeeHistory.d.ts.map +1 -1
- package/dist/types/actions/getGasPrice.d.ts +2 -2
- package/dist/types/actions/getGasPrice.d.ts.map +1 -1
- package/dist/types/actions/getProof.d.ts +2 -2
- package/dist/types/actions/getProof.d.ts.map +1 -1
- package/dist/types/actions/getPublicClient.d.ts +2 -2
- package/dist/types/actions/getPublicClient.d.ts.map +1 -1
- package/dist/types/actions/getStorageAt.d.ts +2 -2
- package/dist/types/actions/getStorageAt.d.ts.map +1 -1
- package/dist/types/actions/getToken.d.ts +2 -2
- package/dist/types/actions/getToken.d.ts.map +1 -1
- package/dist/types/actions/getTransaction.d.ts +3 -3
- package/dist/types/actions/getTransaction.d.ts.map +1 -1
- package/dist/types/actions/getTransactionCount.d.ts +2 -2
- package/dist/types/actions/getTransactionCount.d.ts.map +1 -1
- package/dist/types/actions/getTransactionReceipt.d.ts +3 -3
- package/dist/types/actions/getTransactionReceipt.d.ts.map +1 -1
- package/dist/types/actions/getWalletClient.d.ts +2 -2
- package/dist/types/actions/getWalletClient.d.ts.map +1 -1
- package/dist/types/actions/prepareTransactionRequest.d.ts +3 -3
- package/dist/types/actions/prepareTransactionRequest.d.ts.map +1 -1
- package/dist/types/actions/reconnect.d.ts +2 -2
- package/dist/types/actions/reconnect.d.ts.map +1 -1
- package/dist/types/actions/sendTransaction.d.ts +2 -2
- package/dist/types/actions/sendTransaction.d.ts.map +1 -1
- package/dist/types/actions/signMessage.d.ts +2 -2
- package/dist/types/actions/signMessage.d.ts.map +1 -1
- package/dist/types/actions/signTypedData.d.ts +2 -2
- package/dist/types/actions/signTypedData.d.ts.map +1 -1
- package/dist/types/actions/simulateContract.d.ts +3 -3
- package/dist/types/actions/simulateContract.d.ts.map +1 -1
- package/dist/types/actions/switchChain.d.ts +3 -3
- package/dist/types/actions/switchChain.d.ts.map +1 -1
- package/dist/types/actions/verifyMessage.d.ts +2 -2
- package/dist/types/actions/verifyMessage.d.ts.map +1 -1
- package/dist/types/actions/verifyTypedData.d.ts +2 -2
- package/dist/types/actions/verifyTypedData.d.ts.map +1 -1
- package/dist/types/actions/waitForTransactionReceipt.d.ts +3 -3
- package/dist/types/actions/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/types/actions/watchAsset.d.ts +12 -0
- package/dist/types/actions/watchAsset.d.ts.map +1 -0
- package/dist/types/actions/watchBlockNumber.d.ts +2 -2
- package/dist/types/actions/watchBlockNumber.d.ts.map +1 -1
- package/dist/types/actions/watchBlocks.d.ts +2 -2
- package/dist/types/actions/watchBlocks.d.ts.map +1 -1
- package/dist/types/actions/watchContractEvent.d.ts +2 -2
- package/dist/types/actions/watchContractEvent.d.ts.map +1 -1
- package/dist/types/actions/watchPendingTransactions.d.ts +2 -2
- package/dist/types/actions/watchPendingTransactions.d.ts.map +1 -1
- package/dist/types/actions/writeContract.d.ts +3 -3
- package/dist/types/actions/writeContract.d.ts.map +1 -1
- package/dist/types/connectors/createConnector.d.ts +5 -5
- package/dist/types/connectors/createConnector.d.ts.map +1 -1
- package/dist/types/connectors/injected.d.ts +3 -3
- package/dist/types/connectors/injected.d.ts.map +1 -1
- package/dist/types/connectors/mock.d.ts +1 -0
- package/dist/types/connectors/mock.d.ts.map +1 -1
- package/dist/types/createConfig.d.ts +3 -3
- package/dist/types/createConfig.d.ts.map +1 -1
- package/dist/types/createStorage.d.ts +3 -3
- package/dist/types/createStorage.d.ts.map +1 -1
- package/dist/types/errors/base.d.ts +2 -2
- package/dist/types/errors/base.d.ts.map +1 -1
- package/dist/types/experimental/actions/sendCalls.d.ts +2 -2
- package/dist/types/experimental/actions/sendCalls.d.ts.map +1 -1
- package/dist/types/experimental/actions/writeContracts.d.ts +2 -2
- package/dist/types/experimental/actions/writeContracts.d.ts.map +1 -1
- package/dist/types/experimental/query/getCallsStatus.d.ts +2 -2
- package/dist/types/experimental/query/getCallsStatus.d.ts.map +1 -1
- package/dist/types/experimental/query/getCapabilities.d.ts +2 -2
- package/dist/types/experimental/query/getCapabilities.d.ts.map +1 -1
- package/dist/types/experimental/query/sendCalls.d.ts +4 -4
- package/dist/types/experimental/query/sendCalls.d.ts.map +1 -1
- package/dist/types/experimental/query/showCallsStatus.d.ts +4 -4
- package/dist/types/experimental/query/showCallsStatus.d.ts.map +1 -1
- package/dist/types/experimental/query/writeContracts.d.ts +4 -4
- package/dist/types/experimental/query/writeContracts.d.ts.map +1 -1
- package/dist/types/exports/actions.d.ts +1 -0
- package/dist/types/exports/actions.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts +1 -0
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/exports/internal.d.ts +1 -1
- package/dist/types/exports/internal.d.ts.map +1 -1
- package/dist/types/exports/query.d.ts +1 -0
- package/dist/types/exports/query.d.ts.map +1 -1
- package/dist/types/query/call.d.ts +2 -2
- package/dist/types/query/call.d.ts.map +1 -1
- package/dist/types/query/deployContract.d.ts +4 -4
- package/dist/types/query/deployContract.d.ts.map +1 -1
- package/dist/types/query/estimateFeesPerGas.d.ts +2 -2
- package/dist/types/query/estimateFeesPerGas.d.ts.map +1 -1
- package/dist/types/query/estimateGas.d.ts +2 -2
- package/dist/types/query/estimateGas.d.ts.map +1 -1
- package/dist/types/query/estimateMaxPriorityFeePerGas.d.ts +2 -2
- package/dist/types/query/estimateMaxPriorityFeePerGas.d.ts.map +1 -1
- package/dist/types/query/getBalance.d.ts +3 -3
- package/dist/types/query/getBalance.d.ts.map +1 -1
- package/dist/types/query/getBlock.d.ts +2 -2
- package/dist/types/query/getBlock.d.ts.map +1 -1
- package/dist/types/query/getBlockNumber.d.ts +2 -2
- package/dist/types/query/getBlockNumber.d.ts.map +1 -1
- package/dist/types/query/getBlockTransactionCount.d.ts +2 -2
- package/dist/types/query/getBlockTransactionCount.d.ts.map +1 -1
- package/dist/types/query/getBytecode.d.ts +2 -2
- package/dist/types/query/getBytecode.d.ts.map +1 -1
- package/dist/types/query/getConnectorClient.d.ts +2 -2
- package/dist/types/query/getConnectorClient.d.ts.map +1 -1
- package/dist/types/query/getEnsAddress.d.ts +2 -2
- package/dist/types/query/getEnsAddress.d.ts.map +1 -1
- package/dist/types/query/getEnsAvatar.d.ts +2 -2
- package/dist/types/query/getEnsAvatar.d.ts.map +1 -1
- package/dist/types/query/getEnsName.d.ts +2 -2
- package/dist/types/query/getEnsName.d.ts.map +1 -1
- package/dist/types/query/getEnsResolver.d.ts +2 -2
- package/dist/types/query/getEnsResolver.d.ts.map +1 -1
- package/dist/types/query/getEnsText.d.ts +2 -2
- package/dist/types/query/getEnsText.d.ts.map +1 -1
- package/dist/types/query/getFeeHistory.d.ts +2 -2
- package/dist/types/query/getFeeHistory.d.ts.map +1 -1
- package/dist/types/query/getGasPrice.d.ts +2 -2
- package/dist/types/query/getGasPrice.d.ts.map +1 -1
- package/dist/types/query/getProof.d.ts +2 -2
- package/dist/types/query/getProof.d.ts.map +1 -1
- package/dist/types/query/getStorageAt.d.ts +2 -2
- package/dist/types/query/getStorageAt.d.ts.map +1 -1
- package/dist/types/query/getToken.d.ts +2 -2
- package/dist/types/query/getToken.d.ts.map +1 -1
- package/dist/types/query/getTransaction.d.ts +2 -2
- package/dist/types/query/getTransaction.d.ts.map +1 -1
- package/dist/types/query/getTransactionConfirmations.d.ts +2 -2
- package/dist/types/query/getTransactionConfirmations.d.ts.map +1 -1
- package/dist/types/query/getTransactionCount.d.ts +3 -3
- package/dist/types/query/getTransactionCount.d.ts.map +1 -1
- package/dist/types/query/getTransactionReceipt.d.ts +2 -2
- package/dist/types/query/getTransactionReceipt.d.ts.map +1 -1
- package/dist/types/query/getWalletClient.d.ts +2 -2
- package/dist/types/query/getWalletClient.d.ts.map +1 -1
- package/dist/types/query/infiniteReadContracts.d.ts +2 -2
- package/dist/types/query/infiniteReadContracts.d.ts.map +1 -1
- package/dist/types/query/prepareTransactionRequest.d.ts +2 -2
- package/dist/types/query/prepareTransactionRequest.d.ts.map +1 -1
- package/dist/types/query/readContract.d.ts +6 -6
- package/dist/types/query/readContract.d.ts.map +1 -1
- package/dist/types/query/reconnect.d.ts +2 -2
- package/dist/types/query/reconnect.d.ts.map +1 -1
- package/dist/types/query/sendTransaction.d.ts +4 -4
- package/dist/types/query/sendTransaction.d.ts.map +1 -1
- package/dist/types/query/signMessage.d.ts +2 -2
- package/dist/types/query/signMessage.d.ts.map +1 -1
- package/dist/types/query/signTypedData.d.ts +2 -2
- package/dist/types/query/signTypedData.d.ts.map +1 -1
- package/dist/types/query/simulateContract.d.ts +2 -2
- package/dist/types/query/simulateContract.d.ts.map +1 -1
- package/dist/types/query/switchAccount.d.ts +3 -3
- package/dist/types/query/switchAccount.d.ts.map +1 -1
- package/dist/types/query/switchChain.d.ts +6 -6
- package/dist/types/query/switchChain.d.ts.map +1 -1
- package/dist/types/query/types.d.ts +5 -5
- package/dist/types/query/types.d.ts.map +1 -1
- package/dist/types/query/verifyMessage.d.ts +2 -2
- package/dist/types/query/verifyMessage.d.ts.map +1 -1
- package/dist/types/query/waitForTransactionReceipt.d.ts +2 -2
- package/dist/types/query/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/types/query/watchAsset.d.ts +22 -0
- package/dist/types/query/watchAsset.d.ts.map +1 -0
- package/dist/types/query/writeContract.d.ts +3 -3
- package/dist/types/query/writeContract.d.ts.map +1 -1
- package/dist/types/types/utils.d.ts +9 -9
- package/dist/types/types/utils.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/actions/codegen/createReadContract.ts +3 -3
- package/src/actions/codegen/createSimulateContract.ts +3 -3
- package/src/actions/codegen/createWatchContractEvent.ts +3 -3
- package/src/actions/codegen/createWriteContract.ts +8 -4
- package/src/actions/connect.ts +2 -2
- package/src/actions/deployContract.ts +2 -2
- package/src/actions/estimateFeesPerGas.ts +5 -5
- package/src/actions/estimateGas.ts +2 -2
- package/src/actions/estimateMaxPriorityFeePerGas.ts +2 -2
- package/src/actions/getBalance.ts +2 -2
- package/src/actions/getBlock.ts +3 -3
- package/src/actions/getBlockNumber.ts +2 -2
- package/src/actions/getBlockTransactionCount.ts +2 -2
- package/src/actions/getBytecode.ts +2 -2
- package/src/actions/getClient.ts +2 -2
- package/src/actions/getConnections.ts +2 -2
- package/src/actions/getConnectorClient.ts +3 -3
- package/src/actions/getEnsAddress.ts +2 -2
- package/src/actions/getEnsAvatar.ts +2 -2
- package/src/actions/getEnsName.ts +2 -2
- package/src/actions/getEnsResolver.ts +2 -2
- package/src/actions/getEnsText.ts +2 -2
- package/src/actions/getFeeHistory.ts +2 -2
- package/src/actions/getGasPrice.ts +2 -2
- package/src/actions/getProof.ts +2 -2
- package/src/actions/getPublicClient.ts +2 -2
- package/src/actions/getStorageAt.ts +2 -2
- package/src/actions/getToken.ts +2 -2
- package/src/actions/getTransaction.ts +3 -3
- package/src/actions/getTransactionCount.ts +2 -2
- package/src/actions/getTransactionReceipt.ts +3 -3
- package/src/actions/getWalletClient.ts +2 -2
- package/src/actions/prepareTransactionRequest.ts +6 -6
- package/src/actions/reconnect.ts +2 -2
- package/src/actions/sendTransaction.ts +2 -2
- package/src/actions/signMessage.ts +2 -2
- package/src/actions/signTypedData.ts +2 -2
- package/src/actions/simulateContract.ts +6 -6
- package/src/actions/switchChain.ts +3 -3
- package/src/actions/verifyMessage.ts +2 -2
- package/src/actions/verifyTypedData.ts +2 -2
- package/src/actions/waitForTransactionReceipt.ts +3 -3
- package/src/actions/watchAsset.ts +44 -0
- package/src/actions/watchBlockNumber.ts +2 -2
- package/src/actions/watchBlocks.ts +2 -2
- package/src/actions/watchContractEvent.ts +2 -2
- package/src/actions/watchPendingTransactions.ts +2 -2
- package/src/actions/writeContract.ts +4 -4
- package/src/connectors/createConnector.ts +5 -5
- package/src/connectors/injected.ts +11 -4
- package/src/connectors/mock.ts +12 -0
- package/src/createConfig.ts +3 -3
- package/src/createStorage.ts +3 -3
- package/src/errors/base.ts +2 -2
- package/src/experimental/actions/sendCalls.ts +2 -2
- package/src/experimental/actions/writeContracts.ts +2 -2
- package/src/experimental/query/getCallsStatus.ts +2 -2
- package/src/experimental/query/getCapabilities.ts +2 -2
- package/src/experimental/query/sendCalls.ts +6 -6
- package/src/experimental/query/showCallsStatus.ts +6 -6
- package/src/experimental/query/writeContracts.ts +6 -6
- package/src/exports/actions.ts +6 -0
- package/src/exports/index.ts +7 -0
- package/src/exports/internal.ts +5 -5
- package/src/exports/query.ts +8 -0
- package/src/query/call.ts +2 -2
- package/src/query/deployContract.ts +6 -6
- package/src/query/estimateFeesPerGas.ts +2 -2
- package/src/query/estimateGas.ts +3 -2
- package/src/query/estimateMaxPriorityFeePerGas.ts +2 -2
- package/src/query/getBalance.ts +3 -3
- package/src/query/getBlock.ts +2 -2
- package/src/query/getBlockNumber.ts +2 -2
- package/src/query/getBlockTransactionCount.ts +2 -2
- package/src/query/getBytecode.ts +2 -2
- package/src/query/getConnectorClient.ts +2 -2
- package/src/query/getEnsAddress.ts +2 -2
- package/src/query/getEnsAvatar.ts +2 -2
- package/src/query/getEnsName.ts +2 -2
- package/src/query/getEnsResolver.ts +2 -2
- package/src/query/getEnsText.ts +2 -2
- package/src/query/getFeeHistory.ts +2 -2
- package/src/query/getGasPrice.ts +2 -2
- package/src/query/getProof.ts +2 -2
- package/src/query/getStorageAt.ts +2 -2
- package/src/query/getToken.ts +2 -2
- package/src/query/getTransaction.ts +2 -2
- package/src/query/getTransactionConfirmations.ts +2 -2
- package/src/query/getTransactionCount.ts +3 -3
- package/src/query/getTransactionReceipt.ts +2 -2
- package/src/query/getWalletClient.ts +2 -2
- package/src/query/infiniteReadContracts.ts +2 -2
- package/src/query/prepareTransactionRequest.ts +2 -2
- package/src/query/readContract.ts +2 -2
- package/src/query/reconnect.ts +2 -2
- package/src/query/sendTransaction.ts +6 -6
- package/src/query/signMessage.ts +2 -2
- package/src/query/signTypedData.ts +2 -2
- package/src/query/simulateContract.ts +2 -2
- package/src/query/switchAccount.ts +3 -3
- package/src/query/switchChain.ts +7 -7
- package/src/query/types.ts +7 -7
- package/src/query/verifyMessage.ts +2 -2
- package/src/query/waitForTransactionReceipt.ts +2 -2
- package/src/query/watchAsset.ts +42 -0
- package/src/query/writeContract.ts +2 -2
- package/src/types/utils.ts +12 -10
- package/src/version.ts +1 -1
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
} from '../actions/getTransaction.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
10
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { Compute, ExactPartial } from '../types/utils.js'
|
|
12
12
|
import { filterQueryOptions } from './utils.js'
|
|
13
13
|
|
|
14
14
|
export type GetTransactionOptions<
|
|
15
15
|
config extends Config,
|
|
16
16
|
chainId extends config['chains'][number]['id'],
|
|
17
|
-
> =
|
|
17
|
+
> = Compute<
|
|
18
18
|
ExactPartial<GetTransactionParameters<config, chainId>> & ScopeKeyParameter
|
|
19
19
|
>
|
|
20
20
|
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '../actions/getTransactionConfirmations.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
10
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { UnionExactPartial } from '../types/utils.js'
|
|
12
12
|
import { filterQueryOptions } from './utils.js'
|
|
13
13
|
|
|
14
14
|
export type GetTransactionConfirmationsOptions<
|
|
@@ -16,7 +16,7 @@ export type GetTransactionConfirmationsOptions<
|
|
|
16
16
|
chainId extends
|
|
17
17
|
| config['chains'][number]['id']
|
|
18
18
|
| undefined = config['chains'][number]['id'],
|
|
19
|
-
> =
|
|
19
|
+
> = UnionExactPartial<GetTransactionConfirmationsParameters<config, chainId>> &
|
|
20
20
|
ScopeKeyParameter
|
|
21
21
|
|
|
22
22
|
export function getTransactionConfirmationsQueryOptions<
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
} from '../actions/getTransactionCount.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
10
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { Compute, PartialBy } from '../types/utils.js'
|
|
12
12
|
import { filterQueryOptions } from './utils.js'
|
|
13
13
|
|
|
14
|
-
export type GetTransactionCountOptions<config extends Config> =
|
|
14
|
+
export type GetTransactionCountOptions<config extends Config> = Compute<
|
|
15
15
|
PartialBy<GetTransactionCountParameters<config>, 'address'> &
|
|
16
16
|
ScopeKeyParameter
|
|
17
17
|
>
|
|
@@ -40,7 +40,7 @@ export function getTransactionCountQueryOptions<config extends Config>(
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export type GetTransactionCountQueryFnData =
|
|
43
|
-
|
|
43
|
+
Compute<GetTransactionCountReturnType>
|
|
44
44
|
|
|
45
45
|
export type GetTransactionCountData = GetTransactionCountQueryFnData
|
|
46
46
|
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
import type { GetTransactionReceiptReturnType } from '../actions/getTransactionReceipt.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
10
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { Compute, ExactPartial } from '../types/utils.js'
|
|
12
12
|
import { filterQueryOptions } from './utils.js'
|
|
13
13
|
|
|
14
14
|
export type GetTransactionReceiptOptions<
|
|
15
15
|
config extends Config,
|
|
16
16
|
chainId extends config['chains'][number]['id'],
|
|
17
|
-
> =
|
|
17
|
+
> = Compute<
|
|
18
18
|
ExactPartial<GetTransactionReceiptParameters<config, chainId>> &
|
|
19
19
|
ScopeKeyParameter
|
|
20
20
|
>
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
} from '../actions/getWalletClient.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
10
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { Compute, ExactPartial } from '../types/utils.js'
|
|
12
12
|
import { filterQueryOptions } from './utils.js'
|
|
13
13
|
|
|
14
14
|
export type GetWalletClientOptions<
|
|
15
15
|
config extends Config,
|
|
16
16
|
chainId extends config['chains'][number]['id'],
|
|
17
|
-
> =
|
|
17
|
+
> = Compute<
|
|
18
18
|
ExactPartial<GetWalletClientParameters<config, chainId>> & ScopeKeyParameter
|
|
19
19
|
>
|
|
20
20
|
|
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
ChainIdParameter,
|
|
11
11
|
ScopeKeyParameter,
|
|
12
12
|
} from '../types/properties.js'
|
|
13
|
-
import type {
|
|
13
|
+
import type { StrictOmit } from '../types/utils.js'
|
|
14
14
|
import type { InfiniteQueryOptions } from './types.js'
|
|
15
15
|
import { filterQueryOptions } from './utils.js'
|
|
16
16
|
|
|
@@ -24,7 +24,7 @@ export type InfiniteReadContractsOptions<
|
|
|
24
24
|
contracts(
|
|
25
25
|
pageParam: pageParam,
|
|
26
26
|
): ReadContractsParameters<contracts, allowFailure, config>['contracts']
|
|
27
|
-
} &
|
|
27
|
+
} & StrictOmit<
|
|
28
28
|
ReadContractsParameters<contracts, allowFailure, config>,
|
|
29
29
|
'contracts'
|
|
30
30
|
> &
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import type { Config } from '../createConfig.js'
|
|
12
12
|
import type { SelectChains } from '../types/chain.js'
|
|
13
13
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
14
|
-
import type {
|
|
14
|
+
import type { UnionExactPartial } from '../types/utils.js'
|
|
15
15
|
import { filterQueryOptions } from './utils.js'
|
|
16
16
|
|
|
17
17
|
export type PrepareTransactionRequestOptions<
|
|
@@ -21,7 +21,7 @@ export type PrepareTransactionRequestOptions<
|
|
|
21
21
|
SelectChains<config, chainId>[0],
|
|
22
22
|
SelectChains<config, chainId>[0]
|
|
23
23
|
>,
|
|
24
|
-
> =
|
|
24
|
+
> = UnionExactPartial<
|
|
25
25
|
PrepareTransactionRequestParameters<config, chainId, request>
|
|
26
26
|
> &
|
|
27
27
|
ScopeKeyParameter
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from '../actions/readContract.js'
|
|
10
10
|
import type { Config } from '../createConfig.js'
|
|
11
11
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
12
|
-
import type {
|
|
12
|
+
import type { UnionExactPartial } from '../types/utils.js'
|
|
13
13
|
import { filterQueryOptions } from './utils.js'
|
|
14
14
|
|
|
15
15
|
export type ReadContractOptions<
|
|
@@ -17,7 +17,7 @@ export type ReadContractOptions<
|
|
|
17
17
|
functionName extends ContractFunctionName<abi, 'pure' | 'view'>,
|
|
18
18
|
args extends ContractFunctionArgs<abi, 'pure' | 'view', functionName>,
|
|
19
19
|
config extends Config,
|
|
20
|
-
> =
|
|
20
|
+
> = UnionExactPartial<ReadContractParameters<abi, functionName, args, config>> &
|
|
21
21
|
ScopeKeyParameter
|
|
22
22
|
|
|
23
23
|
export function readContractQueryOptions<
|
package/src/query/reconnect.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
reconnect,
|
|
8
8
|
} from '../actions/reconnect.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import type { Mutate, MutateAsync } from './types.js'
|
|
12
12
|
|
|
13
13
|
export function reconnectMutationOptions(config: Config) {
|
|
@@ -23,7 +23,7 @@ export function reconnectMutationOptions(config: Config) {
|
|
|
23
23
|
>
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export type ReconnectData =
|
|
26
|
+
export type ReconnectData = Compute<ReconnectReturnType>
|
|
27
27
|
|
|
28
28
|
export type ReconnectVariables = ReconnectParameters | undefined
|
|
29
29
|
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
sendTransaction,
|
|
8
8
|
} from '../actions/sendTransaction.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
|
|
12
12
|
export function sendTransactionMutationOptions<config extends Config>(
|
|
13
13
|
config: config,
|
|
@@ -24,7 +24,7 @@ export function sendTransactionMutationOptions<config extends Config>(
|
|
|
24
24
|
>
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export type SendTransactionData =
|
|
27
|
+
export type SendTransactionData = Compute<SendTransactionReturnType>
|
|
28
28
|
|
|
29
29
|
export type SendTransactionVariables<
|
|
30
30
|
config extends Config,
|
|
@@ -36,11 +36,11 @@ export type SendTransactionMutate<config extends Config, context = unknown> = <
|
|
|
36
36
|
>(
|
|
37
37
|
variables: SendTransactionVariables<config, chainId>,
|
|
38
38
|
options?:
|
|
39
|
-
|
|
|
39
|
+
| Compute<
|
|
40
40
|
MutateOptions<
|
|
41
41
|
SendTransactionData,
|
|
42
42
|
SendTransactionErrorType,
|
|
43
|
-
|
|
43
|
+
Compute<SendTransactionVariables<config, chainId>>,
|
|
44
44
|
context
|
|
45
45
|
>
|
|
46
46
|
>
|
|
@@ -53,11 +53,11 @@ export type SendTransactionMutateAsync<
|
|
|
53
53
|
> = <chainId extends config['chains'][number]['id']>(
|
|
54
54
|
variables: SendTransactionVariables<config, chainId>,
|
|
55
55
|
options?:
|
|
56
|
-
|
|
|
56
|
+
| Compute<
|
|
57
57
|
MutateOptions<
|
|
58
58
|
SendTransactionData,
|
|
59
59
|
SendTransactionErrorType,
|
|
60
|
-
|
|
60
|
+
Compute<SendTransactionVariables<config, chainId>>,
|
|
61
61
|
context
|
|
62
62
|
>
|
|
63
63
|
>
|
package/src/query/signMessage.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
signMessage,
|
|
8
8
|
} from '../actions/signMessage.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import type { Mutate, MutateAsync } from './types.js'
|
|
12
12
|
|
|
13
13
|
export function signMessageMutationOptions(config: Config) {
|
|
@@ -25,7 +25,7 @@ export function signMessageMutationOptions(config: Config) {
|
|
|
25
25
|
|
|
26
26
|
export type SignMessageData = SignMessageReturnType
|
|
27
27
|
|
|
28
|
-
export type SignMessageVariables =
|
|
28
|
+
export type SignMessageVariables = Compute<SignMessageParameters>
|
|
29
29
|
|
|
30
30
|
export type SignMessageMutate<context = unknown> = Mutate<
|
|
31
31
|
SignMessageData,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
signTypedData,
|
|
9
9
|
} from '../actions/signTypedData.js'
|
|
10
10
|
import type { Config } from '../createConfig.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { Compute } from '../types/utils.js'
|
|
12
12
|
|
|
13
13
|
export function signTypedDataMutationOptions<config extends Config>(
|
|
14
14
|
config: config,
|
|
@@ -25,7 +25,7 @@ export function signTypedDataMutationOptions<config extends Config>(
|
|
|
25
25
|
>
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export type SignTypedDataData =
|
|
28
|
+
export type SignTypedDataData = Compute<SignTypedDataReturnType>
|
|
29
29
|
|
|
30
30
|
export type SignTypedDataVariables<
|
|
31
31
|
typedData extends TypedData | Record<string, unknown> = TypedData,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from '../actions/simulateContract.js'
|
|
10
10
|
import type { Config } from '../createConfig.js'
|
|
11
11
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
12
|
-
import type {
|
|
12
|
+
import type { UnionExactPartial } from '../types/utils.js'
|
|
13
13
|
import { filterQueryOptions } from './utils.js'
|
|
14
14
|
|
|
15
15
|
export type SimulateContractOptions<
|
|
@@ -22,7 +22,7 @@ export type SimulateContractOptions<
|
|
|
22
22
|
>,
|
|
23
23
|
config extends Config,
|
|
24
24
|
chainId extends config['chains'][number]['id'] | undefined,
|
|
25
|
-
> =
|
|
25
|
+
> = UnionExactPartial<
|
|
26
26
|
SimulateContractParameters<abi, functionName, args, config, chainId>
|
|
27
27
|
> &
|
|
28
28
|
ScopeKeyParameter
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
switchAccount,
|
|
8
8
|
} from '../actions/switchAccount.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import type { Mutate, MutateAsync } from './types.js'
|
|
12
12
|
|
|
13
13
|
export function switchAccountMutationOptions<config extends Config>(
|
|
@@ -25,11 +25,11 @@ export function switchAccountMutationOptions<config extends Config>(
|
|
|
25
25
|
>
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export type SwitchAccountData<config extends Config> =
|
|
28
|
+
export type SwitchAccountData<config extends Config> = Compute<
|
|
29
29
|
SwitchAccountReturnType<config>
|
|
30
30
|
>
|
|
31
31
|
|
|
32
|
-
export type SwitchAccountVariables =
|
|
32
|
+
export type SwitchAccountVariables = Compute<SwitchAccountParameters>
|
|
33
33
|
|
|
34
34
|
export type SwitchAccountMutate<
|
|
35
35
|
config extends Config,
|
package/src/query/switchChain.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
switchChain,
|
|
8
8
|
} from '../actions/switchChain.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
11
|
|
|
12
12
|
export function switchChainMutationOptions<config extends Config>(
|
|
13
13
|
config: config,
|
|
@@ -27,23 +27,23 @@ export function switchChainMutationOptions<config extends Config>(
|
|
|
27
27
|
export type SwitchChainData<
|
|
28
28
|
config extends Config,
|
|
29
29
|
chainId extends config['chains'][number]['id'],
|
|
30
|
-
> =
|
|
30
|
+
> = Compute<SwitchChainReturnType<config, chainId>>
|
|
31
31
|
|
|
32
32
|
export type SwitchChainVariables<
|
|
33
33
|
config extends Config,
|
|
34
34
|
chainId extends config['chains'][number]['id'],
|
|
35
|
-
> =
|
|
35
|
+
> = Compute<SwitchChainParameters<config, chainId>>
|
|
36
36
|
|
|
37
37
|
export type SwitchChainMutate<config extends Config, context = unknown> = <
|
|
38
38
|
chainId extends config['chains'][number]['id'],
|
|
39
39
|
>(
|
|
40
40
|
variables: SwitchChainVariables<config, chainId>,
|
|
41
41
|
options?:
|
|
42
|
-
|
|
|
42
|
+
| Compute<
|
|
43
43
|
MutateOptions<
|
|
44
44
|
SwitchChainData<config, chainId>,
|
|
45
45
|
SwitchChainErrorType,
|
|
46
|
-
|
|
46
|
+
Compute<SwitchChainVariables<config, chainId>>,
|
|
47
47
|
context
|
|
48
48
|
>
|
|
49
49
|
>
|
|
@@ -55,11 +55,11 @@ export type SwitchChainMutateAsync<config extends Config, context = unknown> = <
|
|
|
55
55
|
>(
|
|
56
56
|
variables: SwitchChainVariables<config, chainId>,
|
|
57
57
|
options?:
|
|
58
|
-
|
|
|
58
|
+
| Compute<
|
|
59
59
|
MutateOptions<
|
|
60
60
|
SwitchChainData<config, chainId>,
|
|
61
61
|
SwitchChainErrorType,
|
|
62
|
-
|
|
62
|
+
Compute<SwitchChainVariables<config, chainId>>,
|
|
63
63
|
context
|
|
64
64
|
>
|
|
65
65
|
>
|
package/src/query/types.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type {
|
|
|
6
6
|
QueryKey,
|
|
7
7
|
} from '@tanstack/query-core'
|
|
8
8
|
|
|
9
|
-
import type {
|
|
9
|
+
import type { Compute, StrictOmit } from '../types/utils.js'
|
|
10
10
|
|
|
11
11
|
export type InfiniteQueryOptions<
|
|
12
12
|
queryFnData = unknown,
|
|
@@ -31,9 +31,9 @@ export type InfiniteQueryOptions<
|
|
|
31
31
|
queryKey,
|
|
32
32
|
pageParam
|
|
33
33
|
>,
|
|
34
|
-
> =
|
|
34
|
+
> = Compute<
|
|
35
35
|
// `queryFn` doesn't pass through `pageParam` correctly
|
|
36
|
-
|
|
36
|
+
StrictOmit<options, 'queryFn'> & {
|
|
37
37
|
queryFn?(
|
|
38
38
|
context: QueryFunctionContext<queryKey, pageParam>,
|
|
39
39
|
): options['queryFn'] extends (...args: any) => any
|
|
@@ -54,7 +54,7 @@ export type Mutate<
|
|
|
54
54
|
variables = void,
|
|
55
55
|
context = unknown,
|
|
56
56
|
> = (
|
|
57
|
-
...args: Parameters<MutateFn<data, error,
|
|
57
|
+
...args: Parameters<MutateFn<data, error, Compute<variables>, context>>
|
|
58
58
|
) => void
|
|
59
59
|
|
|
60
60
|
export type MutateAsync<
|
|
@@ -62,7 +62,7 @@ export type MutateAsync<
|
|
|
62
62
|
error = unknown,
|
|
63
63
|
variables = void,
|
|
64
64
|
context = unknown,
|
|
65
|
-
> = MutateFn<data, error,
|
|
65
|
+
> = MutateFn<data, error, Compute<variables>, context>
|
|
66
66
|
|
|
67
67
|
type MutateFn<
|
|
68
68
|
data = unknown,
|
|
@@ -73,12 +73,12 @@ type MutateFn<
|
|
|
73
73
|
? (
|
|
74
74
|
variables?: variables,
|
|
75
75
|
options?:
|
|
76
|
-
|
|
|
76
|
+
| Compute<MutateOptions<data, error, variables, context>>
|
|
77
77
|
| undefined,
|
|
78
78
|
) => Promise<data>
|
|
79
79
|
: (
|
|
80
80
|
variables: variables,
|
|
81
81
|
options?:
|
|
82
|
-
|
|
|
82
|
+
| Compute<MutateOptions<data, error, variables, context>>
|
|
83
83
|
| undefined,
|
|
84
84
|
) => Promise<data>
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
} from '../actions/verifyMessage.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
10
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { Compute, ExactPartial } from '../types/utils.js'
|
|
12
12
|
import { filterQueryOptions } from './utils.js'
|
|
13
13
|
|
|
14
|
-
export type VerifyMessageOptions<config extends Config> =
|
|
14
|
+
export type VerifyMessageOptions<config extends Config> = Compute<
|
|
15
15
|
ExactPartial<VerifyMessageParameters<config>> & ScopeKeyParameter
|
|
16
16
|
>
|
|
17
17
|
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
} from '../actions/waitForTransactionReceipt.js'
|
|
9
9
|
import type { Config } from '../createConfig.js'
|
|
10
10
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { Compute, ExactPartial } from '../types/utils.js'
|
|
12
12
|
import { filterQueryOptions } from './utils.js'
|
|
13
13
|
|
|
14
14
|
export type WaitForTransactionReceiptOptions<
|
|
15
15
|
config extends Config,
|
|
16
16
|
chainId extends config['chains'][number]['id'],
|
|
17
|
-
> =
|
|
17
|
+
> = Compute<
|
|
18
18
|
ExactPartial<WaitForTransactionReceiptParameters<config, chainId>> &
|
|
19
19
|
ScopeKeyParameter
|
|
20
20
|
>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { MutationOptions } from '@tanstack/query-core'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type WatchAssetErrorType,
|
|
5
|
+
type WatchAssetParameters,
|
|
6
|
+
type WatchAssetReturnType,
|
|
7
|
+
watchAsset,
|
|
8
|
+
} from '../actions/watchAsset.js'
|
|
9
|
+
import type { Config } from '../createConfig.js'
|
|
10
|
+
import type { Compute } from '../types/utils.js'
|
|
11
|
+
import type { Mutate, MutateAsync } from './types.js'
|
|
12
|
+
|
|
13
|
+
export function watchAssetMutationOptions(config: Config) {
|
|
14
|
+
return {
|
|
15
|
+
mutationFn(variables) {
|
|
16
|
+
return watchAsset(config, variables)
|
|
17
|
+
},
|
|
18
|
+
mutationKey: ['watchAsset'],
|
|
19
|
+
} as const satisfies MutationOptions<
|
|
20
|
+
WatchAssetData,
|
|
21
|
+
WatchAssetErrorType,
|
|
22
|
+
WatchAssetVariables
|
|
23
|
+
>
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type WatchAssetData = WatchAssetReturnType
|
|
27
|
+
|
|
28
|
+
export type WatchAssetVariables = Compute<WatchAssetParameters>
|
|
29
|
+
|
|
30
|
+
export type WatchAssetMutate<context = unknown> = Mutate<
|
|
31
|
+
WatchAssetData,
|
|
32
|
+
WatchAssetErrorType,
|
|
33
|
+
WatchAssetVariables,
|
|
34
|
+
context
|
|
35
|
+
>
|
|
36
|
+
|
|
37
|
+
export type WatchAssetMutateAsync<context = unknown> = MutateAsync<
|
|
38
|
+
WatchAssetData,
|
|
39
|
+
WatchAssetErrorType,
|
|
40
|
+
WatchAssetVariables,
|
|
41
|
+
context
|
|
42
|
+
>
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
writeContract,
|
|
9
9
|
} from '../actions/writeContract.js'
|
|
10
10
|
import type { Config } from '../createConfig.js'
|
|
11
|
-
import type {
|
|
11
|
+
import type { Compute } from '../types/utils.js'
|
|
12
12
|
|
|
13
13
|
export function writeContractMutationOptions<config extends Config>(
|
|
14
14
|
config: config,
|
|
@@ -31,7 +31,7 @@ export function writeContractMutationOptions<config extends Config>(
|
|
|
31
31
|
>
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export type WriteContractData =
|
|
34
|
+
export type WriteContractData = Compute<WriteContractReturnType>
|
|
35
35
|
|
|
36
36
|
export type WriteContractVariables<
|
|
37
37
|
abi extends Abi | readonly unknown[],
|
package/src/types/utils.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Combines members of an intersection into a readable type. */
|
|
2
2
|
// https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg
|
|
3
|
-
export type
|
|
3
|
+
export type Compute<type> = { [key in keyof type]: type[key] } & unknown
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Makes all properties of an object optional.
|
|
@@ -36,7 +36,7 @@ export type IsNever<type> = [type] extends [never] ? true : false
|
|
|
36
36
|
export type IsUnknown<type> = unknown extends type ? true : false
|
|
37
37
|
|
|
38
38
|
/** Merges two object types into new type */
|
|
39
|
-
export type Merge<obj1, obj2> =
|
|
39
|
+
export type Merge<obj1, obj2> = Compute<
|
|
40
40
|
LooseOmit<obj1, keyof obj2 extends infer key extends string ? key : never> &
|
|
41
41
|
obj2
|
|
42
42
|
>
|
|
@@ -47,7 +47,7 @@ export type Mutable<type extends object> = {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/** Strict version of built-in Omit type */
|
|
50
|
-
export type
|
|
50
|
+
export type StrictOmit<type, keys extends keyof type> = Pick<
|
|
51
51
|
type,
|
|
52
52
|
Exclude<keyof type, keys>
|
|
53
53
|
>
|
|
@@ -58,7 +58,7 @@ export type OneOf<
|
|
|
58
58
|
///
|
|
59
59
|
keys extends KeyofUnion<union> = KeyofUnion<union>,
|
|
60
60
|
> = union extends infer Item
|
|
61
|
-
?
|
|
61
|
+
? Compute<Item & { [K in Exclude<keys, keyof Item>]?: undefined }>
|
|
62
62
|
: never
|
|
63
63
|
type KeyofUnion<type> = type extends type ? keyof type : never
|
|
64
64
|
|
|
@@ -67,7 +67,7 @@ type KeyofUnion<type> = type extends type ? keyof type : never
|
|
|
67
67
|
export type PartialBy<type, key extends keyof type> = ExactPartial<
|
|
68
68
|
Pick<type, key>
|
|
69
69
|
> &
|
|
70
|
-
|
|
70
|
+
StrictOmit<type, key>
|
|
71
71
|
|
|
72
72
|
/* Removes `undefined` from object property */
|
|
73
73
|
export type RemoveUndefined<type> = {
|
|
@@ -77,7 +77,7 @@ export type RemoveUndefined<type> = {
|
|
|
77
77
|
///////////////////////////////////////////////////////////////////////////
|
|
78
78
|
// Loose types
|
|
79
79
|
|
|
80
|
-
/** Loose version of {@link
|
|
80
|
+
/** Loose version of {@link StrictOmit} */
|
|
81
81
|
export type LooseOmit<type, keys extends string> = Pick<
|
|
82
82
|
type,
|
|
83
83
|
Exclude<keyof type, keys>
|
|
@@ -86,14 +86,16 @@ export type LooseOmit<type, keys extends string> = Pick<
|
|
|
86
86
|
///////////////////////////////////////////////////////////////////////////
|
|
87
87
|
// Union types
|
|
88
88
|
|
|
89
|
-
export type
|
|
89
|
+
export type UnionCompute<type> = type extends object ? Compute<type> : type
|
|
90
90
|
|
|
91
91
|
export type UnionLooseOmit<type, keys extends string> = type extends any
|
|
92
92
|
? LooseOmit<type, keys>
|
|
93
93
|
: never
|
|
94
94
|
|
|
95
|
-
export type
|
|
96
|
-
?
|
|
95
|
+
export type UnionStrictOmit<type, keys extends keyof type> = type extends any
|
|
96
|
+
? StrictOmit<type, keys>
|
|
97
97
|
: never
|
|
98
98
|
|
|
99
|
-
export type
|
|
99
|
+
export type UnionExactPartial<type> = type extends object
|
|
100
|
+
? ExactPartial<type>
|
|
101
|
+
: type
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.
|
|
1
|
+
export const version = '2.12.0'
|