import type { Url } from "../../types/api-response-fields"; import type { ComponentPropsWithoutRef, CSSProperties, MouseEvent, ReactNode, Ref } from "react"; import * as React from "react"; /** * Renders a router component from internal/external Griddo link. * You may want to use `` instead of an `` tag for internal Griddo pages. * @see [Documentation](https://www.notion.so/griddoio/GriddoLink-bc4f7cddd1484648b024d4bebe4b74c3) * * @example * */ declare function GriddoLink({ activeClassName, activeStyle, style, children, getProps, partiallyActive, state, url, title, className, ...props }: GriddoLinkProps): React.JSX.Element; export interface HLocation { pathname: string; search: string; state: S; hash: string; key?: string | undefined; } export type WindowLocation = Window["location"] & HLocation; export interface LinkGetProps { /** `true` if the location.pathname is exactly the same as the anchor’s href. */ isCurrent: boolean; /** `true` if the location.pathname is exactly the same as the anchor’s href. */ isPartiallyCurrent: boolean; /** The fully resolved href of the link. */ href: string; /** The app’s location. */ location: WindowLocation; } export interface GriddoLinkProps extends Omit, "href"> { /** Griddo Url with the link data */ url?: Url; /** Calls up to you to get props for the underlying anchor element. Useful for styling the anchor as active. */ getProps?: ((props: LinkGetProps) => Record) | undefined; /** A class name that will be applied the current item is active. */ activeClassName?: string; /** A style object that will be applied when the current item is active. */ activeStyle?: CSSProperties; /** Whether partial URLs are considered active (e.g. /blog#hello-world matches if partiallyActive is true). */ partiallyActive?: boolean; /** If `true`, the latest entry on the history stack will be replaced with a new one. Use this when you don’t want the previous page to show up when the user clicks the back button. */ replace?: boolean; /** Used to pass state data to the linked page. * The linked page will have a `location` prop containing a nested `state` object structure containing the passed data. */ state?: Record; /** @deprecated If using React >= 16.4, use ref instead. */ innerRef?: Ref | undefined; /** If using React >=16.4, Link will forward its ref to you. */ ref?: Ref | undefined; /** onCLick event */ onClick?: (event: MouseEvent) => void; children?: ReactNode; } export { GriddoLink };