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/utils.ts

    rd565449 r0c6b92a  
    6363  | RedirectResult
    6464  | ErrorResult;
    65 
    66 /**
    67  * Result from a loader or action called via dataStrategy
    68  */
    69 export interface HandlerResult {
    70   type: "data" | "error";
    71   result: unknown; // data, Error, Response, DeferredData, DataWithResponseInit
    72 }
    7365
    7466type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete";
     
    242234    handlerOverride?: (
    243235      handler: (ctx?: unknown) => DataFunctionReturnValue
    244     ) => Promise<HandlerResult>
    245   ) => Promise<HandlerResult>;
     236    ) => DataFunctionReturnValue
     237  ) => Promise<DataStrategyResult>;
    246238}
    247239
     
    249241  extends DataFunctionArgs<Context> {
    250242  matches: DataStrategyMatch[];
     243  fetcherKey: string | null;
     244}
     245
     246/**
     247 * Result from a loader or action called via dataStrategy
     248 */
     249export interface DataStrategyResult {
     250  type: "data" | "error";
     251  result: unknown; // data, Error, Response, DeferredData, DataWithResponseInit
    251252}
    252253
    253254export interface DataStrategyFunction {
    254   (args: DataStrategyFunctionArgs): Promise<HandlerResult[]>;
    255 }
    256 
    257 export interface AgnosticPatchRoutesOnMissFunction<
     255  (args: DataStrategyFunctionArgs): Promise<Record<string, DataStrategyResult>>;
     256}
     257
     258export type AgnosticPatchRoutesOnNavigationFunctionArgs<
     259  O extends AgnosticRouteObject = AgnosticRouteObject,
    258260  M extends AgnosticRouteMatch = AgnosticRouteMatch
    259 > {
    260   (opts: {
    261     path: string;
    262     matches: M[];
    263     patch: (routeId: string | null, children: AgnosticRouteObject[]) => void;
    264   }): void | Promise<void>;
    265 }
     261> = {
     262  path: string;
     263  matches: M[];
     264  patch: (routeId: string | null, children: O[]) => void;
     265};
     266
     267export type AgnosticPatchRoutesOnNavigationFunction<
     268  O extends AgnosticRouteObject = AgnosticRouteObject,
     269  M extends AgnosticRouteMatch = AgnosticRouteMatch
     270> = (
     271  opts: AgnosticPatchRoutesOnNavigationFunctionArgs<O, M>
     272) => void | Promise<void>;
    266273
    267274/**
     
    504511 * Matches the given routes to a location and returns the match data.
    505512 *
    506  * @see https://reactrouter.com/utils/match-routes
     513 * @see https://reactrouter.com/v6/utils/match-routes
    507514 */
    508515export function matchRoutes<
     
    857864 * Returns a path with params interpolated.
    858865 *
    859  * @see https://reactrouter.com/utils/generate-path
     866 * @see https://reactrouter.com/v6/utils/generate-path
    860867 */
    861868export function generatePath<Path extends string>(
     
    963970 * the match.
    964971 *
    965  * @see https://reactrouter.com/utils/match-path
     972 * @see https://reactrouter.com/v6/utils/match-path
    966973 */
    967974export function matchPath<
     
    11231130 * Returns a resolved path object relative to the given pathname.
    11241131 *
    1125  * @see https://reactrouter.com/utils/resolve-path
     1132 * @see https://reactrouter.com/v6/utils/resolve-path
    11261133 */
    11271134export function resolvePath(to: To, fromPathname = "/"): Path {
     
    13601367 * This is a shortcut for creating `application/json` responses. Converts `data`
    13611368 * to JSON and sets the `Content-Type` header.
     1369 *
     1370 * @deprecated The `json` method is deprecated in favor of returning raw objects.
     1371 * This method will be removed in v7.
    13621372 */
    13631373export const json: JsonFunction = (data, init = {}) => {
     
    15981608) => DeferredData;
    15991609
     1610/**
     1611 * @deprecated The `defer` method is deprecated in favor of returning raw
     1612 * objects. This method will be removed in v7.
     1613 */
    16001614export const defer: DeferFunction = (data, init = {}) => {
    16011615  let responseInit = typeof init === "number" ? { status: init } : init;
Note: See TracChangeset for help on using the changeset viewer.