@omnia/fx
Version:
Provide Omnia Fx typings and tooling for clientside Omnia development.
43 lines (42 loc) • 984 B
TypeScript
import { ComputedRef, WatchOptions } from "vue";
import { MaybeComputedRef } from "./Types";
export interface UseClonedOptions<T = any> extends WatchOptions {
/**
* Manually sync the ref
*
* @default false
*/
manual?: boolean;
}
export interface UseClonedReturn<T> {
/**
* Cloned ref
*/
cloned: ComputedRef<T>;
/**
* Sync cloned data with source manually
*/
sync: () => void;
}
/**
* Clones an object and returns a copy of it.
*
* @export
* @template T
* @param {T} source
* @return {*} {T}
*/
export declare function useClone<T>(source: T): T;
/**
* Clones an reactive object and returns a copy of it.
*
* @export
* @template T
* @param {MaybeComputedRef<T>} source
* @param {UseClonedOptions} [options={}]
* @return {*}
*/
export declare function useCloneRef<T>(source: MaybeComputedRef<T>, options?: UseClonedOptions): {
cloned: import("vue").Ref<import("vue").UnwrapRef<T>>;
sync: () => void;
};