UNPKG

@blocklet/payment-react

Version:

Reusable react components for payment kit v2

35 lines (34 loc) 1.36 kB
import type { TSetting } from '@blocklet/payment-types'; import type { Axios } from 'axios'; export interface DonateConfigSettings { amount?: { presets?: string[]; preset?: string; custom: boolean; minimum?: string; maximum?: string; }; btnText?: string; historyType?: 'table' | 'avatar'; } export type DonateContextType = { settings: TSetting; refresh: (forceRefresh?: boolean) => void; updateSettings: (newSettings: DonateConfigSettings) => Promise<void>; api: Axios; }; export type DonateContextProps = { mountLocation: string; description: string; defaultSettings?: DonateConfigSettings; children: any; active?: boolean; enableDonate?: boolean; }; declare const DonateContext: import("react").Context<DonateContextType>; declare const Consumer: import("react").Consumer<DonateContextType>; declare function DonateProvider({ mountLocation, description, defaultSettings, children, active, enableDonate, }: DonateContextProps): import("react").JSX.Element | null; declare function useDonateContext(): DonateContextType; export declare const clearDonateCache: (mountLocation: string) => void; export declare const clearDonateSettings: (mountLocation: string) => Promise<void>; export { DonateContext, DonateProvider, Consumer as DonateConsumer, useDonateContext };