UNPKG

18.9 kBTypeScriptView Raw
1import { CSSProperties } from 'react';
2import { FC } from 'react';
3import { ForwardRefExoticComponent } from 'react';
4import { HTMLAttributes } from 'react';
5import { JSX as JSX_2 } from 'react';
6import { default as React_2 } from 'react';
7import { ReactNode } from 'react';
8import { Ref } from 'react';
9import { RefAttributes } from 'react';
10import { SVGProps } from 'react';
11
12declare interface CustomProps<LinkOptions> {
13 /**
14 * Takes a function that returns a Promise to be fulfilled before calling
15 * `onClick`. If you do not return promise, `onClick` is called immediately.
16 */
17 beforeOnClick?: () => Promise<void> | void;
18 children: React_2.ReactNode;
19 className?: string;
20 /** Disables click action and adds `disabled` class */
21 disabled?: boolean;
22 /**
23 * Style when button is disabled
24 * @default { opacity: 0.6 }
25 */
26 disabledStyle?: React_2.CSSProperties;
27 forwardedRef?: Ref<HTMLButtonElement>;
28 /**
29 * Passes as the native `title` atribute for the `button` element.
30 */
31 htmlTitle?: HTMLButtonElement['title'];
32 networkName: string;
33 networkLink: NetworkLink<LinkOptions>;
34 onClick?: (event: React_2.MouseEvent<HTMLButtonElement>, link: string) => void;
35 /**
36 * Takes a function to be called after closing share dialog.
37 */
38 onShareWindowClose?: () => void;
39 openShareDialogOnClick?: boolean;
40 opts: LinkOptions;
41 resetButtonStyle?: boolean;
42 /**
43 * URL of the shared page
44 */
45 url: string;
46 style?: React_2.CSSProperties;
47 windowWidth?: number;
48 windowHeight?: number;
49 windowPosition?: WindowPosition;
50}
51
52export declare const EmailIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
53 bgStyle?: CSSProperties | undefined;
54 borderRadius?: number | undefined;
55 iconFillColor?: string | undefined;
56 round?: boolean | undefined;
57 size?: string | number | undefined;
58}>;
59
60export declare const EmailShareButton: ForwardRefExoticComponent<Omit<Props<Options>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & Options & RefAttributes<HTMLButtonElement>>;
61
62export declare const FacebookIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
63 bgStyle?: CSSProperties | undefined;
64 borderRadius?: number | undefined;
65 iconFillColor?: string | undefined;
66 round?: boolean | undefined;
67 size?: string | number | undefined;
68}>;
69
70export declare const FacebookMessengerIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
71 bgStyle?: CSSProperties | undefined;
72 borderRadius?: number | undefined;
73 iconFillColor?: string | undefined;
74 round?: boolean | undefined;
75 size?: string | number | undefined;
76}>;
77
78export declare const FacebookMessengerShareButton: ForwardRefExoticComponent<Omit<Props<Options_2>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & Options_2 & RefAttributes<HTMLButtonElement>>;
79
80export declare const FacebookShareButton: ForwardRefExoticComponent<Omit<Props<{
81 hashtag?: string | undefined;
82}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
83 hashtag?: string | undefined;
84} & RefAttributes<HTMLButtonElement>>;
85
86export declare const FacebookShareCount: {
87 (props: Omit<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
88 children?: ((shareCount: number) => ReactNode) | undefined;
89 getCount: (url: string, callback: (shareCount?: number | undefined) => void) => void;
90 url: string;
91 }, "getCount">): JSX_2.Element;
92 displayName: string;
93};
94
95export declare const GabIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
96 bgStyle?: CSSProperties | undefined;
97 borderRadius?: number | undefined;
98 iconFillColor?: string | undefined;
99 round?: boolean | undefined;
100 size?: string | number | undefined;
101}>;
102
103export declare const GabShareButton: ForwardRefExoticComponent<Omit<Props<{
104 title?: string | undefined;
105}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
106 title?: string | undefined;
107} & RefAttributes<HTMLButtonElement>>;
108
109export declare const HatenaIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
110 bgStyle?: CSSProperties | undefined;
111 borderRadius?: number | undefined;
112 iconFillColor?: string | undefined;
113 round?: boolean | undefined;
114 size?: string | number | undefined;
115}>;
116
117export declare const HatenaShareButton: ForwardRefExoticComponent<Omit<Props<{
118 title?: string | undefined;
119}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
120 title?: string | undefined;
121} & RefAttributes<HTMLButtonElement>>;
122
123export declare const HatenaShareCount: {
124 (props: Omit<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
125 children?: ((shareCount: number) => ReactNode) | undefined;
126 getCount: (url: string, callback: (shareCount?: number | undefined) => void) => void;
127 url: string;
128 }, "getCount">): JSX_2.Element;
129 displayName: string;
130};
131
132export declare const InstapaperIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
133 bgStyle?: CSSProperties | undefined;
134 borderRadius?: number | undefined;
135 iconFillColor?: string | undefined;
136 round?: boolean | undefined;
137 size?: string | number | undefined;
138}>;
139
140export declare const InstapaperShareButton: ForwardRefExoticComponent<Omit<Props<{
141 title?: string | undefined;
142 description?: string | undefined;
143}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
144 title?: string | undefined;
145 description?: string | undefined;
146} & RefAttributes<HTMLButtonElement>>;
147
148export declare const LineIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
149 bgStyle?: CSSProperties | undefined;
150 borderRadius?: number | undefined;
151 iconFillColor?: string | undefined;
152 round?: boolean | undefined;
153 size?: string | number | undefined;
154}>;
155
156export declare const LineShareButton: ForwardRefExoticComponent<Omit<Props<{
157 title?: string | undefined;
158}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
159 title?: string | undefined;
160} & RefAttributes<HTMLButtonElement>>;
161
162export declare const LinkedinIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
163 bgStyle?: CSSProperties | undefined;
164 borderRadius?: number | undefined;
165 iconFillColor?: string | undefined;
166 round?: boolean | undefined;
167 size?: string | number | undefined;
168}>;
169
170export declare const LinkedinShareButton: ForwardRefExoticComponent<Omit<Props<Options_3>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & Options_3 & RefAttributes<HTMLButtonElement>>;
171
172export declare const LivejournalIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
173 bgStyle?: CSSProperties | undefined;
174 borderRadius?: number | undefined;
175 iconFillColor?: string | undefined;
176 round?: boolean | undefined;
177 size?: string | number | undefined;
178}>;
179
180export declare const LivejournalShareButton: ForwardRefExoticComponent<Omit<Props<{
181 title?: string | undefined;
182 description?: string | undefined;
183}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
184 title?: string | undefined;
185 description?: string | undefined;
186} & RefAttributes<HTMLButtonElement>>;
187
188export declare const MailruIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
189 bgStyle?: CSSProperties | undefined;
190 borderRadius?: number | undefined;
191 iconFillColor?: string | undefined;
192 round?: boolean | undefined;
193 size?: string | number | undefined;
194}>;
195
196export declare const MailruShareButton: ForwardRefExoticComponent<Omit<Props<{
197 title?: string | undefined;
198 description?: string | undefined;
199 imageUrl?: string | undefined;
200}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
201 title?: string | undefined;
202 description?: string | undefined;
203 imageUrl?: string | undefined;
204} & RefAttributes<HTMLButtonElement>>;
205
206declare type NetworkLink<LinkOptions> = (url: string, options: LinkOptions) => string;
207
208export declare const OKIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
209 bgStyle?: CSSProperties | undefined;
210 borderRadius?: number | undefined;
211 iconFillColor?: string | undefined;
212 round?: boolean | undefined;
213 size?: string | number | undefined;
214}>;
215
216export declare const OKShareButton: ForwardRefExoticComponent<Omit<Props<{
217 title?: string | undefined;
218 description?: string | undefined;
219 image?: string | undefined;
220}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
221 title?: string | undefined;
222 description?: string | undefined;
223 image?: string | undefined;
224} & RefAttributes<HTMLButtonElement>>;
225
226export declare const OKShareCount: {
227 (props: Omit<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
228 children?: ((shareCount: number) => ReactNode) | undefined;
229 getCount: (url: string, callback: (shareCount?: number | undefined) => void) => void;
230 url: string;
231 }, "getCount">): JSX_2.Element;
232 displayName: string;
233};
234
235declare type Options = {
236 body?: string;
237 separator?: string;
238 subject?: string;
239};
240
241declare type Options_2 = {
242 /** Your app's unique identifier. */
243 appId: string;
244 /** The URL to redirect to after a person clicks a button on the dialog.
245 * Required when using URL redirection. */
246 redirectUri?: string;
247 /** A user ID of a recipient. Once the dialog comes up, the sender can
248 * specify additional people as recipients. */
249 to?: string;
250};
251
252declare type Options_3 = {
253 /** The url-encoded title value that you wish you use. */
254 title?: string;
255 /** The url-encoded description that you wish you use. */
256 summary?: string;
257 /** The url-encoded source of the content (e.g. your website or application name) */
258 source?: string;
259};
260
261declare type Options_4 = {
262 title?: string;
263 caption?: string;
264 posttype?: 'link' | string;
265};
266
267declare type Options_5 = {
268 title?: string;
269 image?: string;
270 noParse?: boolean;
271 noVkLinks?: boolean;
272};
273
274export declare const PinterestIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
275 bgStyle?: CSSProperties | undefined;
276 borderRadius?: number | undefined;
277 iconFillColor?: string | undefined;
278 round?: boolean | undefined;
279 size?: string | number | undefined;
280}>;
281
282export declare const PinterestShareButton: ForwardRefExoticComponent<Omit<Props<PinterestShareProps>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & PinterestShareProps & RefAttributes<HTMLButtonElement>>;
283
284export declare const PinterestShareCount: {
285 (props: Omit<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
286 children?: ((shareCount: number) => ReactNode) | undefined;
287 getCount: (url: string, callback: (shareCount?: number | undefined) => void) => void;
288 url: string;
289 }, "getCount">): JSX_2.Element;
290 displayName: string;
291};
292
293declare interface PinterestShareProps {
294 media: string;
295 description?: string;
296 pinId?: string;
297}
298
299export declare const PocketIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
300 bgStyle?: CSSProperties | undefined;
301 borderRadius?: number | undefined;
302 iconFillColor?: string | undefined;
303 round?: boolean | undefined;
304 size?: string | number | undefined;
305}>;
306
307export declare const PocketShareButton: ForwardRefExoticComponent<Omit<Props<{
308 title?: string | undefined;
309}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
310 title?: string | undefined;
311} & RefAttributes<HTMLButtonElement>>;
312
313declare type Props<LinkOptions extends Record<string, unknown>> = Omit<React_2.ButtonHTMLAttributes<HTMLButtonElement>, keyof CustomProps<LinkOptions>> & CustomProps<LinkOptions>;
314
315export declare const RedditIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
316 bgStyle?: CSSProperties | undefined;
317 borderRadius?: number | undefined;
318 iconFillColor?: string | undefined;
319 round?: boolean | undefined;
320 size?: string | number | undefined;
321}>;
322
323export declare const RedditShareButton: ForwardRefExoticComponent<Omit<Props<{
324 title?: string | undefined;
325}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
326 title?: string | undefined;
327} & RefAttributes<HTMLButtonElement>>;
328
329export declare const RedditShareCount: {
330 (props: Omit<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
331 children?: ((shareCount: number) => ReactNode) | undefined;
332 getCount: (url: string, callback: (shareCount?: number | undefined) => void) => void;
333 url: string;
334 }, "getCount">): JSX_2.Element;
335 displayName: string;
336};
337
338export declare const TelegramIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
339 bgStyle?: CSSProperties | undefined;
340 borderRadius?: number | undefined;
341 iconFillColor?: string | undefined;
342 round?: boolean | undefined;
343 size?: string | number | undefined;
344}>;
345
346export declare const TelegramShareButton: ForwardRefExoticComponent<Omit<Props<{
347 title?: string | undefined;
348}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
349 title?: string | undefined;
350} & RefAttributes<HTMLButtonElement>>;
351
352export declare const TumblrIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
353 bgStyle?: CSSProperties | undefined;
354 borderRadius?: number | undefined;
355 iconFillColor?: string | undefined;
356 round?: boolean | undefined;
357 size?: string | number | undefined;
358}>;
359
360export declare const TumblrShareButton: ForwardRefExoticComponent<Omit<Props<Options_4 & {
361 tags: string;
362}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & Options_4 & {
363 tags?: string[] | undefined;
364} & RefAttributes<HTMLButtonElement>>;
365
366export declare const TumblrShareCount: {
367 (props: Omit<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
368 children?: ((shareCount: number) => ReactNode) | undefined;
369 getCount: (url: string, callback: (shareCount?: number | undefined) => void) => void;
370 url: string;
371 }, "getCount">): JSX_2.Element;
372 displayName: string;
373};
374
375export declare const TwitterIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
376 bgStyle?: CSSProperties | undefined;
377 borderRadius?: number | undefined;
378 iconFillColor?: string | undefined;
379 round?: boolean | undefined;
380 size?: string | number | undefined;
381}>;
382
383export declare const TwitterShareButton: ForwardRefExoticComponent<Omit<Props<{
384 title?: string | undefined;
385 via?: string | undefined;
386 hashtags?: string[] | undefined;
387 related?: string[] | undefined;
388}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
389 title?: string | undefined;
390 via?: string | undefined;
391 hashtags?: string[] | undefined;
392 related?: string[] | undefined;
393} & RefAttributes<HTMLButtonElement>>;
394
395export declare const ViberIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
396 bgStyle?: CSSProperties | undefined;
397 borderRadius?: number | undefined;
398 iconFillColor?: string | undefined;
399 round?: boolean | undefined;
400 size?: string | number | undefined;
401}>;
402
403export declare const ViberShareButton: ForwardRefExoticComponent<Omit<Props<{
404 title?: string | undefined;
405 separator?: string | undefined;
406}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
407 title?: string | undefined;
408 separator?: string | undefined;
409} & RefAttributes<HTMLButtonElement>>;
410
411export declare const VKIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
412 bgStyle?: CSSProperties | undefined;
413 borderRadius?: number | undefined;
414 iconFillColor?: string | undefined;
415 round?: boolean | undefined;
416 size?: string | number | undefined;
417}>;
418
419export declare const VKShareButton: ForwardRefExoticComponent<Omit<Props<Options_5>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & Options_5 & RefAttributes<HTMLButtonElement>>;
420
421export declare const VKShareCount: {
422 (props: Omit<Omit<HTMLAttributes<HTMLSpanElement>, "children"> & {
423 children?: ((shareCount: number) => ReactNode) | undefined;
424 getCount: (url: string, callback: (shareCount?: number | undefined) => void) => void;
425 url: string;
426 }, "getCount">): JSX_2.Element;
427 displayName: string;
428};
429
430export declare const WeiboIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
431 bgStyle?: CSSProperties | undefined;
432 borderRadius?: number | undefined;
433 iconFillColor?: string | undefined;
434 round?: boolean | undefined;
435 size?: string | number | undefined;
436}>;
437
438export declare const WeiboShareButton: ForwardRefExoticComponent<Omit<Props<{
439 title?: string | undefined;
440 image?: string | undefined;
441}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
442 title?: string | undefined;
443 image?: string | undefined;
444} & RefAttributes<HTMLButtonElement>>;
445
446export declare const WhatsappIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
447 bgStyle?: CSSProperties | undefined;
448 borderRadius?: number | undefined;
449 iconFillColor?: string | undefined;
450 round?: boolean | undefined;
451 size?: string | number | undefined;
452}>;
453
454export declare const WhatsappShareButton: ForwardRefExoticComponent<Omit<Props<{
455 title?: string | undefined;
456 separator?: string | undefined;
457}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
458 title?: string | undefined;
459 separator?: string | undefined;
460} & RefAttributes<HTMLButtonElement>>;
461
462declare type WindowPosition = 'windowCenter' | 'screenCenter';
463
464export declare const WorkplaceIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
465 bgStyle?: CSSProperties | undefined;
466 borderRadius?: number | undefined;
467 iconFillColor?: string | undefined;
468 round?: boolean | undefined;
469 size?: string | number | undefined;
470}>;
471
472export declare const WorkplaceShareButton: ForwardRefExoticComponent<Omit<Props<{
473 quote?: string | undefined;
474 hashtag?: string | undefined;
475}>, "forwardedRef" | "networkName" | "networkLink" | "opts"> & {
476 quote?: string | undefined;
477 hashtag?: string | undefined;
478} & RefAttributes<HTMLButtonElement>>;
479
480export declare const XIcon: FC<Omit<SVGProps<SVGSVGElement>, "width" | "height"> & {
481 bgStyle?: CSSProperties | undefined;
482 borderRadius?: number | undefined;
483 iconFillColor?: string | undefined;
484 round?: boolean | undefined;
485 size?: string | number | undefined;
486}>;
487
488export { }