diff --git a/types/react-native-communications/index.d.ts b/types/react-native-communications/index.d.ts new file mode 100644 index 0000000000..d50ce419a0 --- /dev/null +++ b/types/react-native-communications/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for react-native-communications 2.2 +// Project: https://github.com/anarchicknight/react-native-communications +// Definitions by: HuHuanming +// 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 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 new file mode 100644 index 0000000000..754f8a5a0c --- /dev/null +++ b/types/react-native-communications/react-native-communications-tests.ts @@ -0,0 +1,16 @@ +import { phonecall, email, text, textWithoutEncoding, web } from 'react-native-communications'; + +phonecall('123456789', true); + +email('a@example.com', 'a@example.com', 'a@example.com', 'subject', 'body'); + +text(); +text('123456789'); +text('123456789', 'body'); + +textWithoutEncoding(); +textWithoutEncoding('123456789'); +textWithoutEncoding('123456789', 'body'); + +web(); +web('https://example.com'); diff --git a/types/react-native-communications/tsconfig.json b/types/react-native-communications/tsconfig.json new file mode 100644 index 0000000000..86667ea7d7 --- /dev/null +++ b/types/react-native-communications/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-native-communications-tests.ts" + ] +} diff --git a/types/react-native-communications/tslint.json b/types/react-native-communications/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/react-native-communications/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}