react-mention-input
Version:
A React component for input with @mention functionality.
14 lines (13 loc) • 650 B
TypeScript
interface UseProtectedImageOptions {
url: string | null;
isProtected?: boolean | ((url: string) => boolean);
getAuthHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
}
/**
* Custom hook to handle protected image URLs that require authentication tokens in headers.
* For protected URLs, it fetches the image with auth headers and converts it to a blob URL.
* For non-protected URLs, it returns the URL as-is.
* Uses a module-level cache to prevent blinking on re-renders.
*/
export declare const useProtectedImage: ({ url, isProtected, getAuthHeaders, }: UseProtectedImageOptions) => string | null;
export {};