Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/@remix-run/router/dist/utils.d.ts

    rd565449 r0c6b92a  
    5050 */
    5151export type DataResult = SuccessResult | DeferredResult | RedirectResult | ErrorResult;
    52 /**
    53  * Result from a loader or action called via dataStrategy
    54  */
    55 export interface HandlerResult {
    56     type: "data" | "error";
    57     result: unknown;
    58 }
    5952type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete";
    6053type UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>;
     
    192185export interface DataStrategyMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {
    193186    shouldLoad: boolean;
    194     resolve: (handlerOverride?: (handler: (ctx?: unknown) => DataFunctionReturnValue) => Promise<HandlerResult>) => Promise<HandlerResult>;
     187    resolve: (handlerOverride?: (handler: (ctx?: unknown) => DataFunctionReturnValue) => DataFunctionReturnValue) => Promise<DataStrategyResult>;
    195188}
    196189export interface DataStrategyFunctionArgs<Context = any> extends DataFunctionArgs<Context> {
    197190    matches: DataStrategyMatch[];
     191    fetcherKey: string | null;
     192}
     193/**
     194 * Result from a loader or action called via dataStrategy
     195 */
     196export interface DataStrategyResult {
     197    type: "data" | "error";
     198    result: unknown;
    198199}
    199200export interface DataStrategyFunction {
    200     (args: DataStrategyFunctionArgs): Promise<HandlerResult[]>;
    201 }
    202 export interface AgnosticPatchRoutesOnMissFunction<M extends AgnosticRouteMatch = AgnosticRouteMatch> {
    203     (opts: {
    204         path: string;
    205         matches: M[];
    206         patch: (routeId: string | null, children: AgnosticRouteObject[]) => void;
    207     }): void | Promise<void>;
    208 }
     201    (args: DataStrategyFunctionArgs): Promise<Record<string, DataStrategyResult>>;
     202}
     203export type AgnosticPatchRoutesOnNavigationFunctionArgs<O extends AgnosticRouteObject = AgnosticRouteObject, M extends AgnosticRouteMatch = AgnosticRouteMatch> = {
     204    path: string;
     205    matches: M[];
     206    patch: (routeId: string | null, children: O[]) => void;
     207};
     208export type AgnosticPatchRoutesOnNavigationFunction<O extends AgnosticRouteObject = AgnosticRouteObject, M extends AgnosticRouteMatch = AgnosticRouteMatch> = (opts: AgnosticPatchRoutesOnNavigationFunctionArgs<O, M>) => void | Promise<void>;
    209209/**
    210210 * Function provided by the framework-aware layers to set any framework-specific
     
    325325 * Matches the given routes to a location and returns the match data.
    326326 *
    327  * @see https://reactrouter.com/utils/match-routes
     327 * @see https://reactrouter.com/v6/utils/match-routes
    328328 */
    329329export declare function matchRoutes<RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject>(routes: RouteObjectType[], locationArg: Partial<Location> | string, basename?: string): AgnosticRouteMatch<string, RouteObjectType>[] | null;
     
    340340 * Returns a path with params interpolated.
    341341 *
    342  * @see https://reactrouter.com/utils/generate-path
     342 * @see https://reactrouter.com/v6/utils/generate-path
    343343 */
    344344export declare function generatePath<Path extends string>(originalPath: Path, params?: {
     
    390390 * the match.
    391391 *
    392  * @see https://reactrouter.com/utils/match-path
     392 * @see https://reactrouter.com/v6/utils/match-path
    393393 */
    394394export declare function matchPath<ParamKey extends ParamParseKey<Path>, Path extends string>(pattern: PathPattern<Path> | Path, pathname: string): PathMatch<ParamKey> | null;
     
    401401 * Returns a resolved path object relative to the given pathname.
    402402 *
    403  * @see https://reactrouter.com/utils/resolve-path
     403 * @see https://reactrouter.com/v6/utils/resolve-path
    404404 */
    405405export declare function resolvePath(to: To, fromPathname?: string): Path;
     
    457457 * This is a shortcut for creating `application/json` responses. Converts `data`
    458458 * to JSON and sets the `Content-Type` header.
     459 *
     460 * @deprecated The `json` method is deprecated in favor of returning raw objects.
     461 * This method will be removed in v7.
    459462 */
    460463export declare const json: JsonFunction;
     
    498501}
    499502export type DeferFunction = (data: Record<string, unknown>, init?: number | ResponseInit) => DeferredData;
     503/**
     504 * @deprecated The `defer` method is deprecated in favor of returning raw
     505 * objects. This method will be removed in v7.
     506 */
    500507export declare const defer: DeferFunction;
    501508export type RedirectFunction = (url: string, init?: number | ResponseInit) => Response;
Note: See TracChangeset for help on using the changeset viewer.