-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
59 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,67 @@ | ||
// @flow | ||
import * as React from "react"; | ||
import * as React from "react" | ||
|
||
export type RouteScope = 'pagination' | ||
|
||
export interface Route { | ||
name: string; | ||
path: string; | ||
realpath: string; | ||
name: string | ||
path: string | ||
realpath: string | ||
parent: { | ||
name: string; | ||
scope: string; | ||
}; | ||
name: string | ||
scope: RouteScope | ||
} | null | ||
} | ||
|
||
export interface RouteParams { | ||
[index: string]: string; | ||
[index: string]: string | ||
} | ||
|
||
export interface PaginationInfo { | ||
itemCount: number; | ||
perPage: number; | ||
pageCount: number; | ||
currentPage: number; | ||
hasNextPage: boolean; | ||
hasPreviousPage: boolean; | ||
itemCount: number | ||
perPage: number | ||
pageCount: number | ||
currentPage: number | ||
hasNextPage: boolean | ||
hasPreviousPage: boolean | ||
} | ||
|
||
export interface PaginationProps { | ||
route: string; | ||
params?: RouteParams; | ||
ui?: string; | ||
range?: number; | ||
className?: string; | ||
renderDisabled?: boolean; | ||
pageInfo: PaginationInfo; | ||
route: string | ||
params?: RouteParams | ||
ui?: string | ||
range?: number | ||
className?: string | ||
renderDisabled?: boolean | ||
pageInfo: PaginationInfo | ||
labels?: { | ||
[index: string]: string | React.Node | ||
}; | ||
} | ||
theme?: { | ||
[index: string]: string | ||
}; | ||
} | ||
} | ||
|
||
export interface LinkProps { | ||
to: string; | ||
params?: RouteParams; | ||
scope?: string; | ||
to: string | ||
params?: RouteParams | ||
scope?: string | ||
} | ||
|
||
export type PathGeneratorFunction = ( | ||
data?: RouteParams, | ||
options?: {} | ||
) => string; | ||
) => string | ||
|
||
declare export var Pagination: React.ComponentType<PaginationProps>; | ||
declare export var Link: React.ComponentType<LinkProps>; | ||
declare export var Pagination: React.ComponentType<PaginationProps> | ||
declare export var Link: React.ComponentType<LinkProps> | ||
|
||
declare export function getRoutes(parent: string): [Route]; | ||
declare export function routeExists(route: string): boolean; | ||
declare export function getRoute(route: string): Route; | ||
declare export function getActivatedRoute(): Route; | ||
declare export function isActivatedRoute(route: string): boolean; | ||
declare export function getMatchingRoute(path: string, ignorePrefix?: boolean): Route; | ||
declare export function getPathGenerator(route: string, scope?: string, ignorePrefix?: boolean): PathGeneratorFunction; | ||
declare export function generatePath(route: string, params?: RouteParams, scope?: string, ignorePrefix?: boolean): string; | ||
declare export function navigate(to: string, params?: RouteParams, scope?: string, options?: {}): void; | ||
declare export function getRoutes(parent: string): [Route] | ||
declare export function routeExists(route: string): boolean | ||
declare export function getRoute(route: string): Route | ||
declare export function getActivatedRoute(): Route | ||
declare export function isActivatedRoute(route: string): boolean | ||
declare export function getMatchingRoute(path: string, ignorePrefix?: boolean): Route | ||
declare export function getPathGenerator(route: string, scope?: RouteScope, ignorePrefix?: boolean): PathGeneratorFunction | ||
declare export function generatePath(route: string, params?: RouteParams, scope?: RouteScope, ignorePrefix?: boolean): string | ||
declare export function navigate(to: string, params?: RouteParams, scope?: RouteScope, options?: {}): void |