Merge pull request #26269 from philnova/master

Create typings for react-native-custom-tabs
This commit is contained in:
Armando Aguirre
2018-06-04 15:03:46 -07:00
committed by GitHub
4 changed files with 57 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
// Type definitions for react-native-custom-tabs 0.1
// Project: https://github.com/droibit/react-native-custom-tabs
// Definitions by: Phil Nova <https://github.com/philnova>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface Animations {
startEnter: string;
startExit: string;
endEnter: string;
endExit: string;
}
export interface CustomTabsOptions {
toolbarColor?: string;
enableUrlBarHiding?: boolean;
showPageTitle?: boolean;
enableDefaultShare?: boolean;
animations?: Animations;
headers?: any;
}
export function openURL(url: string, options?: CustomTabsOptions): Promise<boolean>;

View File

@@ -0,0 +1,10 @@
import * as ReactNativeCustomTabs from 'react-native-custom-tabs';
const rnt: ReactNativeCustomTabs.CustomTabsOptions = {
toolbarColor: 'blue',
enableUrlBarHiding: false,
showPageTitle: true,
enableDefaultShare: true,
};
const url: Promise<boolean> = ReactNativeCustomTabs.openURL('testurl.com', rnt);

View File

@@ -0,0 +1,24 @@
{
"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-custom-tabs-tests.ts"
]
}

View File

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