/// import { MetaDescriptor, Params, useFetcher, type FetcherWithComponents } from '@remix-run/react'; import type { MetaType } from './typedjson'; export type TypedJsonFunction = (data: Data, init?: number | ResponseInit) => TypedJsonResponse; export declare type TypedJsonResponse = Response & { typedjson(): Promise; typeddefer(): Promise; }; export interface AppLoadContext { [key: string]: unknown; } type AppData = any; type DataFunction = (...args: any[]) => unknown; type DataOrFunction = AppData | DataFunction; export interface DataFunctionArgs { request: Request; context: AppLoadContext; params: Params; } export type UseDataFunctionReturn = T extends (...args: any[]) => infer Output ? Awaited extends TypedJsonResponse ? U : Awaited> : Awaited; export declare const typedjson: TypedJsonFunction; export declare const typeddefer: TypedJsonFunction; export type TypedAwaitProps = { resolve: Promise; errorElement?: React.ReactNode; children: (data: T) => React.ReactNode; }; export declare function TypedAwait(props: TypedAwaitProps): import("react/jsx-runtime").JSX.Element | null; export declare function useTypedLoaderData(): UseDataFunctionReturn; export declare function useTypedActionData(): UseDataFunctionReturn | null; export type TypedFetcherWithComponents = Omit, 'data'> & { data: UseDataFunctionReturn; }; type FetcherArgs = Parameters[0]; export declare function useTypedFetcher(opts?: FetcherArgs): TypedFetcherWithComponents; export declare function useTypedRouteLoaderData(id: string): UseDataFunctionReturn | undefined; export type RemixSerializedType = { $$obj: T | null; $$meta?: MetaType | null; } & (T | { $$meta?: MetaType; }); export declare function stringifyRemix(data: T): string | null | undefined; export declare function deserializeRemix(data: RemixSerializedType): T | null; export type RedirectFunction = (url: string, init?: number | ResponseInit) => TypedJsonResponse; /** * A redirect response. Sets the status code and the `Location` header. * Defaults to "302 Found". * * @see https://remix.run/api/remix#redirect */ export declare const redirect: RedirectFunction; export interface RouteData { [routeId: string]: AppData; } export interface LoaderFunction { (args: DataFunctionArgs): Promise | Response | Promise | AppData; } /** @deprecated */ export interface TypedMetaFunction = {}> { (args: { data: Loader extends LoaderFunction ? UseDataFunctionReturn : AppData; parentsData: { [k in keyof ParentsLoaders]: UseDataFunctionReturn; } & RouteData; params: Params; location: Location; }): MetaDescriptor; } export {};