react-native-plaid-link-sdk
Version:
React Native Plaid Link SDK
35 lines (34 loc) • 2.08 kB
TypeScript
import { LinkEventListener, LinkOpenProps, LinkTokenConfiguration, FinanceKitError, SubmissionData } from './Types';
/**
* A hook that registers a listener on the Plaid emitter for the 'onEvent' type.
* The listener is cleaned up when this view is unmounted
*
* @param LinkEventListener the listener to call
*/
export declare const usePlaidEmitter: (linkEventListener: LinkEventListener) => void;
export declare const create: (props: LinkTokenConfiguration) => void;
export declare const open: (props: LinkOpenProps) => void;
/**
* Clears any previously created Plaid session and associated resources
* that were captured during a prior call to create(). This method should
* be invoked before starting a new layer session with create() to ensure
* proper cleanup and avoid conflicts from lingering state or resources.
*/
export declare const destroy: () => Promise<void>;
export declare const dismissLink: () => void;
export declare const submit: (data: SubmissionData) => void;
/**
* Function to sync the user's transactions from their Apple card.
*
* @param {string} token - The `LinkToken` your server retrieved from the /link/token/create endpoint from the Plaid API.
* This token must be associated with an accessToken.
* @param {boolean} requestAuthorizationIfNeeded - Indicates if the user should be prompted to authorize the sync if
* they have not already done so.
* @param {function} completion - A callback function that is called when the sync has completed.
*
* @warning This method only works on iOS >= 17.4.
* @warning This method is not supported on Android or MacCatalyst.
* @warning This method can only be used once the user has granted access to their Apple card via a standard Link Session.
* @warning This method requires that your app has been granted FinanceKit access from Apple.
*/
export declare const syncFinanceKit: (token: string, requestAuthorizationIfNeeded: boolean, simulatedBehavior: boolean, completion: (error?: FinanceKitError) => void) => void;