-
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.
perf(plugin): improve type declarations
- Loading branch information
Showing
5 changed files
with
107 additions
and
100 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,78 +1,60 @@ | ||
import * as React from 'react'; | ||
import React from 'react' | ||
import { PathFunction as PathGeneratorFunction } from 'path-to-regexp' | ||
|
||
export interface Route { | ||
name: string; | ||
path: string; | ||
scopes: { | ||
[index: string]: string; | ||
} | ||
} | ||
|
||
export interface ActivatedRoute { | ||
name: string; | ||
path: string; | ||
scope: string; | ||
name: string | ||
path: string | ||
realpath: string | ||
parent: { | ||
name: string | ||
scope: string | ||
} | 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.ReactNode | ||
}; | ||
} | ||
theme?: { | ||
[index: string]: string | ||
}; | ||
} | ||
} | ||
|
||
export interface LinkProps { | ||
to: string; | ||
params?: RouteParams; | ||
to: string | ||
params?: RouteParams | ||
scope?: string | ||
} | ||
|
||
export const Pagination: React.ComponentType<PaginationProps>; | ||
export const Link: React.ComponentType<LinkProps>; | ||
|
||
export function getRoutes(): [Route]; | ||
export function routeExists(route: string): boolean; | ||
export function getRoute(route: string): Route; | ||
export function getActivatedRoute(): ActivatedRoute; | ||
export function isActivatedRoute(route: string): boolean; | ||
export function getMatchingRoute(path: string): ActivatedRoute; | ||
export function getPathGenerator( | ||
route: string, | ||
scope?: string, | ||
ignorePrefix?: boolean | ||
): PathGeneratorFunction<RouteParams>; | ||
export function generatePath( | ||
route: string, | ||
params?: RouteParams, | ||
scope?: string, | ||
ignorePrefix?: boolean | ||
): string; | ||
export function navigate( | ||
to: string, | ||
params?: RouteParams, | ||
scope?: string, | ||
options?: {} | ||
): void; | ||
export const Pagination: React.ComponentType<PaginationProps> | ||
export const Link: React.ComponentType<LinkProps> | ||
|
||
export function getRoutes(parent?: string): [Route] | ||
export function routeExists(route: string): boolean | ||
export function getRoute(route: string): Route | ||
export function getActivatedRoute(): Route | ||
export function isActivatedRoute(route: string): boolean | ||
export function getMatchingRoute(path: string, ignorePrefix?: boolean): Route | ||
export function getPathGenerator(route: string, scope?: string, ignorePrefix?: boolean): PathGeneratorFunction<RouteParams> | ||
export function generatePath(route: string, params?: RouteParams, scope?: string, ignorePrefix?: boolean): string | ||
export function navigate(to: string, params?: RouteParams, scope?: string, options?: {}): void |
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