UNPKG

@apideck/react-vault

Version:

<br />

85 lines (84 loc) 2.97 kB
import React, { ReactElement } from 'react'; import { Connection } from '../types/Connection'; import { ConnectionViewType } from '../types/ConnectionViewType'; import '../utils/i18n'; export interface Props { /** * The JSON Web Token returned from the Create Session call */ token: string; /** * The component that should trigger the File Picker modal on click */ trigger?: ReactElement; /** * Show powered by Apideck in the modal backdrop */ showAttribution?: boolean; /** * Opens the file picker if set to true */ open?: boolean; /** * Callback function that gets called when the modal is closed */ onClose?: () => any; /** * Callback function that gets called when the user updates a connection. This can be linking their account, filling out settings or adding a new connection */ onConnectionChange?: (connection: Connection) => any; /** * Callback function that gets called when the user deletes a connection */ onConnectionDelete?: (connection: Connection) => any; /** * Optionally you can filter connection on API. You can also provide the unifiedApi to go straight to the connection details view. * It that case make sure you also pass the serviceId. */ unifiedApi?: string; /** * Optionally you can give a serviceId to go straight to the connection details view * Make sure you also pass the unifiedApi */ serviceId?: string; /** * Optionally you can give a unifyBaseUrl for changing the base url of the unified API * Should only be used for local development or in a staging environment */ unifyBaseUrl?: string; /** * Optionally you can show the consumer metadata information in the modal * The consumer metadata should be provided when creating a session * @default false * */ showConsumer?: boolean; /** * Optionally you can directly open one of the following views: 'configurable-resources', 'custom-mapping', 'settings' * @default false * */ initialView?: ConnectionViewType; /** * Optionally you can directly and one of the following locales: 'en', 'nl', 'fr', 'es', and 'de'. * @default en * */ locale?: string; /** * Optionally you can show the language switch dropdown in the modal * @default false * */ showLanguageSwitch?: boolean; /** * Use button layout instead of dropdown menu in TopBar for connection actions * @default false * */ showButtonLayout?: boolean; /** * Optionally you can auto start the authorization process * @default false * */ autoStartAuthorization?: boolean; } /** * The Apideck Vault component */ export declare const Vault: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;