From d2251ffed630aac6e76e71856204ead5dd2f6661 Mon Sep 17 00:00:00 2001 From: Sanshain <40761960+Sanshain@users.noreply.github.com> Date: Sun, 18 Sep 2022 12:15:27 +0300 Subject: [PATCH] fix ts error "'typeof Route' is not assignable to" Full error text: ``` Argument of type 'typeof Route' is not assignable to parameter of type 'ConstructorOfATypedSvelteComponent'. Type 'Route' is missing the following properties from type 'ATypedSvelteComponent': $$events_def, $on ``` --- index.d.ts | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 3f969c3..89f3ddd 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,3 +1,5 @@ +import type { SvelteComponentTyped } from "svelte"; + interface TinroRoute { url: string from: string @@ -81,7 +83,39 @@ declare interface TinroRouter { export const active: any export function meta(): TinroRouteMeta export const router: TinroRouter -export class Route { + +type RouteArgs = { + /** + * Exact o relative path of the route + * @default "/*" + */ + path?: string; + + /** + * Is route fallback + * @default false + */ + fallback?: boolean; + + /** + * Redirect route to the specified path + */ + redirect?: string; + + /** + * Will be show only first matched with URL nested route + * @default false + */ + firstmatch?: boolean; + + /** + * Name of the route to use in breadcrumbs + * @default null + */ + breadcrumb?: string; +} + +export class Route extends SvelteComponentTyped { $$prop_def: { /** * Exact o relative path of the route