mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-07 09:49:07 +00:00
Merge pull request #26269 from philnova/master
Create typings for react-native-custom-tabs
This commit is contained in:
22
types/react-native-custom-tabs/index.d.ts
vendored
Normal file
22
types/react-native-custom-tabs/index.d.ts
vendored
Normal 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>;
|
||||
@@ -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);
|
||||
24
types/react-native-custom-tabs/tsconfig.json
Normal file
24
types/react-native-custom-tabs/tsconfig.json
Normal 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"
|
||||
]
|
||||
}
|
||||
1
types/react-native-custom-tabs/tslint.json
Normal file
1
types/react-native-custom-tabs/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user