UNPKG

591 BTypeScriptView Raw
1import type { Ref, InjectionKey } from 'vue';
2export interface AnchorContext {
3 registerLink: (link: string) => void;
4 unregisterLink: (link: string) => void;
5 activeLink: Ref<string>;
6 scrollTo: (link: string) => void;
7 handleClick: (e: Event, info: {
8 title: any;
9 href: string;
10 }) => void;
11}
12export declare const AnchorContextKey: InjectionKey<AnchorContext>;
13declare const useProvideAnchor: (state: AnchorContext) => void;
14declare const useInjectAnchor: () => AnchorContext;
15export { useInjectAnchor, useProvideAnchor };
16export default useProvideAnchor;