From 7cadcdc8666d1084eddcb565980aa89ec8d1d477 Mon Sep 17 00:00:00 2001 From: Paito Anderson Date: Wed, 20 Dec 2017 12:54:35 -0500 Subject: [PATCH 1/2] Fixed react-native-commications email --- types/react-native-communications/index.d.ts | 3 ++- .../react-native-communications-tests.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/react-native-communications/index.d.ts b/types/react-native-communications/index.d.ts index d50ce419a0..a6c572174d 100644 --- a/types/react-native-communications/index.d.ts +++ b/types/react-native-communications/index.d.ts @@ -1,11 +1,12 @@ // Type definitions for react-native-communications 2.2 // Project: https://github.com/anarchicknight/react-native-communications // Definitions by: HuHuanming +// Paito // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 export function phonecall(phoneNumber: string, isPrompt: boolean): void; -export function email(to: string, cc: string, bcc: string, subject: string, body: string): void; +export function email(to: string[] | null, cc: string[]| null, bcc: string[] | null, subject: string | null, body: string | null): void; export function text(phoneNumber?: string | null, body?: string | null): void; export function textWithoutEncoding(phoneNumber?: string | null, body?: string | null): void; export function web(address?: string | null): void; diff --git a/types/react-native-communications/react-native-communications-tests.ts b/types/react-native-communications/react-native-communications-tests.ts index 754f8a5a0c..edad4ad933 100644 --- a/types/react-native-communications/react-native-communications-tests.ts +++ b/types/react-native-communications/react-native-communications-tests.ts @@ -2,7 +2,7 @@ import { phonecall, email, text, textWithoutEncoding, web } from 'react-native-c phonecall('123456789', true); -email('a@example.com', 'a@example.com', 'a@example.com', 'subject', 'body'); +email(['a@example.com'], null, ['a@example.com'], 'subject', null); text(); text('123456789'); From 6ba8518b4414f21ff362f8d3ce8e3e09121b5f27 Mon Sep 17 00:00:00 2001 From: Paito Anderson Date: Thu, 28 Dec 2017 15:02:16 -0500 Subject: [PATCH 2/2] Added empty overload for email() --- types/react-native-communications/index.d.ts | 1 + .../react-native-communications-tests.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/react-native-communications/index.d.ts b/types/react-native-communications/index.d.ts index a6c572174d..4f8d28564e 100644 --- a/types/react-native-communications/index.d.ts +++ b/types/react-native-communications/index.d.ts @@ -6,6 +6,7 @@ // TypeScript Version: 2.3 export function phonecall(phoneNumber: string, isPrompt: boolean): void; +export function email(): void; export function email(to: string[] | null, cc: string[]| null, bcc: string[] | null, subject: string | null, body: string | null): void; export function text(phoneNumber?: string | null, body?: string | null): void; export function textWithoutEncoding(phoneNumber?: string | null, body?: string | null): void; diff --git a/types/react-native-communications/react-native-communications-tests.ts b/types/react-native-communications/react-native-communications-tests.ts index edad4ad933..136dadd77f 100644 --- a/types/react-native-communications/react-native-communications-tests.ts +++ b/types/react-native-communications/react-native-communications-tests.ts @@ -2,6 +2,7 @@ import { phonecall, email, text, textWithoutEncoding, web } from 'react-native-c phonecall('123456789', true); +email(); email(['a@example.com'], null, ['a@example.com'], 'subject', null); text();