Skip to content

Commit e178422

Browse files
committed
[fix] small ts fixes
1 parent 6291535 commit e178422

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/lib/Route.svelte.d.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import type { SvelteComponent } from 'svelte';
1+
import type { Component } from 'svelte';
22

33
export interface RouteProps {
44
path?: string;
5-
component?: typeof SvelteComponent;
5+
component?: Component;
66
}
77

8-
export default class Route extends SvelteComponent<RouteProps> {}
8+
declare const Route: Component<RouteProps>;
9+
export default Route;

src/lib/Router.svelte.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { SvelteComponent } from 'svelte';
1+
import type { Component } from 'svelte';
22

33
export interface RouteInfo {
44
path: string;
@@ -19,4 +19,5 @@ export interface RouterProps {
1919
beforeEach?: NavigationGuard[];
2020
}
2121

22-
export default class Router extends SvelteComponent<RouterProps> {}
22+
declare const Router: Component<RouterProps>;
23+
export default Router;

src/lib/context.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { SvelteComponent } from 'svelte';
2-
import type { NavigationGuard } from './Router.svelte';
1+
import type { NavigationGuard } from './Router.svelte';
32

43
export interface RouterContext {
54
base: string; // Base path of the current router instance
@@ -14,4 +13,4 @@ export interface RouterContext {
1413
getQueryParam: (key: string) => string | undefined;
1514
hasQueryParam: (key: string) => boolean;
1615
removeQueryParams: (keys: string[]) => void;
17-
}
16+
}

0 commit comments

Comments
 (0)