PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.15.5
GiveWP – Donation Plugin and Fundraising Platform v4.15.5
4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 All 257 releases
give / src / DonationForms / resources / registrars / index.ts

index.ts in GiveWP – Donation Plugin and Fundraising Platform 4.15.5, at src/DonationForms/resources/registrars/index.ts

44 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import GatewayRegistrar from './gateways';
2 import type {DonationConfirmationReceiptServerExports, FormServerExports} from '@givewp/forms/types';
3 import type {useFormContext, useFormState, useWatch} from 'react-hook-form';
4 import defaultFormTemplates from './templates';
5 import useCurrencyFormatter from '@givewp/forms/app/hooks/useCurrencyFormatter';
6 import useDonationSummary from '@givewp/forms/app/hooks/useDonationSummary';
7 import {useDonationFormSettings} from '@givewp/forms/app/store/form-settings';
8 import useFormSubmitButton from '@givewp/forms/app/hooks/useFormSubmitButton';
9 import useFormData from '@givewp/forms/app/hooks/useFormData';
10
11 declare global {
12 interface Window {
13 givewpDonationFormExports: FormServerExports;
14 givewpDonationConfirmationReceiptExports: DonationConfirmationReceiptServerExports;
15 givewp: {
16 gateways: GatewayRegistrar;
17 form: {
18 templates: typeof defaultFormTemplates;
19 hooks: {
20 useFormContext: typeof useFormContext;
21 useWatch: typeof useWatch;
22 useFormState: typeof useFormState;
23 useCurrencyFormatter: typeof useCurrencyFormatter;
24 useDonationSummary: typeof useDonationSummary;
25 useDonationFormSettings: typeof useDonationFormSettings;
26 useFormSubmitButton: typeof useFormSubmitButton;
27 useFormData: typeof useFormData;
28 };
29 };
30 };
31 }
32 }
33
34 if (!window.givewp) {
35 // @ts-ignore
36 window.givewp = {
37 // @ts-ignore
38 form: {},
39 };
40 }
41
42 window.givewp.gateways = new GatewayRegistrar();
43 window.givewp.form.templates = Object.freeze(defaultFormTemplates);
44