/** * Shares a link using the Web Share API (if supported) with a fallback. * Provides callbacks for success and error handling. * * @param data - The share data (title, text, url). * @param options - Configuration and callbacks. * @returns A promise that resolves when the operation completes. */ export declare const shareLink: (data: { title?: string; text?: string; url: string; }, { fallback, onSuccess, onError }?: ShareOptions) => Promise; export declare type shareMethod = 'webShare' | 'copy' | 'window'; /** * Options for the shareLink function. */ export declare interface ShareOptions { /** * Fallback behavior when Web Share API is unsupported or fails. * - 'copy': copy the URL to clipboard (default) * - 'window': open the URL in a new tab */ fallback?: 'copy' | 'window'; /** * Called on successful sharing via any method. * @param method - Which method succeeded ('webShare', 'copy', or 'window') */ onSuccess?: (method: shareMethod) => void; /** * Called when an error occurs. * Note: user cancellation (AbortError) is ignored and does NOT trigger this. * @param error - The error object * @param method - The method that failed ('webShare' or the fallback method) */ onError?: (error: unknown, method: shareMethod) => void; } export { }