UNPKG

516 BJavaScriptView Raw
1// @flow
2
3import { NativeModules } from 'react-native';
4
5const { ExponentMailComposer } = NativeModules;
6
7type ComposeOptions = {
8 recipients?: string[],
9 ccRecipients?: string[],
10 bccRecipients?: string[],
11 subject?: string,
12 body?: string,
13 isHtml?: boolean,
14 attachments?: string[],
15};
16
17type Status = 'sent' | 'saved' | 'cancelled';
18
19type Result = {
20 status: Status,
21};
22
23export async function composeAsync(options: ComposeOptions): Promise<Result> {
24 return ExponentMailComposer.composeAsync(options);
25}