mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 07:47:04 +00:00
feat: add type definitions for react-router-tabs (#41981)
This commit is contained in:
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
// Type definitions for react-router-tabs 1.3
|
||||
// Project: https://github.com/chacestew/react-router-tabs#readme
|
||||
// Definitions by: Joakim Unge <https://github.com/joakimunge>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Route, Link, RouteProps } from 'react-router-dom';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
export type AriaCurrent = 'page' | 'step' | 'location' | 'date' | 'time' | 'true';
|
||||
|
||||
export interface NavTabProps {
|
||||
to: string | object;
|
||||
replace?: boolean;
|
||||
exact?: boolean;
|
||||
strict?: boolean;
|
||||
activeClassName?: string;
|
||||
className?: string;
|
||||
activeStyle?: object;
|
||||
style?: object;
|
||||
'aria-current'?: AriaCurrent;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface RoutedTabsProps {
|
||||
startPathWith?: string;
|
||||
className?: string;
|
||||
style?: object;
|
||||
tabClassName?: string;
|
||||
activeTabClassName?: string;
|
||||
tabStyle?: object;
|
||||
activeTabStyle?: object;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
export function NavTab(props: NavTabProps): Route;
|
||||
export function RoutedTabs(props: RoutedTabsProps): ReactNode;
|
||||
@@ -0,0 +1,4 @@
|
||||
import { NavTab, RoutedTabs } from 'react-router-tabs';
|
||||
|
||||
NavTab({ to: 'path' }); // $ExpectType Route<RouteProps>
|
||||
RoutedTabs({}); // $ExpectType ReactNode
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": ["index.d.ts", "react-router-tabs-tests.ts"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user