import { default as React, CSSProperties, ReactNode } from 'react';
import { Provider, NylasScope, ConnectResult as AuthResult, IdentityProviderTokenCallback, CodeExchangeMethod } from '@nylas/connect';

export type NylasConnectButtonProps = {
    clientId: string;
    redirectUri?: string;
    apiUrl?: string;
    defaultScopes?: NylasScope[];
    persistTokens?: boolean;
    method?: "popup" | "inline";
    provider?: Provider;
    scopes?: NylasScope[];
    loginHint?: string;
    popupWidth?: number;
    popupHeight?: number;
    text?: string;
    className?: string;
    style?: CSSProperties;
    disabled?: boolean;
    variant?: "primary" | "outline";
    size?: "sm" | "md" | "lg";
    unstyled?: boolean;
    cssVars?: Partial<Record<"--nylas-btn-bg" | "--nylas-btn-fg" | "--nylas-btn-border" | "--nylas-btn-bg-hover", string>>;
    /**
     * Optional callback to provide external identity provider JWT token.
     * Called during token exchange to include IDP claims.
     * Return null to skip IDP claims, or throw to fail authentication.
     */
    identityProviderToken?: IdentityProviderTokenCallback;
    /**
     * Custom code exchange method for backend-based token exchange.
     * Allows handling OAuth code exchange on your server instead of the browser.
     */
    codeExchange?: CodeExchangeMethod;
    onStart?: () => void;
    onSuccess?: (result: AuthResult) => void;
    onError?: (error: Error) => void;
    onCancel?: (reason: string) => void;
    children?: ReactNode;
};
export declare function NylasConnectButton({ clientId, redirectUri, apiUrl, defaultScopes, persistTokens, method, provider, scopes, loginHint, popupWidth, popupHeight, text, className, style, disabled, variant, size, unstyled, cssVars, identityProviderToken, codeExchange, onStart, onSuccess, onError, onCancel, children, }: NylasConnectButtonProps): React.JSX.Element;
//# sourceMappingURL=NylasConnectButton.d.ts.map