revojs 0.0.73 → 0.0.74
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/html/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/router/index.d.ts +2 -2
- package/package.json +1 -1
package/dist/html/index.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ export declare function useEvent<T extends keyof ElementEventMap>(scope: Scope,
|
|
|
88
88
|
export declare function useEvent<T extends keyof WindowEventMap>(scope: Scope, target: Window | undefined | null, event: T, input: EventListener<WindowEventMap[T]>, options?: AddEventListenerOptions): void;
|
|
89
89
|
export declare function useEvent<T extends keyof HTMLElementEventMap>(scope: Scope, target: Document | HTMLElement | undefined | null, event: T, input: EventListener<HTMLElementEventMap[T]>, options?: AddEventListenerOptions): void;
|
|
90
90
|
export declare function onMounted(scope: Scope, event: EventListener<MountedEvent>): void;
|
|
91
|
-
export declare function startViewTransition(invoke: ViewTransitionUpdateCallback): Promise<void>;
|
|
91
|
+
export declare function startViewTransition(invoke: ViewTransitionUpdateCallback): void | Promise<void>;
|
|
92
92
|
export declare function isClient(): boolean;
|
|
93
93
|
export declare function isServer(): boolean;
|
|
94
94
|
export declare function preventDefault(event: Event): void;
|
package/dist/index.js
CHANGED
|
@@ -859,8 +859,9 @@ function useRouter(scope, context) {
|
|
|
859
859
|
const navigate = (path) => {
|
|
860
860
|
if (isClient()) {
|
|
861
861
|
if (window.location.pathname != path) window.history.pushState(window.history.state, "", path);
|
|
862
|
+
return navigator.dispatchEvent(new NavigateEvent());
|
|
862
863
|
}
|
|
863
|
-
|
|
864
|
+
throw sendRedirect(scope, path);
|
|
864
865
|
};
|
|
865
866
|
const anchorNavigate = (event) => {
|
|
866
867
|
event.preventDefault();
|
package/dist/router/index.d.ts
CHANGED
|
@@ -21,14 +21,14 @@ export declare function provideRouterContext(scope: Scope, options: RouterOption
|
|
|
21
21
|
url: State<URL | undefined>;
|
|
22
22
|
route: State<unknown>;
|
|
23
23
|
navigator: EventTarget;
|
|
24
|
-
navigate: (path: string) =>
|
|
24
|
+
navigate: (path: string) => boolean;
|
|
25
25
|
anchorNavigate: (event: Event) => void;
|
|
26
26
|
};
|
|
27
27
|
export declare function useRouter<T extends RouterContext>(scope: Scope, context?: Descriptor<T>): {
|
|
28
28
|
url: State<URL | undefined>;
|
|
29
29
|
route: State<unknown>;
|
|
30
30
|
navigator: EventTarget;
|
|
31
|
-
navigate: (path: string) =>
|
|
31
|
+
navigate: (path: string) => boolean;
|
|
32
32
|
anchorNavigate: (event: Event) => void;
|
|
33
33
|
};
|
|
34
34
|
export declare const Page: import("..").ComponentConstructor<import("..").Events, import("..").Attributes>;
|