UNPKG

988 BTypeScriptView Raw
1import * as React from 'react';
2import { BearerInstance } from '@bearer/js';
3import { BearerContext } from './bearer-provider';
4declare type TAuthPayload = {
5 authId: string;
6 integration: string;
7};
8export interface IConnectProps {
9 integration: string;
10 authId?: string;
11 setupId: string;
12 onSuccess: (data: TAuthPayload) => void;
13 onError?: (data: {
14 authId?: string;
15 integration: string;
16 error: Error;
17 }) => void;
18 render: (props: {
19 loading: boolean;
20 connect: () => void;
21 error: any;
22 }) => JSX.Element;
23}
24declare class Connect extends React.Component<IConnectProps, {
25 error?: any;
26}> {
27 static contextType: React.Context<import("./bearer-provider").IBearerContextValue>;
28 context: React.ContextType<typeof BearerContext>;
29 constructor(props: IConnectProps);
30 setError(error: any): void;
31 connect(bearer: BearerInstance): () => void;
32 render(): JSX.Element;
33}
34export default Connect;