@bigmi/react
Version:
React primitives for Bitcoin apps.
16 lines (15 loc) • 1.34 kB
TypeScript
import { type Config, type ConnectData, type ConnectErrorType, type ConnectMutate, type ConnectMutateAsync, type ConnectVariables } from '@bigmi/client';
import type { Compute } from '@bigmi/core';
import type { ResolvedRegister } from '../types.js';
import type { UseMutationParameters, UseMutationReturnType } from '../utils/query.js';
import { type ConfigParameter } from './useConfig.js';
import { type UseConnectorsReturnType } from './useConnectors.js';
export type UseConnectParameters<config extends Config = Config, context = unknown> = Compute<ConfigParameter<config> & {
mutation?: UseMutationParameters<ConnectData<config>, ConnectErrorType, ConnectVariables<config, config['connectors'][number]>, context> | undefined;
}>;
export type UseConnectReturnType<config extends Config = Config, context = unknown> = Compute<UseMutationReturnType<ConnectData<config>, ConnectErrorType, ConnectVariables<config, config['connectors'][number]>, context> & {
connect: ConnectMutate<config, context>;
connectAsync: ConnectMutateAsync<config, context>;
connectors: Compute<UseConnectorsReturnType> | config['connectors'];
}>;
export declare function useConnect<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: UseConnectParameters<config, context>): UseConnectReturnType<config, context>;