Skip to content

Commit

Permalink
Correct some issues with TS typings (#446)
Browse files Browse the repository at this point in the history
* Correct some issues with TS typings

* test: Correcting 'Link' import source

---------

Co-authored-by: Ryan Christian <rchristian@ryanchristian.dev>
  • Loading branch information
vpzomtrrfrt and rschristian committed May 17, 2023
1 parent baf4bf9 commit 3412017
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
9 changes: 2 additions & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as preact from 'preact';
export function route(url: string, replace?: boolean): boolean;
export function route(options: { url: string; replace?: boolean }): boolean;

export function exec(url: string, route: string, opts: { default?: boolean }): boolean;
export function exec(url: string, route: string, opts: { default?: boolean }): false | Record<string, string | undefined>;

export function getCurrentUrl(): string;

Expand Down Expand Up @@ -53,11 +53,6 @@ export interface RouterProps<

export class Router extends preact.Component<RouterProps, {}> {
canRoute(url: string): boolean;
getMatchingChildren(
children: preact.VNode[],
url: string,
invoke: boolean
): preact.VNode[];
routeTo(url: string): boolean;
render(props: RouterProps, {}): preact.VNode;
}
Expand All @@ -75,7 +70,7 @@ export function Route<Props>(
): preact.VNode;

export function Link(
props: { activeClassName?: string } & preact.JSX.HTMLAttributes
props: preact.JSX.HTMLAttributes<HTMLAnchorElement>
): preact.VNode;

export function useRouter<
Expand Down
3 changes: 1 addition & 2 deletions test/match.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { h } from 'preact';
import { Link, RoutableProps } from '../';
import { Match } from '../match';
import { Link, Match } from '../match';

function ChildComponent({}: {}) {
return <div></div>;
Expand Down

0 comments on commit 3412017

Please sign in to comment.