react-shareable-buttons
Version:
Social media share buttons and share counts for React and Nextjs.
197 lines (196 loc) • 8.81 kB
TypeScript
import { EmailLinkParams, FacebookLinkParams, FacebookMessengerLinkParams, GapLinkParams, HatenaLinkParams, InstaPaperLinkParams, LineLinkParams, LinkedInLinkParams, LiveJournalLinkParams, MailruLinkParams, PinterestLinkParams, PocketLinkParams, RedditLinkParams, TelegramLinkParams, TumblrLinkParams, TwitterLinkParams, VKShareLinkParams, ViberLinkParams, WeiboShareLinkParams, WhatsAppLinkParams, WorkplaceLinkParams } from '../types';
/**
* Generates a Facebook sharing link.
*
* @param url - The URL to be shared.
* @param quote - Optional. A quote or description to be included in the shared post.
* @param hashtag - Optional. A hashtag to be included in the shared post.
* @returns The Facebook sharing link.
*/
export declare function facebookLink(url: string, { quote, hashtag }: FacebookLinkParams): string;
/**
* Generates a Email link for composing an email.
*
* @param url - The email address or addresses to send the email to.
* @param subject - Optional. The subject line of the email.
* @param body - Optional. The body content of the email.
* @param separator - Optional. The separator to use between the body and the URL.
* @returns The email link.
*/
export declare function emailLink(url: string, { subject, body, separator }: EmailLinkParams): string;
/**
* Generates a Facebook Messenger link for sending a message.
*
* @param url - The URL to be shared within the message.
* @param appId - Optional. The Facebook App ID or Your app's unique identifier..
* @param redirectUri - Optional. The URL to redirect to after a person clicks a button on the dialog.
* Required when using URL redirection.
* @param to - Optional. A user ID of a recipient. Once the dialog comes up, the sender can
* specify additional people as recipients.
* @returns The Facebook Messenger link.
*/
export declare function facebookMessengerLink(url: string, { appId, redirectUri, to }: FacebookMessengerLinkParams): string;
/**
* Generates a Gab Social link for composing a post.
*
* @param url - The URL to be shared within the post.
* @param title - The title or text of the post.
* @returns The Gab Social link for composing the post.
*/
export declare function gabLink(url: string, { title }: GapLinkParams): string;
/**
* Generates a Hatena bookmark link for adding a bookmark.
*
* @param url - The URL to be bookmarked.
* @param title - The title of the bookmark.
* @returns The Hatena bookmark link.
*/
export declare function hatenaLink(url: string, { title }: HatenaLinkParams): string;
/**
* Generates an Instapaper link for saving a page.
*
* @param url - The URL of the page to be saved.
* @param title - The title of the page.
* @param description - Optional. The description of the page.
* @returns The Instapaper link for saving the page.
*/
export declare function instapaperLink(url: string, { title, description }: InstaPaperLinkParams): string;
/**
* Generates a LINE Login link for sharing a URL.
*
* @param url - The URL to be shared.
* @param title - The title or text of the shared content.
* @returns The LINE Login link for sharing the URL.
*/
export declare function lineLink(url: string, { title }: LineLinkParams): string;
/**
* Generates a LinkedIn sharing link for sharing an article.
*
* @param url - The URL of the article to be shared.
* @param title - The title of the article.
* @param summary - Optional. The summary or description of the article.
* @param source - Optional. The source or publication of the article.
* @returns The LinkedIn sharing link for sharing the article.
*/
export declare function linkedinLink(url: string, { title, summary, source }: LinkedInLinkParams): string;
/**
* Generates a LiveJournal update link for creating a new post.
*
* @param _url - This parameter is not used.
* @param title - The title of the post.
* @param description - The description or content of the post.
* @returns The LiveJournal update link for creating a new post.
*/
export declare function liveJournalLink(_url: string, { title, description }: LiveJournalLinkParams): string;
/**
* Generates a Mail.Ru sharing link for sharing content.
*
* @param url - The URL of the content to be shared.
* @param title - The title of the content.
* @param description - The description or summary of the content.
* @param imageUrl - Optional. The URL of an image associated with the content.
* @returns The Mail.Ru sharing link for sharing the content.
*/
export declare function mailruLink(url: string, { title, description, imageUrl }: MailruLinkParams): string;
/**
* Generates a Pinterest sharing link.
*
* @param url - The URL to be pinned.
* @param media - The media URL to be associated with the pin (optional).
* @param description - The description of the pin (optional).
* @returns The Pinterest sharing link.
*/
export declare function pinterestLink(url: string, { media, description }: PinterestLinkParams): string;
/**
* Generates a Pocket saving link.
*
* @param url - The URL to be saved.
* @param title - The title of the saved item (optional).
* @returns The Pocket saving link.
*/
export declare function pocketLink(url: string, { title }: PocketLinkParams): string;
/**
* Generates a Reddit submission link.
*
* @param url - The URL to be submitted.
* @param title - The title of the submission (optional).
* @returns The Reddit submission link.
*/
export declare function redditLink(url: string, { title }: RedditLinkParams): string;
/**
* Generates a Telegram sharing link.
*
* @param url - The URL to be shared.
* @param title - The title of the shared content (optional).
* @returns The Telegram sharing link.
*/
export declare function telegramLink(url: string, { title }: TelegramLinkParams): string;
/**
* Generates a Tumblr sharing link.
*
* @param url - The URL to be shared.
* @param title - The title of the shared content (optional).
* @param caption - The caption of the shared content (optional).
* @param tags - An array of tags associated with the shared content (optional).
* @param posttype - The type of post (optional).
* @returns The Tumblr sharing link.
*/
export declare function tumblrLink(url: string, { title, caption, tags, posttype }: TumblrLinkParams): string;
/**
* Generates a Twitter sharing link.
*
* @param url - The URL to be shared.
* @param title - The title of the shared content (optional).
* @param via - The Twitter username to attribute the tweet to (optional).
* @param hashtags - An array of hashtags to include in the tweet (optional).
* @param related - An array of related accounts to suggest following after the tweet is sent (optional).
* @returns The Twitter sharing link.
*/
export declare function twitterLink(url: string, { title, via, hashtags, related }: TwitterLinkParams): string;
/**
* Generates a Viber sharing link.
*
* @param url - The URL to be shared.
* @param title - The title of the shared content (optional).
* @param separator - The separator between the title and URL (optional).
* @returns The Viber sharing link.
*/
export declare function viberLink(url: string, { title, separator }: ViberLinkParams): string;
/**
* Generates a VKontakte (VK) sharing link.
*
* @param url - The URL to be shared.
* @param title - The title of the shared content (optional).
* @param image - The URL of the image to be shared (optional).
* @param noParse - Specifies whether to disable VK parsing of the shared content (optional).
* @param noVkLinks - Specifies whether to disable VK-specific links in the shared content (optional).
* @returns The VKontakte sharing link.
*/
export declare function vkLink(url: string, { title, image, noParse, noVkLinks }: VKShareLinkParams): string;
/**
* Generates a Weibo sharing link.
*
* @param url - The URL to be shared.
* @param title - The title of the shared content (optional).
* @param image - The URL of the image to be shared (optional).
* @returns The Weibo sharing link.
*/
export declare function weiboLink(url: string, { title, image }: WeiboShareLinkParams): string;
/**
* Generates a WhatsApp sharing link.
*
* @param url - The URL to be shared.
* @param title - The title of the shared content (optional).
* @param separator - The separator between the title and URL (optional).
* @returns The WhatsApp sharing link.
*/
export declare function whatsappLink(url: string, { title, separator }: WhatsAppLinkParams): string;
/**
* Generates a Workplace sharing link.
*
* @param url - The URL to be shared.
* @param quote - The quote or message to include in the shared content (optional).
* @param hashtag - The hashtag to include in the shared content (optional).
* @returns The Workplace sharing link.
*/
export declare function workplaceLink(url: string, { quote, hashtag }: WorkplaceLinkParams): string;