@particle-network/connectkit
Version:
35 lines (34 loc) • 1.84 kB
TypeScript
import { type Connector, type ConnectorEventMap, type EventData, type State, type Storage, type WalletConnector, type WalletConnectorType } from '@particle-network/connector-core';
import type { Plugin } from '@particle-network/plugin-core';
import type { Chain } from 'viem/chains';
import { type StoreApi } from 'zustand/vanilla';
import type { Appearance, ConnectKitOptions } from './context/types';
export declare const createConfig: (options: ConnectKitOptions) => Config;
export type Config = {
readonly uid: string;
readonly options: ConnectKitOptions;
readonly plugins: Plugin[];
readonly chains: readonly [Chain, ...Chain[]];
readonly connectors: readonly Connector[];
readonly storage: Storage | null;
readonly walletConnectors: readonly WalletConnector[];
readonly state: State;
readonly appearanceStore: StoreApi<Appearance>;
setState(value: State | ((state: State) => State)): void;
subscribe<state>(selector: (state: State) => state, listener: (state: state, previousState: state) => void, options?: {
emitImmediately?: boolean | undefined;
equalityFn?: ((a: state, b: state) => boolean) | undefined;
} | undefined): () => void;
getWalletConnector: <properties extends Record<string, unknown> = Record<string, unknown>>(type: WalletConnectorType) => WalletConnector<properties> | undefined;
_internal: {
connectors: {
setup(connector: Connector): Connector;
subscribe(listener: (state: Connector[], prevState: Connector[]) => void): () => void;
};
events: {
change(data: EventData<ConnectorEventMap, 'change'>): void;
connect(data: EventData<ConnectorEventMap, 'connect'>): void;
disconnect(data: EventData<ConnectorEventMap, 'disconnect'>): void;
};
};
};