From 49a5ddcd546a0bcf59f39a50b7b0649ad491d1bf Mon Sep 17 00:00:00 2001 From: Yury Saukou Date: Fri, 20 Dec 2024 13:22:35 +0400 Subject: [PATCH] STTYPES-15 Provide TS definitions for claiming feature in the `stripes-acq-components` lib (#74) * STTYPES-15 Provide TS definitions for claiming feature in the stripes-acq-components lib * modals and selection typings * add messages for modals props * update types * update interface --- CHANGELOG.md | 3 +- .../useRecordsSelect/useRecordsSelect.d.ts | 20 ++++++++++++- acq-components/lib/FindRecords/index.d.ts | 1 + .../lib/claiming/components/index.d.ts | 2 ++ .../DelayClaimActionMenuItem.d.ts | 6 ++++ .../DelayClaimActionMenuItem/index.d.ts | 1 + .../MarkUnreceivableActionMenuItem.d.ts | 6 ++++ .../MarkUnreceivableActionMenuItem/index.d.ts | 1 + .../SendClaimActionMenuItem.d.ts | 6 ++++ .../SendClaimActionMenuItem/index.d.ts | 1 + .../claiming/components/menu-items/index.d.ts | 3 ++ .../DelayClaimsModal/DelayClaimsModal.d.ts | 20 +++++++++++++ .../modals/DelayClaimsModal/index.d.ts | 1 + .../SendClaimsModal/SendClaimsModal.d.ts | 19 +++++++++++++ .../modals/SendClaimsModal/index.d.ts | 1 + .../lib/claiming/components/modals/index.d.ts | 2 ++ acq-components/lib/claiming/hooks/index.d.ts | 2 ++ .../claiming/hooks/useClaimsDelay/index.d.ts | 1 + .../hooks/useClaimsDelay/useClaimsDelay.d.ts | 14 ++++++++++ .../claiming/hooks/useClaimsSend/index.d.ts | 1 + .../hooks/useClaimsSend/useClaimsSend.d.ts | 28 +++++++++++++++++++ acq-components/lib/claiming/index.d.ts | 3 ++ .../utils/getClaimingIntervalFromDate.d.ts | 3 ++ acq-components/lib/claiming/utils/index.d.ts | 1 + acq-components/lib/hooks/index.d.ts | 1 + .../usePiecesStatusBatchUpdate/index.d.ts | 1 + .../usePiecesStatusBatchUpdate.d.ts | 21 ++++++++++++++ .../hooks/useShowCallout/useShowCallout.d.ts | 12 +++++++- acq-components/lib/index.d.ts | 1 + .../ResponseErrorsContainer.d.ts | 2 +- .../lib/utils/errorHandling/index.d.ts | 5 +++- final-form/index.d.ts | 2 +- final-form/lib/stripesFinalForm.d.ts | 2 ++ 33 files changed, 187 insertions(+), 6 deletions(-) create mode 100644 acq-components/lib/claiming/components/index.d.ts create mode 100644 acq-components/lib/claiming/components/menu-items/DelayClaimActionMenuItem/DelayClaimActionMenuItem.d.ts create mode 100644 acq-components/lib/claiming/components/menu-items/DelayClaimActionMenuItem/index.d.ts create mode 100644 acq-components/lib/claiming/components/menu-items/MarkUnreceivableActionMenuItem/MarkUnreceivableActionMenuItem.d.ts create mode 100644 acq-components/lib/claiming/components/menu-items/MarkUnreceivableActionMenuItem/index.d.ts create mode 100644 acq-components/lib/claiming/components/menu-items/SendClaimActionMenuItem/SendClaimActionMenuItem.d.ts create mode 100644 acq-components/lib/claiming/components/menu-items/SendClaimActionMenuItem/index.d.ts create mode 100644 acq-components/lib/claiming/components/menu-items/index.d.ts create mode 100644 acq-components/lib/claiming/components/modals/DelayClaimsModal/DelayClaimsModal.d.ts create mode 100644 acq-components/lib/claiming/components/modals/DelayClaimsModal/index.d.ts create mode 100644 acq-components/lib/claiming/components/modals/SendClaimsModal/SendClaimsModal.d.ts create mode 100644 acq-components/lib/claiming/components/modals/SendClaimsModal/index.d.ts create mode 100644 acq-components/lib/claiming/components/modals/index.d.ts create mode 100644 acq-components/lib/claiming/hooks/index.d.ts create mode 100644 acq-components/lib/claiming/hooks/useClaimsDelay/index.d.ts create mode 100644 acq-components/lib/claiming/hooks/useClaimsDelay/useClaimsDelay.d.ts create mode 100644 acq-components/lib/claiming/hooks/useClaimsSend/index.d.ts create mode 100644 acq-components/lib/claiming/hooks/useClaimsSend/useClaimsSend.d.ts create mode 100644 acq-components/lib/claiming/index.d.ts create mode 100644 acq-components/lib/claiming/utils/getClaimingIntervalFromDate.d.ts create mode 100644 acq-components/lib/claiming/utils/index.d.ts create mode 100644 acq-components/lib/hooks/usePiecesStatusBatchUpdate/index.d.ts create mode 100644 acq-components/lib/hooks/usePiecesStatusBatchUpdate/usePiecesStatusBatchUpdate.d.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index d00aae2..c0c81d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,8 @@ ## 2.3.0 in progress -[[STTYPES-13](https://folio-org.atlassian.net/browse/STTYPES-13)] Add actual types for `acq-components`, `components`, `core` and `smart-components`. +[STTYPES-13](https://folio-org.atlassian.net/browse/STTYPES-13) Add actual types for `acq-components`, `components`, `core` and `smart-components`. +[STTYPES-15](https://folio-org.atlassian.net/browse/STTYPES-15) Provide TS definitions for claiming feature in the `stripes-acq-components` library. ## [2.2.0](https://github.com/folio-org/stripes-types/tree/v2.2.0) (2024-10-11) diff --git a/acq-components/lib/FindRecords/hooks/useRecordsSelect/useRecordsSelect.d.ts b/acq-components/lib/FindRecords/hooks/useRecordsSelect/useRecordsSelect.d.ts index c2cb70c..ea390d1 100644 --- a/acq-components/lib/FindRecords/hooks/useRecordsSelect/useRecordsSelect.d.ts +++ b/acq-components/lib/FindRecords/hooks/useRecordsSelect/useRecordsSelect.d.ts @@ -1 +1,19 @@ -export const useRecordsSelect: any; +interface useRecordsSelectReturn { + allRecordsSelected: boolean; + isRecordSelected: ({ item: T }); + resetAllSelectedRecords: () => void; + /* + * Clear selected records with provided ids. + */ + resetSelectedRecordsByIds: (ids: string[]) => void; + /* + * Clear selected records except the ones with provided ids. + */ + resetOtherSelectedRecordsByIds: (ids: string[]) => void; + selectedRecordsLength: number; + selectedRecordsMap: Record; + selectRecord: (record: T) => void; + toggleSelectAll: () => void; +} + +export declare function useRecordsSelect({ records }: { records: T[] }): useRecordsSelectReturn; diff --git a/acq-components/lib/FindRecords/index.d.ts b/acq-components/lib/FindRecords/index.d.ts index 4fb1a2d..57e12b8 100644 --- a/acq-components/lib/FindRecords/index.d.ts +++ b/acq-components/lib/FindRecords/index.d.ts @@ -1 +1,2 @@ export * from './FindRecords'; +export { useRecordsSelect } from './hooks'; diff --git a/acq-components/lib/claiming/components/index.d.ts b/acq-components/lib/claiming/components/index.d.ts new file mode 100644 index 0000000..2393817 --- /dev/null +++ b/acq-components/lib/claiming/components/index.d.ts @@ -0,0 +1,2 @@ +export * from './menu-items'; +export * from './modals'; diff --git a/acq-components/lib/claiming/components/menu-items/DelayClaimActionMenuItem/DelayClaimActionMenuItem.d.ts b/acq-components/lib/claiming/components/menu-items/DelayClaimActionMenuItem/DelayClaimActionMenuItem.d.ts new file mode 100644 index 0000000..51a2b6b --- /dev/null +++ b/acq-components/lib/claiming/components/menu-items/DelayClaimActionMenuItem/DelayClaimActionMenuItem.d.ts @@ -0,0 +1,6 @@ +interface DelayClaimActionMenuItemProps { + disabled?: boolean; + onClick: (e?: Event) => void; +} + +export declare function DelayClaimActionMenuItem(props: DelayClaimActionMenuItemProps): React.JSX.Element; diff --git a/acq-components/lib/claiming/components/menu-items/DelayClaimActionMenuItem/index.d.ts b/acq-components/lib/claiming/components/menu-items/DelayClaimActionMenuItem/index.d.ts new file mode 100644 index 0000000..283eb6a --- /dev/null +++ b/acq-components/lib/claiming/components/menu-items/DelayClaimActionMenuItem/index.d.ts @@ -0,0 +1 @@ +export { DelayClaimActionMenuItem } from './DelayClaimActionMenuItem'; diff --git a/acq-components/lib/claiming/components/menu-items/MarkUnreceivableActionMenuItem/MarkUnreceivableActionMenuItem.d.ts b/acq-components/lib/claiming/components/menu-items/MarkUnreceivableActionMenuItem/MarkUnreceivableActionMenuItem.d.ts new file mode 100644 index 0000000..02a9e25 --- /dev/null +++ b/acq-components/lib/claiming/components/menu-items/MarkUnreceivableActionMenuItem/MarkUnreceivableActionMenuItem.d.ts @@ -0,0 +1,6 @@ +interface MarkUnreceivableActionMenuItemProps { + disabled?: boolean; + onClick: (e?: Event) => void; +} + +export declare function MarkUnreceivableActionMenuItem(props: MarkUnreceivableActionMenuItemProps): React.JSX.Element; diff --git a/acq-components/lib/claiming/components/menu-items/MarkUnreceivableActionMenuItem/index.d.ts b/acq-components/lib/claiming/components/menu-items/MarkUnreceivableActionMenuItem/index.d.ts new file mode 100644 index 0000000..3951ec2 --- /dev/null +++ b/acq-components/lib/claiming/components/menu-items/MarkUnreceivableActionMenuItem/index.d.ts @@ -0,0 +1 @@ +export { MarkUnreceivableActionMenuItem } from './MarkUnreceivableActionMenuItem'; diff --git a/acq-components/lib/claiming/components/menu-items/SendClaimActionMenuItem/SendClaimActionMenuItem.d.ts b/acq-components/lib/claiming/components/menu-items/SendClaimActionMenuItem/SendClaimActionMenuItem.d.ts new file mode 100644 index 0000000..477ccdf --- /dev/null +++ b/acq-components/lib/claiming/components/menu-items/SendClaimActionMenuItem/SendClaimActionMenuItem.d.ts @@ -0,0 +1,6 @@ +interface SendClaimActionMenuItemProps { + disabled?: boolean; + onClick: (e?: Event) => void; +} + +export declare function SendClaimActionMenuItem(props: SendClaimActionMenuItemProps): React.JSX.Element; diff --git a/acq-components/lib/claiming/components/menu-items/SendClaimActionMenuItem/index.d.ts b/acq-components/lib/claiming/components/menu-items/SendClaimActionMenuItem/index.d.ts new file mode 100644 index 0000000..fefefcb --- /dev/null +++ b/acq-components/lib/claiming/components/menu-items/SendClaimActionMenuItem/index.d.ts @@ -0,0 +1 @@ +export { SendClaimActionMenuItem } from './SendClaimActionMenuItem'; diff --git a/acq-components/lib/claiming/components/menu-items/index.d.ts b/acq-components/lib/claiming/components/menu-items/index.d.ts new file mode 100644 index 0000000..5705724 --- /dev/null +++ b/acq-components/lib/claiming/components/menu-items/index.d.ts @@ -0,0 +1,3 @@ +export { DelayClaimActionMenuItem } from './DelayClaimActionMenuItem'; +export { MarkUnreceivableActionMenuItem } from './MarkUnreceivableActionMenuItem'; +export { SendClaimActionMenuItem } from './SendClaimActionMenuItem'; diff --git a/acq-components/lib/claiming/components/modals/DelayClaimsModal/DelayClaimsModal.d.ts b/acq-components/lib/claiming/components/modals/DelayClaimsModal/DelayClaimsModal.d.ts new file mode 100644 index 0000000..1ea1c02 --- /dev/null +++ b/acq-components/lib/claiming/components/modals/DelayClaimsModal/DelayClaimsModal.d.ts @@ -0,0 +1,20 @@ +import { + FormProps, + FormRenderProps, +} from 'react-final-form'; + + +interface DelayClaimsModalOwnProps { + claimsCount: number; + disabled: boolean; + message?: React.JSX.Element, + onCancel: () => void; + open: boolean; +} + +type DelayClaimsModalProps> = + DelayClaimsModalOwnProps & + Pick, 'onSubmit'> & + Partial>; + +export declare const DelayClaimsModal: >(props: DelayClaimsModalProps) => React.JSX.Element; diff --git a/acq-components/lib/claiming/components/modals/DelayClaimsModal/index.d.ts b/acq-components/lib/claiming/components/modals/DelayClaimsModal/index.d.ts new file mode 100644 index 0000000..8eee29a --- /dev/null +++ b/acq-components/lib/claiming/components/modals/DelayClaimsModal/index.d.ts @@ -0,0 +1 @@ +export { DelayClaimsModal } from './DelayClaimsModal'; diff --git a/acq-components/lib/claiming/components/modals/SendClaimsModal/SendClaimsModal.d.ts b/acq-components/lib/claiming/components/modals/SendClaimsModal/SendClaimsModal.d.ts new file mode 100644 index 0000000..0094330 --- /dev/null +++ b/acq-components/lib/claiming/components/modals/SendClaimsModal/SendClaimsModal.d.ts @@ -0,0 +1,19 @@ +import { + FormProps, + FormRenderProps, +} from 'react-final-form'; + +interface SendClaimsModalOwnProps { + claimsCount: number; + disabled: boolean; + message?: React.JSX.Element, + onCancel: () => void; + open: boolean; +} + +type SendClaimsModalProps> = + SendClaimsModalOwnProps & + Pick, 'onSubmit'> & + Partial>; + +export declare const SendClaimsModal: >(props: SendClaimsModalProps) => React.JSX.Element; diff --git a/acq-components/lib/claiming/components/modals/SendClaimsModal/index.d.ts b/acq-components/lib/claiming/components/modals/SendClaimsModal/index.d.ts new file mode 100644 index 0000000..75e258b --- /dev/null +++ b/acq-components/lib/claiming/components/modals/SendClaimsModal/index.d.ts @@ -0,0 +1 @@ +export { SendClaimsModal } from './SendClaimsModal'; diff --git a/acq-components/lib/claiming/components/modals/index.d.ts b/acq-components/lib/claiming/components/modals/index.d.ts new file mode 100644 index 0000000..d030454 --- /dev/null +++ b/acq-components/lib/claiming/components/modals/index.d.ts @@ -0,0 +1,2 @@ +export { DelayClaimsModal } from './DelayClaimsModal'; +export { SendClaimsModal } from './SendClaimsModal'; diff --git a/acq-components/lib/claiming/hooks/index.d.ts b/acq-components/lib/claiming/hooks/index.d.ts new file mode 100644 index 0000000..7bdca91 --- /dev/null +++ b/acq-components/lib/claiming/hooks/index.d.ts @@ -0,0 +1,2 @@ +export { useClaimsDelay } from './useClaimsDelay'; +export { ClaimingPieceResult, useClaimsSend } from './useClaimsSend'; diff --git a/acq-components/lib/claiming/hooks/useClaimsDelay/index.d.ts b/acq-components/lib/claiming/hooks/useClaimsDelay/index.d.ts new file mode 100644 index 0000000..0be7a56 --- /dev/null +++ b/acq-components/lib/claiming/hooks/useClaimsDelay/index.d.ts @@ -0,0 +1 @@ +export { useClaimsDelay } from './useClaimsDelay'; diff --git a/acq-components/lib/claiming/hooks/useClaimsDelay/useClaimsDelay.d.ts b/acq-components/lib/claiming/hooks/useClaimsDelay/useClaimsDelay.d.ts new file mode 100644 index 0000000..63aea18 --- /dev/null +++ b/acq-components/lib/claiming/hooks/useClaimsDelay/useClaimsDelay.d.ts @@ -0,0 +1,14 @@ +import { usePiecesStatusBatchUpdate } from '../../../hooks'; + +interface useClaimsDelayReturn { + isLoading: boolean; + delayClaims: ({ + claimingInterval, + pieceIds, + }: { + claimingInterval: number, + pieceIds: string[], + }) => Promise>; +} + +export declare function useClaimsDelay(): useClaimsDelayReturn; diff --git a/acq-components/lib/claiming/hooks/useClaimsSend/index.d.ts b/acq-components/lib/claiming/hooks/useClaimsSend/index.d.ts new file mode 100644 index 0000000..dfba283 --- /dev/null +++ b/acq-components/lib/claiming/hooks/useClaimsSend/index.d.ts @@ -0,0 +1 @@ +export { ClaimingPieceResult, useClaimsSend } from './useClaimsSend'; diff --git a/acq-components/lib/claiming/hooks/useClaimsSend/useClaimsSend.d.ts b/acq-components/lib/claiming/hooks/useClaimsSend/useClaimsSend.d.ts new file mode 100644 index 0000000..e5a2c8e --- /dev/null +++ b/acq-components/lib/claiming/hooks/useClaimsSend/useClaimsSend.d.ts @@ -0,0 +1,28 @@ +interface SendClaimsData { + claimingPieceIds: string[]; + claimingInterval: number; + internalNote?: string; + externalNote?: string; +} + +export interface ClaimingPieceResult { + pieceId: string; + type: 'success' | 'failure'; + error?: { + code?: string; + message: string; + type?: string; + }; +} + +export interface SendClaimsResponse { + claimingPieceResults: ClaimingPieceResult[]; + totalRecords: number; +} + +interface useClaimsSendReturn { + isLoading: boolean; + sendClaims: ({ data }: { data: SendClaimsData }) => Promise; +} + +export declare function useClaimsSend(): useClaimsSendReturn; diff --git a/acq-components/lib/claiming/index.d.ts b/acq-components/lib/claiming/index.d.ts new file mode 100644 index 0000000..c55977d --- /dev/null +++ b/acq-components/lib/claiming/index.d.ts @@ -0,0 +1,3 @@ +export * from './components'; +export * from './hooks'; +export * from './utils'; diff --git a/acq-components/lib/claiming/utils/getClaimingIntervalFromDate.d.ts b/acq-components/lib/claiming/utils/getClaimingIntervalFromDate.d.ts new file mode 100644 index 0000000..3f8e1fe --- /dev/null +++ b/acq-components/lib/claiming/utils/getClaimingIntervalFromDate.d.ts @@ -0,0 +1,3 @@ +import dayjs from 'dayjs'; + +export declare function getClaimingIntervalFromDate(date: dayjs.ConfigType): number; diff --git a/acq-components/lib/claiming/utils/index.d.ts b/acq-components/lib/claiming/utils/index.d.ts new file mode 100644 index 0000000..6d40c1d --- /dev/null +++ b/acq-components/lib/claiming/utils/index.d.ts @@ -0,0 +1 @@ +export { getClaimingIntervalFromDate } from './getClaimingIntervalFromDate'; diff --git a/acq-components/lib/hooks/index.d.ts b/acq-components/lib/hooks/index.d.ts index e0eb648..3cf7022 100644 --- a/acq-components/lib/hooks/index.d.ts +++ b/acq-components/lib/hooks/index.d.ts @@ -15,6 +15,7 @@ export * from './useLocations'; export * from './useModalToggle'; export * from './useOrganization'; export * from './usePaneFocus'; +export * from './usePiecesStatusBatchUpdate'; export * from './useShowCallout'; export * from './useToggle'; export * from './useTranslatedCategories'; diff --git a/acq-components/lib/hooks/usePiecesStatusBatchUpdate/index.d.ts b/acq-components/lib/hooks/usePiecesStatusBatchUpdate/index.d.ts new file mode 100644 index 0000000..47b5c69 --- /dev/null +++ b/acq-components/lib/hooks/usePiecesStatusBatchUpdate/index.d.ts @@ -0,0 +1 @@ +export { usePiecesStatusBatchUpdate } from './usePiecesStatusBatchUpdate'; diff --git a/acq-components/lib/hooks/usePiecesStatusBatchUpdate/usePiecesStatusBatchUpdate.d.ts b/acq-components/lib/hooks/usePiecesStatusBatchUpdate/usePiecesStatusBatchUpdate.d.ts new file mode 100644 index 0000000..9007895 --- /dev/null +++ b/acq-components/lib/hooks/usePiecesStatusBatchUpdate/usePiecesStatusBatchUpdate.d.ts @@ -0,0 +1,21 @@ +export interface UpdatePiecesStatusData { + pieceIds: string[], + receivingStatus: ACQ.Piece.ReceivingStatus, + claimingInterval?: number, +} + +interface UpdatePiecesStatusErrorResponse { + errors: Array<{ + message: string; + code?: string; + }> +} + +export type UpdatePiecesStatusResponse = null | UpdatePiecesStatusErrorResponse; + +interface usePiecesStatusBatchUpdateReturn { + isLoading: boolean; + updatePiecesStatus: ({ data }: { data: UpdatePiecesStatusData }) => Promise; +} + +export declare function usePiecesStatusBatchUpdate(): usePiecesStatusBatchUpdateReturn; diff --git a/acq-components/lib/hooks/useShowCallout/useShowCallout.d.ts b/acq-components/lib/hooks/useShowCallout/useShowCallout.d.ts index 6df7ce6..94cc24c 100644 --- a/acq-components/lib/hooks/useShowCallout/useShowCallout.d.ts +++ b/acq-components/lib/hooks/useShowCallout/useShowCallout.d.ts @@ -1 +1,11 @@ -export const useShowCallout: any; +import { CalloutContextType } from '../../../../core'; + +type ShowCalloutFnArgs = Omit[0], 'message'> & { + message?: string | React.ReactNode, + messageId?: string, + values?: Record, +}; + +type ShowCalloutFn = (args: ShowCalloutFnArgs) => void; + +export declare function useShowCallout(): ShowCalloutFn; diff --git a/acq-components/lib/index.d.ts b/acq-components/lib/index.d.ts index e6967ab..c2e5905 100644 --- a/acq-components/lib/index.d.ts +++ b/acq-components/lib/index.d.ts @@ -9,6 +9,7 @@ export * from './AcqUnits'; export * from './AmountWithCurrencyField'; export * from './apiHooks'; export * from './BooleanFilter'; +export * from './claiming'; export * from './constants'; export * from './ContributorDetails'; export * from './CountryFilter'; diff --git a/acq-components/lib/utils/errorHandling/ResponseErrorsContainer.d.ts b/acq-components/lib/utils/errorHandling/ResponseErrorsContainer.d.ts index 3c9df18..aca8ec9 100644 --- a/acq-components/lib/utils/errorHandling/ResponseErrorsContainer.d.ts +++ b/acq-components/lib/utils/errorHandling/ResponseErrorsContainer.d.ts @@ -7,7 +7,7 @@ export interface ResponseErrorsContainerBody { } export interface ErrorHandlingStrategy { - handle(errors: ResponseErrorsContainer): void; + handle(errors: ResponseErrorsContainer): void | Promise; } /** diff --git a/acq-components/lib/utils/errorHandling/index.d.ts b/acq-components/lib/utils/errorHandling/index.d.ts index 872c1c8..82b4eb6 100644 --- a/acq-components/lib/utils/errorHandling/index.d.ts +++ b/acq-components/lib/utils/errorHandling/index.d.ts @@ -1 +1,4 @@ -export { ResponseErrorsContainer } from './ResponseErrorsContainer'; +export { + ErrorHandlingStrategy, + ResponseErrorsContainer, +} from './ResponseErrorsContainer'; diff --git a/final-form/index.d.ts b/final-form/index.d.ts index 08cae63..3272aa7 100644 --- a/final-form/index.d.ts +++ b/final-form/index.d.ts @@ -1,2 +1,2 @@ // targeted to stripes-final-form v7.0.0 -export { default } from './lib/stripesFinalForm'; +export { default, FormProps, FormRenderProps } from './lib/stripesFinalForm'; diff --git a/final-form/lib/stripesFinalForm.d.ts b/final-form/lib/stripesFinalForm.d.ts index 0b5f435..e610058 100644 --- a/final-form/lib/stripesFinalForm.d.ts +++ b/final-form/lib/stripesFinalForm.d.ts @@ -29,3 +29,5 @@ export default function stripesFinalForm< ): ( Component: ComponentType & ComponentProps> ) => ComponentType, extractedProps>>; + +export type { FormProps, FormRenderProps } from 'react-final-form';