DefinitelyTyped/types/navigation-react/index.d.ts
Ferdy Budhidharma 6d2fc7181a feat(react-dependents): update to TS 2.8 (part 1 of 2) (#27743)
* feat(react-dependents): update to TS 2.8

* exclude react-dom

* fix version mismatches
2018-08-03 21:01:14 +01:00

92 lines
2.3 KiB
TypeScript

// Type definitions for NavigationReact 2.0
// Project: http://grahammendick.github.io/navigation/
// Definitions by: Graham Mendick <https://github.com/grahammendick>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import { StateNavigator } from 'navigation';
import { Component, HTMLProps } from 'react';
/**
* Defines the Link Props contract
*/
export interface LinkProps extends HTMLProps<HTMLAnchorElement> {
/**
* Indicates whether Links listen for navigate events
*/
lazy?: boolean;
/**
* Determines the effect on browser history
*/
historyAction?: 'add' | 'replace' | 'none';
/**
* Handles Link click events
*/
navigating?(e: MouseEvent, domId: string, link: string): boolean;
/**
* The State Navigator
*/
stateNavigator?: StateNavigator;
}
/**
* Defines the Refresh Link Props contract
*/
export interface RefreshLinkProps extends LinkProps {
/**
* The NavigationData to pass
*/
navigationData?: any;
/**
* Indicates whether to include all the current NavigationData
*/
includeCurrentData?: boolean;
/**
* The data to add from the current NavigationData
*/
currentDataKeys?: string;
/**
* The Css Class to display when the Link is active
*/
activeCssClass?: string;
/**
* Indicates whether the Link is disabled when active
*/
disableActive?: boolean;
}
/**
* Hyperlink Component the navigates to the current State
*/
export class RefreshLink extends Component<RefreshLinkProps> { }
/**
* Defines the Navigation Link Props contract
*/
export interface NavigationLinkProps extends RefreshLinkProps {
/**
* The key of the State to navigate to
*/
stateKey: string;
}
/**
* Hyperlink Component the navigates to a State
*/
export class NavigationLink extends Component<NavigationLinkProps> { }
/**
* Defines the Navigation Back Link Props contract
*/
export interface NavigationBackLinkProps extends RefreshLinkProps {
/**
* Starting at 1, The number of Crumb steps to go back
*/
distance: number;
}
/**
* Hyperlink Component the navigates back along the crumb trail
*/
export class NavigationBackLink extends Component<NavigationBackLinkProps> { }