import { WatchSource } from 'vue'; export type PromiseType

> = P extends Promise ? T : never; export type FunctionReturningPromise = (...args: any[]) => Promise; // Unlike the class component setState, the updates are not allowed to be partial export declare type SetStateAction = S | ((prevState: S) => S); // this technically does accept a second argument, but it's already under a deprecation warning // and it's not even released so probably better to not define it. export declare type Dispatch = (value: A) => void; // Since action _can_ be undefined, dispatch may be called without any parameters. export declare type DispatchWithoutAction = () => void; // Unlike redux, the actions _can_ be anything export declare type Reducer = (prevState: S, action: A) => S; // If useReducer accepts a reducer without action, dispatch may be called without any parameters. export declare type ReducerWithoutAction = (prevState: S) => S; // types used to try and prevent the compiler from reducing S // to a supertype common with the second argument to useReducer() export declare type ReducerState> = R extends Reducer ? S : never; export declare type ReducerAction> = R extends Reducer ? A : never; // The identity check is done with the SameValue algorithm (Object.is), which is stricter than === export declare type ReducerStateWithoutAction> = R extends ReducerWithoutAction ? S : never; // NOTE: callbacks are _only_ allowed to return either void, or a destructor. // The destructor is itself only allowed to return void. export declare type EffectCallback = () => (void | (() => void | undefined)); declare type MultiWatchSources = (WatchSource | object)[]; // TODO (TypeScript 3.0): ReadonlyArray export type DependencyList = MultiWatchSources | WatchSource; export type EventHandler = { bivarianceHack(event: E): void }["bivarianceHack"]; export type ClipboardEventHandler = EventHandler; export type DragEventHandler = EventHandler;