import Component from '@glimmer/component'; import type RouterService from '@ember/routing/router-service'; interface DocfyLinkArgs { to: string; anchor?: string; activeClass?: string; } interface DocfyLinkSignature { Args: DocfyLinkArgs; Element: HTMLAnchorElement; Blocks: { default: []; }; } /** * A link to a Docfy page. * * Docfy addresses pages by URL, and `@to` is already the router's path, so * neither the href nor the active state needs the target route resolved. * * That matters under Embroider's `splitAtRoutes`: `RouterService#recognize()` * resolves the matched route handlers, and resolving a route inside a split * bundle makes `@embroider/router` fetch that bundle. Calling it from a getter * meant that merely rendering a link downloaded the page it pointed at, so a * page linking to every section pulled the whole documentation site up front. * Recognition now happens in `navigate`, where the bundle is about to be needed * anyway. */ export default class DocfyLink extends Component { router: RouterService; /** * `@to` as the router would produce it. Docfy gives index pages a trailing * slash (`/docs/getting-started/`) where `urlFor` did not, so it is dropped * here to keep the rendered href unchanged. */ get path(): string; get href(): string; get isActive(): boolean; navigate(event: MouseEvent): void; } export {}; //# sourceMappingURL=docfy-link.d.ts.map