unrefElement.d.ts 792 B

12345678910111213
  1. import type { ComponentPublicInstance } from 'vue';
  2. import type { MaybeComputedRef, MaybeRef } from './types';
  3. export type VueInstance = ComponentPublicInstance;
  4. export type MaybeElementRef<T extends MaybeElement = MaybeElement> = MaybeRef<T>;
  5. export type MaybeComputedElementRef<T extends MaybeElement = MaybeElement> = MaybeComputedRef<T>;
  6. export type MaybeElement = HTMLElement | SVGElement | VueInstance | undefined | null;
  7. export 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>;