import { ButtonIconPositionType, ButtonTargetType } from "../../type/button"; import { ToneMinimalVariantType } from "../../type/tone"; import { LinkUnderlineType, LinkVariantType } from './meta/types'; /** * @slot - Add `text string` to this slot, the text of the link when `label` is not set; **avoid** to add `HTML elements` or `components` here. * @part link - The element that carries the link and the focus: an anchor with `href`, an inline button without it * @part icon - The icon of the link * @category actions */ export declare class MdsLink { private km; private link?; private t; host: HTMLMdsLinkElement; /** * The text of the link; without it, the text of the default slot */ readonly label?: string; /** * The URL of the link: a real anchor in its shadow root, so the browser gives it what it gives * every link (new tab on a modifier or middle click, the context menu, drag). A client-side * router takes the plain clicks over once registered with `NavigationService.setHandler()` * (from `@maggioli-design-system/magma/services`); without one, a click listener on the host can * still cancel the navigation with `preventDefault()`. Without `href` the link is an inline * button: it answers to click, Enter and Space with a `click` event and never submits a form. */ readonly href?: string; /** * Specifies the target of the URL, if self or blank: blank opens a new tab, without giving it * access to the page (`rel="noopener noreferrer"`), and tells the assistive technology so */ readonly target: ButtonTargetType; /** * Saves the file of `href` instead of opening it, as the `download` attribute of ``: present * with no value, or `true`, the file takes the name the server gives it; a string is the name * of the saved file. Browsers apply it to the URLs of the origin of the page, `blob:` and * `data:`: a link to another origin opens the file as without it. A download never goes to the * router registered with `NavigationService` */ readonly download?: boolean | string; /** * The icon displayed in the link */ readonly icon?: string; /** * Specifies the horizontal position of the icon, which never wraps to a line of its own */ readonly iconPosition?: ButtonIconPositionType; /** * Specifies the color of the link: `primary` paints it with the accent, `inherit` takes the * color of the text around it, for a link on a colored surface */ readonly variant?: LinkVariantType; /** * Specifies the tone of the underline: `strong` draws it in the color of the link, `weak` in * a tint of it, which takes the full color under the pointer */ readonly tone?: ToneMinimalVariantType; /** * Specifies the style of the underline, which is always visible */ readonly underline?: LinkUnderlineType; private isLink; private isDownload; private savingFile; private opensInNewTab; private opensElsewhere; /** * A click on the anchor is the browser's to follow, unless the router registered with * `NavigationService` takes it over: then the navigation is cancelled here, before the page * loads, and the router renders the route. The keyboard clicks the anchor too. * * A click that did not land on the anchor comes from a script: the host follows the link as * the anchor would, once every listener on the page had its say. The timeout is what lets a * listener added after this one, or delegated to the document by a framework, cancel it. * * A download is the browser's on every path: it saves the file, and a router has no view to * render for it. */ private handleClick; private follow; private route; componentDidRender(): void; render(): any; }