Add typings for react-native-referrer (#29642)

This commit is contained in:
Christian Chown 2018-10-11 18:36:31 +01:00 committed by Andy
parent d96c3407ae
commit cc0a868dc1
4 changed files with 45 additions and 0 deletions

11
types/react-native-referrer/index.d.ts vendored Normal file
View File

@ -0,0 +1,11 @@
// Type definitions for react-native-referrer 0.1
// Project: https://github.com/JeandeCampredon/react-native-referrer
// Definitions by: Christian Chown <https://github.com/christianchown>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
declare let ReactNativeReferrer: {
getReferrer(): Promise<string>;
};
export default ReactNativeReferrer;

View File

@ -0,0 +1,9 @@
import * as React from "react";
import { Platform } from "react-native";
import ReactNativeReferrer from "react-native-referrer";
if (Platform.OS === 'android') {
ReactNativeReferrer.getReferrer().then(referrerString => {
console.log(referrerString);
});
}

View File

@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"jsx": "react-native",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"react-native-referrer-tests.tsx"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }