Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/@remix-run/router/utils.ts
rd565449 r0c6b92a 63 63 | RedirectResult 64 64 | ErrorResult; 65 66 /**67 * Result from a loader or action called via dataStrategy68 */69 export interface HandlerResult {70 type: "data" | "error";71 result: unknown; // data, Error, Response, DeferredData, DataWithResponseInit72 }73 65 74 66 type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete"; … … 242 234 handlerOverride?: ( 243 235 handler: (ctx?: unknown) => DataFunctionReturnValue 244 ) => Promise<HandlerResult>245 ) => Promise< HandlerResult>;236 ) => DataFunctionReturnValue 237 ) => Promise<DataStrategyResult>; 246 238 } 247 239 … … 249 241 extends DataFunctionArgs<Context> { 250 242 matches: DataStrategyMatch[]; 243 fetcherKey: string | null; 244 } 245 246 /** 247 * Result from a loader or action called via dataStrategy 248 */ 249 export interface DataStrategyResult { 250 type: "data" | "error"; 251 result: unknown; // data, Error, Response, DeferredData, DataWithResponseInit 251 252 } 252 253 253 254 export interface DataStrategyFunction { 254 (args: DataStrategyFunctionArgs): Promise<HandlerResult[]>; 255 } 256 257 export interface AgnosticPatchRoutesOnMissFunction< 255 (args: DataStrategyFunctionArgs): Promise<Record<string, DataStrategyResult>>; 256 } 257 258 export type AgnosticPatchRoutesOnNavigationFunctionArgs< 259 O extends AgnosticRouteObject = AgnosticRouteObject, 258 260 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 267 export type AgnosticPatchRoutesOnNavigationFunction< 268 O extends AgnosticRouteObject = AgnosticRouteObject, 269 M extends AgnosticRouteMatch = AgnosticRouteMatch 270 > = ( 271 opts: AgnosticPatchRoutesOnNavigationFunctionArgs<O, M> 272 ) => void | Promise<void>; 266 273 267 274 /** … … 504 511 * Matches the given routes to a location and returns the match data. 505 512 * 506 * @see https://reactrouter.com/ utils/match-routes513 * @see https://reactrouter.com/v6/utils/match-routes 507 514 */ 508 515 export function matchRoutes< … … 857 864 * Returns a path with params interpolated. 858 865 * 859 * @see https://reactrouter.com/ utils/generate-path866 * @see https://reactrouter.com/v6/utils/generate-path 860 867 */ 861 868 export function generatePath<Path extends string>( … … 963 970 * the match. 964 971 * 965 * @see https://reactrouter.com/ utils/match-path972 * @see https://reactrouter.com/v6/utils/match-path 966 973 */ 967 974 export function matchPath< … … 1123 1130 * Returns a resolved path object relative to the given pathname. 1124 1131 * 1125 * @see https://reactrouter.com/ utils/resolve-path1132 * @see https://reactrouter.com/v6/utils/resolve-path 1126 1133 */ 1127 1134 export function resolvePath(to: To, fromPathname = "/"): Path { … … 1360 1367 * This is a shortcut for creating `application/json` responses. Converts `data` 1361 1368 * 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. 1362 1372 */ 1363 1373 export const json: JsonFunction = (data, init = {}) => { … … 1598 1608 ) => DeferredData; 1599 1609 1610 /** 1611 * @deprecated The `defer` method is deprecated in favor of returning raw 1612 * objects. This method will be removed in v7. 1613 */ 1600 1614 export const defer: DeferFunction = (data, init = {}) => { 1601 1615 let responseInit = typeof init === "number" ? { status: init } : init;
Note:
See TracChangeset
for help on using the changeset viewer.