智慧水务管理系统 - 精河县供水工程综合管理平台

1234567891011121314151617181920212223242526272829303132333435
  1. import * as _$vue from "vue";
  2. import { MaybeRef, ShallowRef } from "vue";
  3. //#region ../../packages/hooks/use-focus-controller/index.d.ts
  4. interface UseFocusControllerOptions {
  5. disabled?: MaybeRef<boolean>;
  6. /**
  7. * return true to cancel focus
  8. * @param event FocusEvent
  9. */
  10. beforeFocus?: (event: FocusEvent) => boolean | undefined;
  11. afterFocus?: () => void;
  12. /**
  13. * return true to cancel blur
  14. * @param event FocusEvent
  15. */
  16. beforeBlur?: (event: FocusEvent) => boolean | undefined;
  17. afterBlur?: () => void;
  18. }
  19. declare function useFocusController<T extends {
  20. focus: () => void;
  21. }>(target: ShallowRef<T | undefined>, {
  22. disabled,
  23. beforeFocus,
  24. afterFocus,
  25. beforeBlur,
  26. afterBlur
  27. }?: UseFocusControllerOptions): {
  28. isFocused: _$vue.Ref<boolean, boolean>; /** Avoid using wrapperRef and handleFocus/handleBlur together */
  29. wrapperRef: ShallowRef<HTMLElement | undefined, HTMLElement | undefined>;
  30. handleFocus: (event: FocusEvent) => void;
  31. handleBlur: (event: FocusEvent) => void;
  32. };
  33. //#endregion
  34. export { useFocusController };