UNPKG

@daysnap/vue-use

Version:
9 lines (8 loc) 379 B
import { type Ref } from 'vue'; export type UseSetStateAction<S> = S | ((prevState: S) => S); export type UseSetState<T> = (initialState: T) => void; export declare function useState<S = undefined>(): [ Ref<S | undefined>, UseSetState<UseSetStateAction<S | undefined>> ]; export declare function useState<S>(initialState: S): [Ref<S>, UseSetState<UseSetStateAction<S>>];