import { RouteRecord } from './matcher/types'
import { assign } from './utils'
-export interface RouterLinkProps {
+export interface RouterLinkOptions {
to: RouteLocationRaw
// TODO: refactor using extra options allowed in router.push. Needs RFC
replace?: boolean
}
-type UseLinkOptions = VueUseOptions<RouterLinkProps>
+export interface RouterLinkProps extends RouterLinkOptions {
+ custom?: boolean
+}
+
+type UseLinkOptions = VueUseOptions<RouterLinkOptions>
// TODO: we could allow currentRoute as a prop to expose `isActive` and
// `isExactActive` behavior should go through an RFC
/**
* Generates the corresponding href to be used in an anchor tag.
*
- * @param location
+ * @param location - history location that should create an href
*/
createHref(location: HistoryLocationNormalized): string
// RouterLink
expectError(<RouterLink />)
+expectError(<RouterLink to="/" custom="text" />)
+expectError(<RouterLink to="/" replace="text" />)
expectType<JSX.Element>(<RouterLink to="/foo" replace />)
expectType<JSX.Element>(<RouterLink to="/foo" />)
expectType<JSX.Element>(<RouterLink to={{ path: '/foo' }} />)
+expectType<JSX.Element>(<RouterLink to={{ path: '/foo' }} custom />)
// RouterView
expectType<JSX.Element>(<RouterView />)