import { type FetcherWithComponents, type Navigation } from "react-router"; /** * The list of types a fetcher can have */ export type FetcherType = "init" | "done" | "actionSubmission" | "actionReload" | "actionRedirect" | "loaderSubmission" | "normalLoad"; /** * Derive the deprecated `fetcher.type` from the current state of a fetcher. * @param fetcher The `fetcher` object returned form `useFetcher` * @example * let fetcher = useFetcher(); * let fetcherType = useFetcherType(fetcher); * useEffect(() => { * if (fetcherType === "done") // do something once fetcher is done * }, [fetcherType]); */ export declare function useFetcherType(fetcher: FetcherWithComponents): FetcherType; /** * Derive the deprecated `fetcher.type` from the current state of a fetcher * and navigation. * @param fetcher The `fetcher` object returned form `useFetcher` * @param navigation The `Navigation` object returned from `useNavigation` * @example * let fetcher = useFetcher(); * let navigation = useNavigation(); * let fetcherType = getFetcherType(fetcher, navigation); * useEffect(() => { * if (fetcherType === "done") // do something once fetcher is done * }, [fetcherType]) */ export declare function getFetcherType(fetcher: Pick, "state" | "data" | "formMethod">, navigation: Pick): FetcherType;