Add react-native-mail (#35801)

This commit is contained in:
Vincent DELACOURT
2019-05-30 12:00:20 -07:00
committed by Sheetal Nandi
parent a73328b20a
commit 6d32ce4302
4 changed files with 60 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
// Type definitions for react-native-mail 3.0
// Project: https://github.com/chirag04/react-native-mail#readme
// Definitions by: DELACOURT Vincent <https://github.com/vdelacou>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export namespace Mailer {
function mail(options: {
subject: string;
body: string;
isHTML: boolean;
recipients?: [string];
ccRecipients?: [string];
bccRecipients?: [string];
attachment?: {
/**
* The absolute path of the file from which to read data.
*/
path: string;
/**
* Mime Type: jpg, png, doc, ppt, html, pdf, csv
*/
type: string;
/**
* Optional: Custom filename for attachment
*/
name?: string;
};
}, callback: (
error: string,
/**
* On Android, the callback will only be called if an error occurs. The event argument is unused!
*/
event: string
) => void): void;
}
export default Mailer;
@@ -0,0 +1,6 @@
import Mailer from "react-native-mail";
Mailer.mail(
{ subject: "", body: "", isHTML: false },
(error: string, event: string) => {}
);
+16
View File
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "react-native-mail-tests.ts"]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }