UNPKG

@furystack/shades-common-components

Version:

Common UI components for FuryStack Shades

29 lines 1.41 kB
import type { ChildrenList, ExtractRoutePaths, NestedRoute, NestedRouteLinkProps } from '@furystack/shades'; import { type MatchOptions } from 'path-to-regexp'; export type AppBarLinkProps = NestedRouteLinkProps & { routingOptions?: MatchOptions; }; export declare const AppBarLink: (props: { path: string; params?: Record<string, string>; query?: Record<string, unknown>; hash?: string; } & Omit<Partial<Omit<HTMLAnchorElement, "onclick" | "href">>, "style"> & { style?: Partial<CSSStyleDeclaration>; } & { ref?: import("@furystack/shades").RefObject<Element>; } & { routingOptions?: MatchOptions; } & Omit<Partial<HTMLElement>, "style">, children?: ChildrenList) => JSX.Element; /** * Creates a type-safe wrapper around AppBarLink constrained to a specific route tree. * The returned component has the same runtime behavior but narrows `path` to only accept * valid route paths, and requires `params` when the route has parameters. * * @typeParam TRoutes - The route tree type (use `typeof yourRoutes`) * @returns A type-safe AppBarLink component constrained to a specific route tree. */ export declare const createAppBarLink: <TRoutes extends Record<string, NestedRoute<any, any, any>>>() => <TPath extends ExtractRoutePaths<TRoutes>>(props: AppBarLinkProps & { path: TPath; }, children?: ChildrenList) => JSX.Element; //# sourceMappingURL=app-bar-link.d.ts.map