react-native-get-pixel_edit/node_modules/react-native/Libraries/Share/Share.d.ts
2025-07-09 11:41:52 +09:00

75 lines
1.8 KiB
TypeScript

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import {ColorValue} from '../StyleSheet/StyleSheet';
export type ShareContent =
| {
title?: string | undefined;
message: string;
}
| {
title?: string | undefined;
url: string;
};
export type ShareOptions = {
dialogTitle?: string | undefined;
excludedActivityTypes?: Array<string> | undefined;
tintColor?: ColorValue | undefined;
subject?: string | undefined;
anchor?: number | undefined;
};
export type ShareAction = {
action: 'sharedAction' | 'dismissedAction';
activityType?: string | null | undefined;
};
export interface ShareStatic {
/**
* Open a dialog to share text content.
*
* In iOS, Returns a Promise which will be invoked an object containing `action`, `activityType`.
* If the user dismissed the dialog, the Promise will still be resolved with action being `Share.dismissedAction`
* and all the other keys being undefined.
*
* In Android, Returns a Promise which always be resolved with action being `Share.sharedAction`.
*
* ### Content
*
* - `message` - a message to share
* - `title` - title of the message
*
* #### iOS
*
* - `url` - an URL to share
*
* At least one of URL and message is required.
*
* ### Options
*
* #### iOS
*
* - `excludedActivityTypes`
* - `tintColor`
*
* #### Android
*
* - `dialogTitle`
*
*/
share(content: ShareContent, options?: ShareOptions): Promise<ShareAction>;
sharedAction: 'sharedAction';
dismissedAction: 'dismissedAction';
}
export const Share: ShareStatic;
export type Share = ShareStatic;