@api-buddy/sendgrid
Version:
API Buddy integration for SendGrid - Email delivery service for transactional and marketing emails
31 lines (30 loc) • 1.2 kB
TypeScript
import React, { ReactNode } from 'react';
import { SendGridClient, SendGridConfig } from '../client';
interface SendGridContextType {
client: SendGridClient;
config: SendGridConfig;
}
interface SendGridProviderProps {
children: ReactNode;
config: SendGridConfig;
}
/**
* Provider component that makes the SendGrid client available to any nested components
*/
export declare function SendGridProvider({ children, config }: SendGridProviderProps): import("react/jsx-runtime").JSX.Element;
/**
* Hook to access the SendGrid client and config from the nearest SendGridProvider
* @returns Object containing the SendGrid client and config
* @throws Error if used outside of a SendGridProvider
*/
export declare function useSendGrid(): SendGridContextType;
/**
* Higher-order component that provides the SendGrid client to the wrapped component
* @param WrappedComponent The component to wrap with SendGrid context
* @returns A new component with SendGrid context
*/
export declare function withSendGrid<T extends JSX.IntrinsicAttributes>(WrappedComponent: React.ComponentType<T>): {
(props: T): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
export {};