@adyen/kyc-components
Version:
This guide assumes that you have already an account with Adyen. A legalEntity needs to be created, and you need to have a `legalEntityId` to instatiate a Component.
15 lines (14 loc) • 975 B
TypeScript
import type { UseQueryResult } from '@tanstack/preact-query';
import type { ExistingLegalEntity } from '../core/models/api/legal-entity';
import type { LegalEntityAssociationType } from '../core/models/api/legal-entity-association';
type UseAssociatedLegalEntity = Pick<UseQueryResult<ExistingLegalEntity>, 'data' | 'refetch' | 'isLoading'>;
/**
* Fetches and returns an entity of the given type which is associated to the given root legal entity.
* Also returns a callback that can be used to refetch the associated entity.
*
* @param parentLegalEntity the parent legal entity to find an associated entity for
* @param associationType the type of associated entity to fetch.
* If multiple types are provided, the first matching association is used.
*/
export declare function useAssociatedLegalEntity(parentLegalEntity: ExistingLegalEntity | undefined, associationType: LegalEntityAssociationType | LegalEntityAssociationType[]): UseAssociatedLegalEntity;
export {};