@react-motion-router/core 1.10.1 → 2.0.0-beta.2e4c2ad

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 Nathan Johnson
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Nathan Johnson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/package.json CHANGED
@@ -1,60 +1,66 @@
1
- {
2
- "name": "@react-motion-router/core",
3
- "version": "1.10.1",
4
- "main": "build/index.js",
5
- "publishConfig": {
6
- "access": "public"
7
- },
8
- "files": [
9
- "build"
10
- ],
11
- "description": "Declarative routing library for ReactJS ⚛ with animations baked in ⏮",
12
- "scripts": {
13
- "test": "echo \"Error: no test specified\" && exit 1",
14
- "build": "webpack",
15
- "dev": "webpack -w"
16
- },
17
- "repository": {
18
- "type": "git",
19
- "url": "git+https://github.com/nxtexe/react-motion-router.git"
20
- },
21
- "keywords": [
22
- "react",
23
- "router",
24
- "route",
25
- "routing",
26
- "history",
27
- "shared element",
28
- "shared element transition",
29
- "navigation",
30
- "animation",
31
- "transition"
32
- ],
33
- "author": "nxtexe",
34
- "license": "Apache-2.0",
35
- "bugs": {
36
- "url": "https://github.com/nxtexe/react-motion-router/issues"
37
- },
38
- "homepage": "https://github.com/nxtexe/react-motion-router#readme",
39
- "dependencies": {
40
- "urlpattern-polyfill": "^6.0.2",
41
- "web-gesture-events": "^0.1.0"
42
- },
43
- "peerDependencies": {
44
- "node": "^17.7.2",
45
- "react": "^18.2.0",
46
- "react-dom": "^18.0.0"
47
- },
48
- "devDependencies": {
49
- "@types/node": "^17.0.23",
50
- "@types/react": "^18.0.4",
51
- "@types/react-dom": "^18.0.0",
52
- "copy-webpack-plugin": "^11.0.0",
53
- "rimraf": "^3.0.2",
54
- "ts-loader": "^9.2.8",
55
- "typescript": "^4.6.3",
56
- "webpack": "^5.72.0",
57
- "webpack-cli": "^4.9.2"
58
- },
59
- "gitHead": "38a495e365799d870713ad00fcffd26af293582f"
60
- }
1
+ {
2
+ "name": "@react-motion-router/core",
3
+ "version": "2.0.0-beta.2e4c2ad",
4
+ "main": "build/index.js",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "files": [
9
+ "build"
10
+ ],
11
+ "description": "Declarative routing library for ReactJS ⚛ with animations baked in ⏮",
12
+ "scripts": {
13
+ "test": "echo \"Error: no test specified\" && exit 1",
14
+ "build": "webpack --env production",
15
+ "dev": "webpack watch --env development"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/nxtexe/react-motion-router.git"
20
+ },
21
+ "keywords": [
22
+ "react",
23
+ "router",
24
+ "route",
25
+ "routing",
26
+ "history",
27
+ "shared element",
28
+ "shared element transition",
29
+ "navigation",
30
+ "animation",
31
+ "transition"
32
+ ],
33
+ "author": "nxtexe",
34
+ "license": "MIT",
35
+ "bugs": {
36
+ "url": "https://github.com/nxtexe/react-motion-router/issues"
37
+ },
38
+ "homepage": "https://github.com/nxtexe/react-motion-router#readme",
39
+ "peerDependencies": {
40
+ "@virtualstate/navigation": "1.0.1-alpha.202",
41
+ "node": "^17.7.2",
42
+ "react": "^18.2.0",
43
+ "react-dom": "^18.0.0",
44
+ "urlpattern-polyfill": "^10.0.0",
45
+ "web-animations-extension": "*"
46
+ },
47
+ "peerDependenciesMeta": {
48
+ "urlpattern-polyfill": {
49
+ "optional": true
50
+ },
51
+ "@virtualstate/navigation": {
52
+ "optional": true
53
+ }
54
+ },
55
+ "devDependencies": {
56
+ "@types/node": "^17.0.23",
57
+ "@types/react": "^18.0.4",
58
+ "@types/react-dom": "^18.0.0",
59
+ "csstype": "^3.1.3",
60
+ "ts-loader": "^9.2.8",
61
+ "typescript": "^5.5.2",
62
+ "webpack": "^5.72.0",
63
+ "webpack-cli": "^4.9.2"
64
+ },
65
+ "gitHead": "2e4c2ad02ca4b3753b2995b8a04b17752d502398"
66
+ }
package/build/Anchor.d.ts DELETED
@@ -1,17 +0,0 @@
1
- /// <reference types="react" />
2
- import { PlainObject, XOR } from './common/types';
3
- interface BaseAnchorProps extends React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
4
- params?: PlainObject;
5
- hash?: string;
6
- onClick?: React.MouseEventHandler<HTMLAnchorElement>;
7
- }
8
- interface ForwardAnchorProps extends BaseAnchorProps {
9
- href: string;
10
- replace?: boolean;
11
- }
12
- interface BackAnchorProps extends BaseAnchorProps {
13
- goBack: boolean;
14
- }
15
- type AnchorProps = XOR<ForwardAnchorProps, BackAnchorProps>;
16
- export default function Anchor(props: AnchorProps): JSX.Element;
17
- export {};
@@ -1,59 +0,0 @@
1
- import { Component } from 'react';
2
- import { SwipeEndEvent, SwipeEvent, SwipeStartEvent } from 'web-gesture-events';
3
- import Navigation from './NavigationBase';
4
- import { ScreenChild } from './index';
5
- import { AnimationLayerDataContext } from './AnimationLayerData';
6
- import { SwipeDirection } from './common/types';
7
- export declare const Motion: import("react").Context<number>;
8
- interface AnimationLayerProps {
9
- children: ScreenChild | ScreenChild[];
10
- currentPath: string;
11
- lastPath: string | null;
12
- navigation: Navigation;
13
- backNavigating: boolean;
14
- onGestureNavigationEnd: Function;
15
- onGestureNavigationStart: Function;
16
- onDocumentTitleChange(title: string | null): void;
17
- swipeDirection: SwipeDirection;
18
- hysteresis: number;
19
- minFlingVelocity: number;
20
- swipeAreaWidth: number;
21
- disableDiscovery: boolean;
22
- disableBrowserRouting: boolean;
23
- dispatchEvent: ((event: Event) => Promise<boolean>) | null;
24
- }
25
- interface AnimationLayerState {
26
- currentPath: string | null;
27
- children: ScreenChild | ScreenChild[];
28
- progress: number;
29
- shouldPlay: boolean;
30
- gestureNavigating: boolean;
31
- shouldAnimate: boolean;
32
- startX: number;
33
- startY: number;
34
- paths: (string | undefined)[];
35
- swipeDirection: SwipeDirection;
36
- swipeAreaWidth: number;
37
- minFlingVelocity: number;
38
- hysteresis: number;
39
- disableDiscovery: boolean;
40
- }
41
- export default class AnimationLayer extends Component<AnimationLayerProps, AnimationLayerState> {
42
- private onSwipeStartListener;
43
- private onSwipeListener;
44
- private onSwipeEndListener;
45
- private ref;
46
- static contextType: import("react").Context<import("./AnimationLayerData").default>;
47
- context: React.ContextType<typeof AnimationLayerDataContext>;
48
- state: AnimationLayerState;
49
- static getDerivedStateFromProps(nextProps: AnimationLayerProps, state: AnimationLayerState): Partial<AnimationLayerState> | null;
50
- componentDidMount(): void;
51
- componentDidUpdate(prevProps: AnimationLayerProps, prevState: AnimationLayerState): void;
52
- onGestureSuccess(state: Pick<AnimationLayerState, 'swipeAreaWidth' | 'swipeDirection' | 'hysteresis' | 'disableDiscovery' | 'minFlingVelocity'>, name: string | null): void;
53
- onSwipeStart(ev: SwipeStartEvent): void;
54
- onSwipe(ev: SwipeEvent): void;
55
- onSwipeEnd(ev: SwipeEndEvent): void;
56
- setRef: (ref: HTMLDivElement | null) => void;
57
- render(): JSX.Element;
58
- }
59
- export {};
@@ -1,54 +0,0 @@
1
- /// <reference types="react" />
2
- import AnimationProvider from './AnimationProvider';
3
- import { RouterEventMap } from './common/types';
4
- export default class AnimationLayerData {
5
- private _play;
6
- private _isPlaying;
7
- private _isStarted;
8
- private _currentScreen;
9
- private _nextScreen;
10
- private _onExit;
11
- private _progressUpdateID;
12
- private _pseudoElementInAnimation;
13
- private _pseudoElementOutAnimation;
14
- private _inAnimation;
15
- private _outAnimation;
16
- private _playbackRate;
17
- private _gestureNavigating;
18
- private _backNavigating;
19
- private _onEnd;
20
- private _onProgress;
21
- private _shouldAnimate;
22
- private _dispatchEvent;
23
- private _addEventListener;
24
- private updateProgress;
25
- reset(): void;
26
- finish(): void;
27
- cancel(): void;
28
- private cleanUpAnimation;
29
- animate(): Promise<void>;
30
- set onProgress(_onProgress: ((progress: number) => void) | null);
31
- set onEnd(_onEnd: Function | null);
32
- set shouldAnimate(_shouldAnimate: boolean);
33
- set playbackRate(_playbackRate: number);
34
- set gestureNavigating(_gestureNavigating: boolean);
35
- set backNavigating(_backNavigating: boolean);
36
- set play(_play: boolean);
37
- set progress(_progress: number);
38
- set currentScreen(_screen: AnimationProvider);
39
- set nextScreen(_screen: AnimationProvider);
40
- set onExit(_onExit: Function | undefined);
41
- set addEventListener(_addEventListener: (<K extends keyof RouterEventMap>(type: K, listener: (this: HTMLElement, ev: RouterEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined) => void) | null);
42
- set dispatchEvent(_dispatchEvent: ((event: Event) => Promise<boolean>) | null);
43
- get addEventListener(): (<K extends keyof RouterEventMap>(type: K, listener: (this: HTMLElement, ev: RouterEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined) => void) | null;
44
- get dispatchEvent(): ((event: Event) => Promise<boolean>) | null;
45
- get duration(): number;
46
- get progress(): number;
47
- get gestureNavigating(): boolean;
48
- get backNavigating(): boolean;
49
- get isPlaying(): boolean;
50
- get ready(): Promise<void>;
51
- get finished(): Promise<void>;
52
- get started(): Promise<void>;
53
- }
54
- export declare const AnimationLayerDataContext: import("react").Context<AnimationLayerData>;
@@ -1,56 +0,0 @@
1
- import { AnimationConfigSet, AnimationKeyframeEffectConfig, CustomElementType, EasingFunction } from './common/types';
2
- import AnimationKeyframePresets from './Animations';
3
- import NavigationBase from './NavigationBase';
4
- import { Component, ElementType } from 'react';
5
- interface AnimationProviderProps {
6
- onRef: (ref: HTMLElement | null) => void;
7
- onExit: Function;
8
- onExited: Function;
9
- onEnter: Function;
10
- onEntered: Function;
11
- in: boolean;
12
- out: boolean;
13
- name: string;
14
- resolvedPathname?: string;
15
- animation: AnimationConfigSet | (() => AnimationConfigSet);
16
- pseudoElement?: {
17
- selector: string;
18
- animation: AnimationConfigSet | (() => AnimationConfigSet);
19
- };
20
- backNavigating: boolean;
21
- keepAlive: boolean;
22
- children: React.ReactNode;
23
- navigation: NavigationBase;
24
- renderAs: ElementType | CustomElementType;
25
- }
26
- interface AnimationProviderState {
27
- mounted: boolean;
28
- zIndex: number;
29
- }
30
- export default class AnimationProvider extends Component<AnimationProviderProps, AnimationProviderState> {
31
- private _animationLayerData;
32
- private ref;
33
- private onAnimationEnd;
34
- private onNavigate;
35
- private setRef;
36
- state: AnimationProviderState;
37
- onRef(ref: HTMLElement | null): void;
38
- animationEnd(): void;
39
- navigate(): void;
40
- componentDidMount(): void;
41
- componentDidUpdate(prevProps: AnimationProviderProps): void;
42
- componentWillUnmount(): void;
43
- private getAnimationConfig;
44
- get pseudoElementInAnimation(): AnimationKeyframeEffectConfig | ["none" | "slide-right-in" | "slide-back-right-in" | "slide-right-out" | "slide-back-right-out" | "slide-left-in" | "slide-back-left-in" | "slide-left-out" | "slide-back-left-out" | "slide-up-in" | "slide-back-up-in" | "slide-up-out" | "slide-back-up-out" | "slide-down-in" | "slide-back-down-in" | "slide-down-out" | "slide-back-down-out" | "zoom-in-in" | "zoom-in-out" | "zoom-out-in" | "zoom-out-out" | "fade-in" | "fade-out", number, EasingFunction | undefined] | null;
45
- get pseudoElementOutAnimation(): AnimationKeyframeEffectConfig | ["none" | "slide-right-in" | "slide-back-right-in" | "slide-right-out" | "slide-back-right-out" | "slide-left-in" | "slide-back-left-in" | "slide-left-out" | "slide-back-left-out" | "slide-up-in" | "slide-back-up-in" | "slide-up-out" | "slide-back-up-out" | "slide-down-in" | "slide-back-down-in" | "slide-down-out" | "slide-back-down-out" | "zoom-in-in" | "zoom-in-out" | "zoom-out-in" | "zoom-out-out" | "fade-in" | "fade-out", number, EasingFunction | undefined] | null;
46
- get inAnimation(): AnimationKeyframeEffectConfig | ["none" | "slide-right-in" | "slide-back-right-in" | "slide-right-out" | "slide-back-right-out" | "slide-left-in" | "slide-back-left-in" | "slide-left-out" | "slide-back-left-out" | "slide-up-in" | "slide-back-up-in" | "slide-up-out" | "slide-back-up-out" | "slide-down-in" | "slide-back-down-in" | "slide-down-out" | "slide-back-down-out" | "zoom-in-in" | "zoom-in-out" | "zoom-out-in" | "zoom-out-out" | "fade-in" | "fade-out", number, EasingFunction | undefined];
47
- get outAnimation(): AnimationKeyframeEffectConfig | [keyof typeof AnimationKeyframePresets, number, EasingFunction | undefined];
48
- get pseudoElementDuration(): string | number | null | undefined;
49
- get duration(): string | number | undefined;
50
- get pseudoElementAnimation(): Animation | null;
51
- get animation(): Animation | null;
52
- set zIndex(_zIndex: number);
53
- mounted(_mounted: boolean, willAnimate?: boolean): Promise<void>;
54
- render(): JSX.Element;
55
- }
56
- export {};
@@ -1,77 +0,0 @@
1
- declare const Presets: {
2
- "slide-right-in": {
3
- transform: string;
4
- }[];
5
- "slide-back-right-in": {
6
- transform: string;
7
- }[];
8
- "slide-right-out": {
9
- transform: string;
10
- }[];
11
- "slide-back-right-out": {
12
- transform: string;
13
- }[];
14
- "slide-left-in": {
15
- transform: string;
16
- }[];
17
- "slide-back-left-in": {
18
- transform: string;
19
- }[];
20
- "slide-left-out": {
21
- transform: string;
22
- }[];
23
- "slide-back-left-out": {
24
- transform: string;
25
- }[];
26
- "slide-up-in": {
27
- transform: string;
28
- }[];
29
- "slide-back-up-in": {
30
- transform: string;
31
- }[];
32
- "slide-up-out": {
33
- transform: string;
34
- }[];
35
- "slide-back-up-out": {
36
- transform: string;
37
- }[];
38
- "slide-down-in": {
39
- transform: string;
40
- }[];
41
- "slide-back-down-in": {
42
- transform: string;
43
- }[];
44
- "slide-down-out": {
45
- transform: string;
46
- }[];
47
- "slide-back-down-out": {
48
- transform: string;
49
- }[];
50
- "zoom-in-in": {
51
- transform: string;
52
- opacity: number;
53
- }[];
54
- "zoom-in-out": {
55
- transform: string;
56
- opacity: number;
57
- }[];
58
- "zoom-out-in": {
59
- transform: string;
60
- opacity: number;
61
- }[];
62
- "zoom-out-out": {
63
- transform: string;
64
- opacity: number;
65
- }[];
66
- "fade-in": {
67
- opacity: number;
68
- }[];
69
- "fade-out": {
70
- opacity: number;
71
- }[];
72
- none: never[];
73
- };
74
- declare const AnimationKeyframePresets: {
75
- [Property in keyof typeof Presets]: Keyframe[];
76
- };
77
- export default AnimationKeyframePresets;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- interface GestureRegionProps extends React.HTMLAttributes<HTMLDivElement> {
3
- disabled?: boolean;
4
- }
5
- export default function GestureRegion({ disabled, children, ...props }: GestureRegionProps): JSX.Element;
6
- export {};
@@ -1,38 +0,0 @@
1
- import { SharedElementScene } from './SharedElement';
2
- import { MotionProgressEvent } from './MotionEvents';
3
- import AnimationLayerData, { AnimationLayerDataContext } from './AnimationLayerData';
4
- import NavigationBase from './NavigationBase';
5
- import { Component } from 'react';
6
- interface GhostLayerProps {
7
- instance?: (instance: GhostLayer | null) => any;
8
- backNavigating: boolean;
9
- gestureNavigating: boolean;
10
- navigation: NavigationBase;
11
- animationLayerData: AnimationLayerData;
12
- }
13
- interface GhostLayerState {
14
- transitioning: boolean;
15
- playing: boolean;
16
- }
17
- export default class GhostLayer extends Component<GhostLayerProps, GhostLayerState> {
18
- private ref;
19
- private _currentScene;
20
- private _nextScene;
21
- static contextType: import("react").Context<AnimationLayerData>;
22
- context: React.ContextType<typeof AnimationLayerDataContext>;
23
- private onProgressStartListener;
24
- private onProgressListener;
25
- private onProgressEndListener;
26
- state: GhostLayerState;
27
- set currentScene(scene: SharedElementScene);
28
- set nextScene(scene: SharedElementScene);
29
- finish(): void;
30
- sharedElementTransition(currentScene: SharedElementScene, nextScene: SharedElementScene): void;
31
- componentDidMount(): void;
32
- componentWillUnmount(): void;
33
- onProgressStart(): void;
34
- onProgress(e: MotionProgressEvent): void;
35
- onProgressEnd(): void;
36
- render(): JSX.Element;
37
- }
38
- export {};
@@ -1,30 +0,0 @@
1
- export default abstract class HistoryBase {
2
- private _baseURL;
3
- protected _stack: string[];
4
- private _defaultRoute;
5
- protected readonly _routerId: string;
6
- constructor(_routerId: string, _defaultRoute: string | null, _baseURL: URL);
7
- protected abstract set next(_next: string | null);
8
- protected set defaultRoute(_defaultRoute: string);
9
- abstract get current(): string;
10
- get length(): number;
11
- get defaultRoute(): string;
12
- abstract canGoBack(): boolean;
13
- abstract get next(): string | null;
14
- abstract get previous(): string | null;
15
- get isEmpty(): boolean;
16
- get baseURL(): URL;
17
- get state(): {
18
- set<V>(key: string | number | symbol, value: V): boolean;
19
- get<V_1>(key: string | number | symbol): V_1 | null;
20
- has(key: string | number | symbol): boolean;
21
- delete(key: string | number | symbol): boolean;
22
- keys(): string[];
23
- values(): unknown[];
24
- clear(): void;
25
- readonly length: number;
26
- };
27
- protected pushState(data: any, unused: string, url?: string | URL | null | undefined): void;
28
- protected replaceState(data: any, unused: string, url?: string | URL | null | undefined): void;
29
- protected static getURL(route: string, baseURL: URL, search?: string): URL;
30
- }
@@ -1,19 +0,0 @@
1
- import { MetaType } from "./common/types";
2
- export default class MetaData {
3
- private _map;
4
- private mutationObserver;
5
- constructor();
6
- get(key: string | MetaType): string | [string, string][] | undefined;
7
- set(key: string | MetaType, content?: string | [string, string][]): void;
8
- has(key: string | MetaType): boolean;
9
- delete(key: string | MetaType): void;
10
- clear(): void;
11
- entries(): IterableIterator<[`name=${string}` | `property=${string}` | `http-equiv=${string}` | `itemprop=${string}` | `charset=${string}`, string | undefined]>;
12
- [Symbol.iterator](): IterableIterator<[`name=${string}` | `property=${string}` | `http-equiv=${string}` | `itemprop=${string}` | `charset=${string}`, string | undefined]>;
13
- get size(): number;
14
- private observeMutations;
15
- private metaDataFromNode;
16
- private getMetaKey;
17
- private getMetaContent;
18
- private updateMetaElement;
19
- }
@@ -1,59 +0,0 @@
1
- import { ParamsDeserializer, ParamsSerializer, PlainObject, RouterEventMap } from "./common/types";
2
- import HistoryBase from "./HistoryBase";
3
- import MetaData from "./MetaData";
4
- import RouterData from "./RouterData";
5
- export interface BackEventDetail {
6
- routerId: string;
7
- signal: AbortSignal;
8
- finished: Promise<void>;
9
- }
10
- export interface NavigateEventDetail {
11
- routerId: string;
12
- route: string;
13
- routeParams?: any;
14
- replace: boolean;
15
- signal: AbortSignal;
16
- finished: Promise<void>;
17
- }
18
- export type NavigateEvent = CustomEvent<NavigateEventDetail>;
19
- export type BackEvent = CustomEvent<BackEventDetail>;
20
- export interface NavigationOptions {
21
- signal?: AbortSignal;
22
- }
23
- export interface NavigateOptions extends NavigationOptions {
24
- replace?: boolean;
25
- hash?: string;
26
- }
27
- export interface GoBackOptions extends NavigationOptions {
28
- }
29
- export default abstract class NavigationBase {
30
- protected readonly routerData: RouterData;
31
- private static rootNavigatorRef;
32
- protected readonly _routerId: string;
33
- private _metaData;
34
- protected abstract _history: HistoryBase;
35
- protected readonly _disableBrowserRouting: boolean;
36
- protected _currentParams: PlainObject;
37
- constructor(_routerId: string, _routerData: RouterData, _disableBrowserRouting?: boolean, _defaultRoute?: string | null);
38
- destructor(): void;
39
- addEventListener<K extends keyof RouterEventMap>(type: K, listener: (this: HTMLElement, ev: RouterEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): () => void | undefined;
40
- removeEventListener<K extends keyof RouterEventMap>(type: K, listener: (this: HTMLElement, ev: RouterEventMap[K]) => any, options?: boolean | EventListenerOptions | undefined): void;
41
- abstract get parent(): NavigationBase | null;
42
- get disableBrowserRouting(): boolean;
43
- get routerId(): string;
44
- canGoBack(): boolean;
45
- private popStateListener;
46
- getNavigatorById(routerId: string, target?: NavigationBase): NavigationBase | null | undefined;
47
- prefetchRoute(path: string): Promise<boolean>;
48
- abstract get finished(): Promise<void>;
49
- abstract onPopState(e: Event): void;
50
- abstract navigate<T extends PlainObject = PlainObject>(route: string, routeParams?: T, options?: NavigateOptions): void;
51
- abstract goBack(options?: GoBackOptions): void;
52
- protected get dispatchEvent(): ((event: Event) => Promise<boolean>) | null;
53
- get paramsDeserializer(): ParamsDeserializer | undefined;
54
- get paramsSerializer(): ParamsSerializer | undefined;
55
- get history(): HistoryBase;
56
- get metaData(): MetaData;
57
- abstract get location(): Location;
58
- private get isInDocument();
59
- }
@@ -1,4 +0,0 @@
1
- /// <reference types="react" />
2
- import { PlainObject, RouteProp } from "./common/types";
3
- import { ScreenBaseProps } from "./ScreenBase";
4
- export declare const RouteDataContext: import("react").Context<RouteProp<ScreenBaseProps, PlainObject<any>>>;