From ab7fdf99962279e8a78133496c876a8fceb84f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Wei=C3=9Fenfels?= Date: Sat, 26 Feb 2022 13:29:19 +0100 Subject: [PATCH 1/3] Add types to Match function --- match/index.d.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/match/index.d.ts b/match/index.d.ts index 13e617a..6fa464f 100644 --- a/match/index.d.ts +++ b/match/index.d.ts @@ -2,7 +2,17 @@ import * as preact from 'preact'; import { Link as StaticLink, RoutableProps } from '..'; -export class Match extends preact.Component { +type MatchInfo = { + url: string; + path: string; + matches: Record; +}; + +type MatchProps = RoutableProps & { + children: (info: MatchInfo) => preact.VNode; +}; + +export class Match extends preact.Component { render(): preact.VNode; } From edd80e3d5bb671081273e516412325d1d986c423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Wei=C3=9Fenfels?= Date: Sat, 26 Feb 2022 13:29:48 +0100 Subject: [PATCH 2/3] Remove unused import --- match/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/match/index.d.ts b/match/index.d.ts index 6fa464f..4cdadcc 100644 --- a/match/index.d.ts +++ b/match/index.d.ts @@ -1,6 +1,6 @@ import * as preact from 'preact'; -import { Link as StaticLink, RoutableProps } from '..'; +import { RoutableProps } from '..'; type MatchInfo = { url: string; From 418deb1153bb1234de15e9283e8c7ec09380d6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Wei=C3=9Fenfels?= Date: Sat, 26 Feb 2022 13:34:08 +0100 Subject: [PATCH 3/3] Remove unused import --- test/match.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/match.tsx b/test/match.tsx index d520646..243f89b 100644 --- a/test/match.tsx +++ b/test/match.tsx @@ -1,5 +1,5 @@ import { h } from 'preact'; -import { Link, RoutableProps } from '../'; +import { Link } from '../'; import { Match } from '../match'; function ChildComponent({}: {}) {