@omnia/fx
Version:
Provide Omnia Fx typings and tooling for clientside Omnia development.
39 lines (38 loc) • 1.18 kB
TypeScript
import Vue, { Ref, ComputedRef } from "vue";
/**
* Func
*
* ```ts
* type Func = () => void;
* ```
*/
export type Func = () => void;
/**
* Maybe it's a ref, or a plain value
*
* ```ts
* type MaybeRef<T> = T | Ref<T>
* ```
*/
export type MaybeRef<T> = T | Ref<T>;
/**
* Maybe it's a ref, or a plain value, or a getter function
*
* ```ts
* type MaybeComputedRef<T> = (() => T) | T | Ref<T> | ComputedRef<T>
* ```
*/
export type MaybeComputedRef<T> = MaybeReadonlyRef<T> | MaybeRef<T>;
/**
* Maybe it's a computed ref, or a getter function
*
* ```ts
* type MaybeReadonlyRef<T> = (() => T) | ComputedRef<T>
* ```
*/
export type MaybeReadonlyRef<T> = (() => T) | ComputedRef<T>;
export declare type VueInstance = Vue;
export declare type MaybeElementRef<T extends MaybeElement = MaybeElement> = MaybeRef<T>;
export declare type MaybeComputedElementRef<T extends MaybeElement = MaybeElement> = MaybeComputedRef<T>;
export declare type MaybeElement = HTMLElement | SVGElement | VueInstance | undefined | null;
export declare type UnRefElementReturn<T extends MaybeElement = MaybeElement> = T extends VueInstance ? Exclude<MaybeElement, VueInstance> : T | undefined;