import {computed, ComputedRef, Ref} from 'vue'; import {SetStateAction, useSetState} from "./index"; import {ToComputedRef} from "./useComputedState"; import {IHookStateInitAction} from "./misc/hookState"; export default function useComputedSetState(value: T): [ToComputedRef, (prevState: SetStateAction) => void] export default function useComputedSetState(value: IHookStateInitAction): [ComputedRef, (prevState: SetStateAction) => void] export default function useComputedSetState(value: T): [ComputedRef, (prevState: SetStateAction) => void] export default function useComputedSetState(): [ComputedRef, (prevState: SetStateAction) => void] export default function useComputedSetState(initialState?: unknown) { const [state, setState] = useSetState(initialState); return [computed(() => { return state.value; }), setState]; };