diff --git a/types/react-share/index.d.ts b/types/react-share/index.d.ts index d8b95d5ebd..8730eba8d6 100644 --- a/types/react-share/index.d.ts +++ b/types/react-share/index.d.ts @@ -25,6 +25,11 @@ export interface CommonShareButtonProps { disabledStyle?: React.StyleHTMLAttributes; windowWidth?: number; windowHeight?: number; + /** + * Whether to center the share box respectively to the screen or to the window. + * @default "windowCenter" + */ + windowPosition?: 'windowCenter' | 'screenCenter'; /** * Takes a function that returns a Promise to be fulfilled before calling * `onClick`. If you do not return promise, `onClick` is called immediately. @@ -34,6 +39,34 @@ export interface CommonShareButtonProps { * Takes a function to be called after closing share dialog. */ onShareWindowClose?: () => void; + /** + * A class name to add to the others added by react-share (SocialMediaShareButton, ...). + */ + className?: string; + /** + * Click callback handler. + */ + onClick?: (link: string) => void; + /** + * If false, does not open a new window and call the onClick callback instead. + * @default true + */ + openWindow?: boolean; + /** + * The HTML role of the div. + * @default "button" + */ + role?: React.HTMLAttributes['role']; + /** + * Extra style for the button. + */ + style?: React.HTMLAttributes['style']; + /** + * Indicates that its element can be focused, and where it participates in sequential keyboard + * navigation. + * @default "0" + */ + tabIndex?: React.HTMLAttributes['tabIndex']; /** * An object to pass any additional properties, such as `aria-*` attributes. */ diff --git a/types/react-share/react-share-tests.tsx b/types/react-share/react-share-tests.tsx index 1988d0c668..67a2e07e68 100644 --- a/types/react-share/react-share-tests.tsx +++ b/types/react-share/react-share-tests.tsx @@ -33,5 +33,6 @@ export function MyComponent(): React.ReactNode { url="https://www.facebook.com" beforeOnClick={() => { setIsSharing(true); - }} />; + }} + style={{margin: 42}} />; }