@v-miniapp/router 1.0.7 → 1.0.9

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.
Files changed (40) hide show
  1. package/dist/components/error/error-boundary.d.ts +15 -0
  2. package/dist/components/error/index.d.ts +1 -0
  3. package/dist/components/freeze/index.d.ts +11 -0
  4. package/dist/components/layout/index.d.ts +1 -0
  5. package/dist/components/layout/page-loading.d.ts +2 -0
  6. package/dist/components/link/index.d.ts +8 -0
  7. package/dist/components/router/index.d.ts +1 -0
  8. package/dist/components/router/pages-render.d.ts +2 -0
  9. package/dist/components/router/render-layout.d.ts +5 -0
  10. package/dist/components/router/router.d.ts +6 -0
  11. package/dist/components/router/style-pages-render.d.ts +2 -0
  12. package/dist/context/location-key.d.ts +4 -0
  13. package/dist/hooks/index.d.ts +10 -0
  14. package/dist/hooks/use-app-pause.d.ts +1 -0
  15. package/dist/hooks/use-app-resume.d.ts +1 -0
  16. package/dist/hooks/use-app-state.d.ts +7 -0
  17. package/dist/hooks/use-did-hide.d.ts +1 -0
  18. package/dist/hooks/use-did-show.d.ts +1 -0
  19. package/dist/hooks/use-history.d.ts +2 -0
  20. package/dist/hooks/use-location.d.ts +1 -0
  21. package/dist/hooks/use-navigate.d.ts +1 -0
  22. package/dist/hooks/use-navigation-type.d.ts +1 -0
  23. package/dist/hooks/use-swipe-navigation.d.ts +2 -0
  24. package/dist/index.d.ts +6 -0
  25. package/dist/index.js +2532 -0
  26. package/dist/stores/router.d.ts +51 -0
  27. package/dist/stores/router.selector.d.ts +11 -0
  28. package/dist/styles.css +1 -0
  29. package/dist/styles.d.ts +1 -0
  30. package/dist/types/index.d.ts +2 -0
  31. package/dist/types/navigation.d.ts +29 -0
  32. package/dist/types/router.d.ts +46 -0
  33. package/dist/utils/analytic.d.ts +14 -0
  34. package/dist/utils/animation.d.ts +4 -0
  35. package/dist/utils/classname.d.ts +2 -0
  36. package/dist/utils/deep-clone.d.ts +1 -0
  37. package/dist/utils/event-emitter.d.ts +11 -0
  38. package/dist/utils/history.d.ts +7 -0
  39. package/dist/utils/url.d.ts +1 -0
  40. 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,2 @@
1
+ import { default as React } from 'react';
2
+ export declare const PageLoading: React.FC;
@@ -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,2 @@
1
+ import { FC } from 'react';
2
+ export declare const PagesRender: FC;
@@ -0,0 +1,5 @@
1
+ import { ILayout } from '../../types';
2
+ import { FC, PropsWithChildren } from 'react';
3
+ export declare const LayoutsRender: FC<PropsWithChildren & {
4
+ Layouts: ILayout[];
5
+ }>;
@@ -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,2 @@
1
+ import { FC } from 'react';
2
+ export declare const StylePagesRender: FC;
@@ -0,0 +1,4 @@
1
+ export type ILocationKeyState = {
2
+ locationKey: string | null;
3
+ };
4
+ export declare const LocationKeyContext: import('react').Context<ILocationKeyState>;
@@ -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,2 @@
1
+ export declare const useHistory: () => import('..').IHistory;
2
+ export declare const useHistories: () => import('..').IHistory[];
@@ -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;
@@ -0,0 +1,2 @@
1
+ export declare const useSwipeNavigation: () => import('react').RefObject<boolean>;
2
+ export declare const onSwipeNavigation: (callback: (isSwipeNavigation: boolean) => void) => () => void;
@@ -0,0 +1,6 @@
1
+ export * from './components/router';
2
+ export * from './components/link';
3
+ export * from './hooks';
4
+ export { PAGE_PATH_NAME } from './utils/history';
5
+ export type * from './types';
6
+ export { routerEvents } from './stores/router';