import { type Types } from 'effect'; import { ProtocolVersion } from '@midnightntwrk/wallet-sdk-abstractions'; import { type VariantBuilder, type WalletLike } from './abstractions/index.js'; import { HList } from '@midnightntwrk/wallet-sdk-utilities'; /** * Builds a wallet-like implementation from a collection of wallet-like variants, each specific to a given version of * the Midnight protocol. * * @typeParam TBuilders The sequence of variant builders that will manage the wallet state */ export declare class WalletBuilder { #private; private constructor(); static init(): WalletBuilder<[]>; /** * Ensures that the built wallet uses a given variant. * * @param sinceVersion The Midnight protocol version that the variant should operate from. * @param variantBuilder A {@link VariantBuilder} that builds the variant. * @returns A new {@link WalletBuilder} that uses the variant that will be built from `variantBuilder`. */ withVariant(sinceVersion: ProtocolVersion.ProtocolVersion, variantBuilder: TBuilder): WalletBuilder>>; /** Builds a wallet like implementation. */ build(...[maybeConfiguration]: WalletBuilder.BuildArguments): WalletLike.BaseWalletClass, WalletBuilder.FullConfiguration>; } export declare namespace WalletBuilder { /** * The internal build state of {@link WalletBuilder}. * * @remarks * Represents the collection of configured variants and their configuration. */ type BuildState = { readonly variants: TBuilders; }; /** Allows properly expressing no need for configuration if an empty one needs to be provided */ type BuildArguments = VoidIfEmpty> extends undefined ? [] : [FullConfiguration]; type FullConfiguration = Types.UnionToIntersection>; type VoidIfEmpty = keyof TObject extends never ? undefined : TObject; type Configurations = VariantBuilder.ConfigurationOf>; }