<commit_before>// Type definitions for react-native-share 3.0
// Project: https://github.com/react-native-community/react-native-share#readme
// Definitions by: <NAME> <https://github.com/marknelissen>
//                 pera <https://github.com/santiagofm>
//                 MateusAndrade <https://github.com/MateusAndrade>
//                 <NAME> <https://github.com/Naturalclar>
//                 <NAME> <https://github.com/fabianlee1211>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
import { ReactNode, Component } from 'react';
import { ViewProps, StyleProp } from 'react-native';
import Overlay from './Overlay.d';
import Button from './Button.d';
import Sheet from './Sheet.d';

declare namespace Share {
    enum Social {
        FACEBOOK = 'facebook',
        PAGESMANAGER = 'pagesmanager',
        TWITTER = 'twitter',
        WHATSAPP = 'whatsapp',
        INSTAGRAM = 'instagram',
        INSTAGRAM_STORIES = 'instagram-stories',
        GOOGLEPLUS = 'googleplus',
        EMAIL = 'email',
        PINTEREST = 'pinterest',
        LINKEDIN = 'linkedin',
    }
    enum InstagramStories {
        SHARE_BACKGROUND_IMAGE = 'shareBackgroundImage',
        SHARE_STICKER_IMAGE = 'shareStickerImage',
        SHARE_BACKGROUND_AND_STICKER_IMAGE = 'shareBackgroundAndStickerImage',
    }
    function open(options: Options | MultipleOptions): Promise<OpenReturn>;
    function shareSingle(options: Options & { social: Social }): Promise<ShareSingleReturn>;
    function isPackageInstalled(packageName: string): Promise<ShareSingleReturn>;
}

export interface OpenReturn {
    app?: string;
    dismissedAction?: boolean;
}

export interface ShareSingleReturn {
    message: string;
}

export interface Options {
    url?: string;
    urls?: string[];
    type?: string;
    message?: string;
    title?: string;
    subject?: string;
    filename?: string;
    excludedActivityTypes?: string;
    failOnCancel?: boolean;
    showAppsToView?: boolean;
}
export interface MultipleOptions {
    url?: string;
    urls: string[];
    type?: string;
    message?: string;
    title?: string;
    subject?: string;
    excludedActivityTypes?: string;
    failOnCancel?: boolean;
    showAppsToView?: boolean;
}
export interface ShareSheetProps {
    visible: boolean;
    onCancel: () => void;
    children: ReactNode;
    style?: StyleProp<ViewProps>;
    overlayStyle?: StyleProp<ViewProps>;
}<commit_msg>[v3.1.0] Update react-native-share type definitions (#43171)<commit_after>// Type definitions for react-native-share 3.1
// Project: https://github.com/react-native-community/react-native-share#readme
// Definitions by: <NAME> <https://github.com/marknelissen>
//                 pera <https://github.com/santiagofm>
//                 MateusAndrade <https://github.com/MateusAndrade>
//                 <NAME> <https://github.com/Naturalclar>
//                 <NAME> <https://github.com/fabianlee1211>
//                 <NAME> <https://github.com/evancloutier>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
import { ReactNode, Component } from 'react';
import { ViewProps, StyleProp } from 'react-native';
import Overlay from './Overlay.d';
import Button from './Button.d';
import Sheet from './Sheet.d';

declare namespace Share {
    enum Social {
        FACEBOOK = 'facebook',
        PAGESMANAGER = 'pagesmanager',
        TWITTER = 'twitter',
        WHATSAPP = 'whatsapp',
        INSTAGRAM = 'instagram',
        INSTAGRAM_STORIES = 'instagram-stories',
        GOOGLEPLUS = 'googleplus',
        EMAIL = 'email',
        PINTEREST = 'pinterest',
        LINKEDIN = 'linkedin',
    }
    enum InstagramStories {
        SHARE_BACKGROUND_IMAGE = 'shareBackgroundImage',
        SHARE_STICKER_IMAGE = 'shareStickerImage',
        SHARE_BACKGROUND_AND_STICKER_IMAGE = 'shareBackgroundAndStickerImage',
    }
    function open(options: Options | MultipleOptions): Promise<OpenReturn>;
    function shareSingle(options: Options & { social: Social }): Promise<ShareSingleReturn>;
    function isPackageInstalled(packageName: string): Promise<ShareSingleReturn>;
}

export interface OpenReturn {
    app?: string;
    dismissedAction?: boolean;
}

export interface ShareSingleReturn {
    message: string;
}

type ActivityType =
    | 'addToReadingList'
    | 'airDrop'
    | 'assignToContact'
    | 'copyToPasteBoard'
    | 'mail'
    | 'message'
    | 'openInIBooks' // iOS 9 or later
    | 'postToFacebook'
    | 'postToFlickr'
    | 'postToTencentWeibo'
    | 'postToTwitter'
    | 'postToVimeo'
    | 'postToWeibo'
    | 'print'
    | 'saveToCameraRoll'
    | 'markupAsPDF'; // iOS 11 or later

interface LinkMetadata {
    originalUrl?: string;
    url?: string;
    title?: string;
    icon?: string;
    image?: string;
    remoteVideoUrl?: string;
    video?: string;
}

interface ActivityItem {
    content: string;
    type: 'text' | 'url';
}

export interface ActivityItemSource {
    placeholderItem: ActivityItem;
    item: { [key in ActivityType | string]: ActivityItem | null | undefined };
    subject?: { [key in ActivityType | string]: string };
    dataTypeIdentifier?: { [key in ActivityType | string]: string };
    thumbnailImage?: { [key in ActivityType | string]: string };
    linkMetadata?: LinkMetadata;
}

export interface Options {
    url?: string;
    urls?: string[];
    type?: string;
    message?: string;
    title?: string;
    subject?: string;
    activityItemSources?: ActivityItemSource[];
    filename?: string;
    excludedActivityTypes?: string;
    failOnCancel?: boolean;
    showAppsToView?: boolean;
}
export interface MultipleOptions {
    url?: string;
    urls: string[];
    type?: string;
    message?: string;
    title?: string;
    subject?: string;
    excludedActivityTypes?: string;
    failOnCancel?: boolean;
    showAppsToView?: boolean;
}
export interface ShareSheetProps {
    visible: boolean;
    onCancel: () => void;
    children: ReactNode;
    style?: StyleProp<ViewProps>;
    overlayStyle?: StyleProp<ViewProps>;
}
{'fraction_non_alphanumeric': 0.12444663059517953, 'fraction_numerical': 0.004426955238563699, 'mean_word_length': 3.16382252559727, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 33, 'https://': 15, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1991729', 'n_tokens_mistral': 1847, 'n_tokens_neox': 1798, 'n_words': 419}