@react-motion-router/core 2.0.0-beta.sha-0daf7c7 → 2.0.0-beta.sha-4fafa70
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/build/NavigationBase.d.ts +0 -1
- package/build/RouterBase.d.ts +7 -1
- package/build/ScreenBase.d.ts +8 -2
- package/build/__tests__/match-route.test.d.ts +1 -0
- package/build/common/types.d.ts +2 -1
- package/build/index.js +293 -293
- package/build/index.js.map +1 -1
- package/package.json +8 -4
|
@@ -16,6 +16,5 @@ export declare abstract class NavigationBase<E extends RouterBaseEventMap = Rout
|
|
|
16
16
|
get baseURL(): URL;
|
|
17
17
|
get baseURLPattern(): URLPattern;
|
|
18
18
|
getNavigatorById(routerId: string): NavigationBase<RouterBaseEventMap> | null;
|
|
19
|
-
preloadRoute(path: string): Promise<boolean>;
|
|
20
19
|
private get isInDocument();
|
|
21
20
|
}
|
package/build/RouterBase.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { ScreenChild, RouterBaseEventMap, RouterHTMLElement } from './common/typ
|
|
|
4
4
|
import { NestedRouterContext } from './RouterContext';
|
|
5
5
|
import { Component } from 'react';
|
|
6
6
|
import { ScreenBase, ScreenBaseConfig } from './ScreenBase';
|
|
7
|
+
type ScreenType<T> = T extends ScreenChild<infer S> | ScreenChild<infer S>[] ? S : never;
|
|
7
8
|
export interface RouterBaseConfig {
|
|
8
9
|
screenConfig?: ScreenBaseConfig;
|
|
9
10
|
basePath?: string;
|
|
@@ -40,7 +41,11 @@ export declare abstract class RouterBase<P extends RouterBaseProps = RouterBaseP
|
|
|
40
41
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
41
42
|
removeEventListener<K extends keyof E>(type: K, listener: (this: RouterHTMLElement<E>, ev: E[K]) => any, options?: boolean | EventListenerOptions | undefined): void;
|
|
42
43
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
43
|
-
|
|
44
|
+
protected screenChildFromPathname(pathname: string): {
|
|
45
|
+
child: ScreenChild<ScreenType<P["children"]>>;
|
|
46
|
+
matchInfo: import('./common/types').MatchedRoute;
|
|
47
|
+
} | null;
|
|
48
|
+
protected preloadScreen(screen: ScreenChild): Promise<void>;
|
|
44
49
|
get id(): string;
|
|
45
50
|
get isRoot(): boolean;
|
|
46
51
|
get baseURL(): URL;
|
|
@@ -58,3 +63,4 @@ export declare abstract class RouterBase<P extends RouterBaseProps = RouterBaseP
|
|
|
58
63
|
protected abstract get screens(): P["children"];
|
|
59
64
|
render(): JSX.Element | undefined;
|
|
60
65
|
}
|
|
66
|
+
export {};
|
package/build/ScreenBase.d.ts
CHANGED
|
@@ -8,9 +8,15 @@ export interface ScreenBaseComponentProps<R extends RoutePropBase = RoutePropBas
|
|
|
8
8
|
route: R;
|
|
9
9
|
navigation: N;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type LifecycleProps<R extends RoutePropBase, N extends NavigationBase = NavigationBase> = ({
|
|
12
12
|
signal: AbortSignal;
|
|
13
|
-
|
|
13
|
+
preloading: false;
|
|
14
|
+
} & ScreenBaseComponentProps<R, N>) | ({
|
|
15
|
+
signal?: AbortSignal;
|
|
16
|
+
preloading: true;
|
|
17
|
+
} & Omit<ScreenBaseComponentProps<R, N>, 'route'> & {
|
|
18
|
+
route: Omit<ScreenBaseComponentProps<R, N>['route'], 'setParams' | 'setConfig'>;
|
|
19
|
+
});
|
|
14
20
|
export interface ScreenBaseConfig<R extends RoutePropBase = RoutePropBase, N extends NavigationBase = NavigationBase> {
|
|
15
21
|
header?: {
|
|
16
22
|
fallback?: React.ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/common/types.d.ts
CHANGED
|
@@ -54,7 +54,8 @@ export type RouterHTMLElement<E extends RouterBaseEventMap, T extends HTMLElemen
|
|
|
54
54
|
};
|
|
55
55
|
export type CustomElementType = `${string}-${string}`;
|
|
56
56
|
export interface MatchedRoute {
|
|
57
|
-
params
|
|
57
|
+
params: PlainObject<string | undefined>;
|
|
58
|
+
caseSensitive: boolean;
|
|
58
59
|
}
|
|
59
60
|
export interface PathPattern {
|
|
60
61
|
pattern: string;
|