@v-miniapp/router 1.0.7 → 1.0.8
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/dist/components/error/error-boundary.d.ts +15 -0
- package/dist/components/error/index.d.ts +1 -0
- package/dist/components/freeze/index.d.ts +11 -0
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/page-loading.d.ts +2 -0
- package/dist/components/link/index.d.ts +8 -0
- package/dist/components/router/index.d.ts +1 -0
- package/dist/components/router/pages-render.d.ts +2 -0
- package/dist/components/router/render-layout.d.ts +5 -0
- package/dist/components/router/router.d.ts +6 -0
- package/dist/components/router/style-pages-render.d.ts +2 -0
- package/dist/context/location-key.d.ts +4 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/use-app-pause.d.ts +1 -0
- package/dist/hooks/use-app-resume.d.ts +1 -0
- package/dist/hooks/use-app-state.d.ts +7 -0
- package/dist/hooks/use-did-hide.d.ts +1 -0
- package/dist/hooks/use-did-show.d.ts +1 -0
- package/dist/hooks/use-history.d.ts +2 -0
- package/dist/hooks/use-location.d.ts +1 -0
- package/dist/hooks/use-navigate.d.ts +1 -0
- package/dist/hooks/use-navigation-type.d.ts +1 -0
- package/dist/hooks/use-swipe-navigation.d.ts +2 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +2532 -0
- package/dist/stores/router.d.ts +51 -0
- package/dist/stores/router.selector.d.ts +11 -0
- package/dist/styles.css +1 -0
- package/dist/styles.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/navigation.d.ts +29 -0
- package/dist/types/router.d.ts +46 -0
- package/dist/utils/analytic.d.ts +14 -0
- package/dist/utils/animation.d.ts +4 -0
- package/dist/utils/classname.d.ts +2 -0
- package/dist/utils/deep-clone.d.ts +1 -0
- package/dist/utils/event-emitter.d.ts +11 -0
- package/dist/utils/history.d.ts +7 -0
- package/dist/utils/url.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React, ComponentType } from 'react';
|
|
2
|
+
type IErrorBoundaryProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
Component?: ComponentType;
|
|
5
|
+
};
|
|
6
|
+
type IErrorBoundaryState = {
|
|
7
|
+
hasError: boolean;
|
|
8
|
+
error: Error | null;
|
|
9
|
+
};
|
|
10
|
+
export declare class ErrorBoundary extends React.Component<IErrorBoundaryProps, IErrorBoundaryState> {
|
|
11
|
+
constructor(props: IErrorBoundaryProps);
|
|
12
|
+
static getDerivedStateFromError(error: Error): Partial<IErrorBoundaryState>;
|
|
13
|
+
render(): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './error-boundary';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type ISuspenderProps = {
|
|
3
|
+
freeze: boolean;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
type IFreezeProps = ISuspenderProps & {
|
|
7
|
+
placeholder?: React.ReactNode;
|
|
8
|
+
delay?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function Freeze({ freeze, delay, children, placeholder, }: IFreezeProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './page-loading';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentProps, FC } from 'react';
|
|
2
|
+
import { INavigateDeltaOptions, INavigatePathnameOptions } from '../../types';
|
|
3
|
+
export type ILinkProps = Omit<ComponentProps<'a'>, 'href' | 'onClick'> & (({
|
|
4
|
+
to: number;
|
|
5
|
+
} & INavigateDeltaOptions) | ({
|
|
6
|
+
to: string;
|
|
7
|
+
} & INavigatePathnameOptions));
|
|
8
|
+
export declare const Link: FC<ILinkProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './router';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IRouterConfig } from '../../types/router';
|
|
2
|
+
export type IRouterConfigFunction = () => IRouterConfig;
|
|
3
|
+
export type IRouterProps = {
|
|
4
|
+
config: IRouterConfig | IRouterConfigFunction;
|
|
5
|
+
};
|
|
6
|
+
export declare const Router: ({ config }: IRouterProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './use-app-pause';
|
|
2
|
+
export * from './use-app-resume';
|
|
3
|
+
export * from './use-app-state';
|
|
4
|
+
export * from './use-did-hide';
|
|
5
|
+
export * from './use-did-show';
|
|
6
|
+
export * from './use-history';
|
|
7
|
+
export * from './use-location';
|
|
8
|
+
export * from './use-navigate';
|
|
9
|
+
export * from './use-navigation-type';
|
|
10
|
+
export * from './use-swipe-navigation';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useAppPause: (onPause: () => void) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useAppResume: (onResume: () => void) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IRouterAppState } from '../types/router';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export declare const useAppState: () => {
|
|
4
|
+
config: import('../types/router').IRouterConfig;
|
|
5
|
+
appState: IRouterAppState;
|
|
6
|
+
setAppState: Dispatch<SetStateAction<IRouterAppState>>;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDidHide: (func?: () => void) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDidShow: (func?: () => void) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useLocation: () => import('..').ILocation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useNavigate: () => import('..').INavigate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useNavigationType: () => import('..').IHistoryAction;
|