context.d.ts 591 B

12345678910111213141516
  1. import type { Ref, InjectionKey } from 'vue';
  2. export 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. }
  12. export declare const AnchorContextKey: InjectionKey<AnchorContext>;
  13. declare const useProvideAnchor: (state: AnchorContext) => void;
  14. declare const useInjectAnchor: () => AnchorContext;
  15. export { useInjectAnchor, useProvideAnchor };
  16. export default useProvideAnchor;