unrefElement.d.ts 832 B

12345678910111213
  1. import type { ComponentPublicInstance } from 'vue';
  2. import type { MaybeComputedRef, MaybeRef } from './types';
  3. export declare type VueInstance = ComponentPublicInstance;
  4. export declare type MaybeElementRef<T extends MaybeElement = MaybeElement> = MaybeRef<T>;
  5. export declare type MaybeComputedElementRef<T extends MaybeElement = MaybeElement> = MaybeComputedRef<T>;
  6. export declare type MaybeElement = HTMLElement | SVGElement | VueInstance | undefined | null;
  7. export declare type UnRefElementReturn<T extends MaybeElement = MaybeElement> = T extends VueInstance ? Exclude<MaybeElement, VueInstance> : T | undefined;
  8. /**
  9. * Get the dom element of a ref of element or Vue component instance
  10. *
  11. * @param elRef
  12. */
  13. export declare function unrefElement<T extends MaybeElement>(elRef: MaybeComputedElementRef<T>): UnRefElementReturn<T>;