-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove reach/router dep if not needed
- Loading branch information
1 parent
9e221fd
commit 328cf16
Showing
5 changed files
with
48 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/reach__router/index.d.ts | ||
/** | ||
* cloning reach router types so the packages does not depends on reach/router types if not used. | ||
* to be removed in v6 and deprecate reach-router | ||
*/ | ||
|
||
interface HLocation<S = unknown> { | ||
pathname: string; | ||
search: string; | ||
state: S; | ||
hash: string; | ||
key?: string | undefined; | ||
} | ||
type WindowLocation<S = unknown> = Window['location'] & HLocation<S>; | ||
|
||
type HistoryActionType = 'PUSH' | 'POP'; | ||
type HistoryLocation = WindowLocation & { state?: any }; | ||
interface HistoryListenerParameter { | ||
location: HistoryLocation; | ||
action: HistoryActionType; | ||
} | ||
type HistoryListener = (parameter: HistoryListenerParameter) => void; | ||
type HistoryUnsubscribe = () => void; | ||
|
||
interface NavigateOptions<TState> { | ||
state?: TState | undefined; | ||
replace?: boolean | undefined; | ||
} | ||
interface NavigateFn { | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
(to: string, options?: NavigateOptions<{}>): Promise<void>; | ||
(to: number): Promise<void>; | ||
} | ||
|
||
export interface ReachHistory { | ||
readonly location: HistoryLocation; | ||
readonly transitioning: boolean; | ||
listen: (listener: HistoryListener) => HistoryUnsubscribe; | ||
navigate: NavigateFn; | ||
} |
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