import { ReturnUseState, ReturnUseSuspense } from "../hooks.js"; export type Effect = (state: any, unmounted?: boolean) => any; export type Hook = { value?: any; }; /** * Map of states associated with an increasing position */ export type Hooks = { [i: number]: Hook; }; export type SCOPE = { i: number; id: number | string; hooks: Hooks; host: any; update: any; }; export type RenderHook = any>( callback: Callback ) => ReturnType; /** * allows to clean the effects step by step, * first execution of the callback cleans the useInsertionEffect, * second execution of return of the previous callback cleans the useLayoutEffect and * the last execution of the previous return cleans the useEffect */ export type Dispatch = (type: string | symbol | number, payload?: any) => void; export type CreateHooks = ( update?: () => any, host?: any, id?: number | string ) => { render: RenderHook; dispatch: Dispatch; isSuspense: () => boolean; }; export type CollectorCallback = (() => {}) | null | true; export type CollectorArgs = any[]; export type UseAnyEffect = void | (() => any)>( effect: Effect, args?: Arg[] ) => void; export type ReturnSetStateUseSuspense = ReturnUseState; export type ReturnValidityState = ValidityStateFlags & { report?: boolean; message?: string; };