import { AsLinkAttrsConfig, LinkField, LinkResolverFunction, PrismicDocument } from "@prismicio/client"; import { ComponentProps, ComponentType, ForwardedRef, HTMLAttributeAnchorTarget, ReactNode } from "react"; //#region src/PrismicLink.d.ts /** The default component rendered for internal and external links. */ declare const defaultComponent = "a"; /** Props provided to a component when rendered with ``. */ interface LinkProps { /** The URL to link. */ href: string; /** * The `target` attribute for anchor elements. If the Prismic field is configured to open in a new * window, this prop defaults to `_blank`. */ target?: HTMLAttributeAnchorTarget; /** * The `rel` attribute for anchor elements. If the `target` prop is set to `"_blank"`, this prop * defaults to `"noopener noreferrer"`. */ rel?: string; /** Children for the component. */ children?: ReactNode; } type PrismicLinkProps, ExternalComponentProps = ComponentProps> = Omit & { /** * The `rel` attribute for the link. By default, `"noreferrer"` is provided if the link's URL is * external. This prop can be provided a function to use the link's metadata to determine the * `rel` value. */ rel?: string | AsLinkAttrsConfig["rel"]; /** * The link resolver used to resolve links. * * @remarks * If your app uses route resolvers when querying for your Prismic repository's content, a link * resolver does not need to be provided. * @see Learn about link resolvers and route resolvers {@link https://prismic.io/docs/routes} */ linkResolver?: LinkResolverFunction; /** * The component rendered for internal URLs. Defaults to ``. * * If your app uses a client-side router that requires a special Link component, provide the Link * component to this prop. */ internalComponent?: ComponentType; /** The component rendered for external URLs. Defaults to ``. */ externalComponent?: ComponentType; /** * The children to render for the link. If no children are provided, the link's `text` property * will be used. */ children?: ReactNode; } & ({ document: PrismicDocument | null | undefined; href?: never; field?: never; } | { field: LinkField | null | undefined; href?: never; document?: never; } | { href: LinkProps["href"]; field?: LinkField | null | undefined; document?: never; }); /** * Renders a link from a Prismic link field or page. * * @example * ;```tsx * Click here; * ``` * * @see Learn how to display links and use variants for styling: {@link https://prismic.io/docs/fields/link} */ declare const PrismicLink: , ExternalComponentProps = ComponentProps>(props: PrismicLinkProps & { ref?: ForwardedRef; }) => ReactNode; //#endregion export { LinkProps, PrismicLink, PrismicLinkProps }; //# sourceMappingURL=PrismicLink.d.ts.map