@vuesax-alpha/nightly
Version:
A Component Library for Vue 3
34 lines (33 loc) • 1.16 kB
TypeScript
/**
* Base nav item, displayed as text
*/
export interface NavItem {
text?: string;
ariaLabel?: string;
}
/**
* Base nav group, has nav items children
*/
export interface NavGroup<T> extends NavItem {
children: T[];
}
/**
* Props for `<AutoLink>`
*/
export interface NavLink extends NavItem {
path: string;
target?: string;
}
/**
* Navbar types
*/
export declare type NavbarItem = NavLink;
export declare type NavbarGroup = NavGroup<NavbarGroup | NavbarItem>;
export declare type IfNavbarItem<T, Y, N> = T extends NavbarItem ? Y : N;
export declare type IfNavbarGroup<T, Y, N> = T extends NavbarGroup ? Y : N;
export declare const isNavbarGroup: (nav: unknown) => nav is NavbarGroup;
export declare const isNavbarItem: (nav: unknown) => nav is NavLink;
export declare const isLinkExternal: (path?: string | undefined) => boolean;
export declare const isMailto: (path?: string | undefined) => path is `mailto:${string}`;
export declare const isTel: (path?: string | undefined) => path is `tel:${string}`;
export declare const isExternal: (path?: string | undefined) => path is `mailto:${string}` | `tel:${string}` | `http${string}`;