mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[react-share] Add extra props implemented in the code but not visible in the documentation. (#40480)
This commit is contained in:
parent
2b1d206cc1
commit
d1dbf5e3bc
33
types/react-share/index.d.ts
vendored
33
types/react-share/index.d.ts
vendored
@ -25,6 +25,11 @@ export interface CommonShareButtonProps {
|
||||
disabledStyle?: React.StyleHTMLAttributes<HTMLDivElement>;
|
||||
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<HTMLDivElement>['role'];
|
||||
/**
|
||||
* Extra style for the button.
|
||||
*/
|
||||
style?: React.HTMLAttributes<HTMLDivElement>['style'];
|
||||
/**
|
||||
* Indicates that its element can be focused, and where it participates in sequential keyboard
|
||||
* navigation.
|
||||
* @default "0"
|
||||
*/
|
||||
tabIndex?: React.HTMLAttributes<HTMLDivElement>['tabIndex'];
|
||||
/**
|
||||
* An object to pass any additional properties, such as `aria-*` attributes.
|
||||
*/
|
||||
|
||||
@ -33,5 +33,6 @@ export function MyComponent(): React.ReactNode {
|
||||
url="https://www.facebook.com"
|
||||
beforeOnClick={() => {
|
||||
setIsSharing(true);
|
||||
}} />;
|
||||
}}
|
||||
style={{margin: 42}} />;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user