Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/@remix-run/router/dist/utils.d.ts
rd565449 r0c6b92a 50 50 */ 51 51 export type DataResult = SuccessResult | DeferredResult | RedirectResult | ErrorResult; 52 /**53 * Result from a loader or action called via dataStrategy54 */55 export interface HandlerResult {56 type: "data" | "error";57 result: unknown;58 }59 52 type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete"; 60 53 type UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>; … … 192 185 export interface DataStrategyMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> { 193 186 shouldLoad: boolean; 194 resolve: (handlerOverride?: (handler: (ctx?: unknown) => DataFunctionReturnValue) => Promise<HandlerResult>) => Promise<HandlerResult>;187 resolve: (handlerOverride?: (handler: (ctx?: unknown) => DataFunctionReturnValue) => DataFunctionReturnValue) => Promise<DataStrategyResult>; 195 188 } 196 189 export interface DataStrategyFunctionArgs<Context = any> extends DataFunctionArgs<Context> { 197 190 matches: DataStrategyMatch[]; 191 fetcherKey: string | null; 192 } 193 /** 194 * Result from a loader or action called via dataStrategy 195 */ 196 export interface DataStrategyResult { 197 type: "data" | "error"; 198 result: unknown; 198 199 } 199 200 export 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 } 203 export 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 }; 208 export type AgnosticPatchRoutesOnNavigationFunction<O extends AgnosticRouteObject = AgnosticRouteObject, M extends AgnosticRouteMatch = AgnosticRouteMatch> = (opts: AgnosticPatchRoutesOnNavigationFunctionArgs<O, M>) => void | Promise<void>; 209 209 /** 210 210 * Function provided by the framework-aware layers to set any framework-specific … … 325 325 * Matches the given routes to a location and returns the match data. 326 326 * 327 * @see https://reactrouter.com/ utils/match-routes327 * @see https://reactrouter.com/v6/utils/match-routes 328 328 */ 329 329 export declare function matchRoutes<RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject>(routes: RouteObjectType[], locationArg: Partial<Location> | string, basename?: string): AgnosticRouteMatch<string, RouteObjectType>[] | null; … … 340 340 * Returns a path with params interpolated. 341 341 * 342 * @see https://reactrouter.com/ utils/generate-path342 * @see https://reactrouter.com/v6/utils/generate-path 343 343 */ 344 344 export declare function generatePath<Path extends string>(originalPath: Path, params?: { … … 390 390 * the match. 391 391 * 392 * @see https://reactrouter.com/ utils/match-path392 * @see https://reactrouter.com/v6/utils/match-path 393 393 */ 394 394 export declare function matchPath<ParamKey extends ParamParseKey<Path>, Path extends string>(pattern: PathPattern<Path> | Path, pathname: string): PathMatch<ParamKey> | null; … … 401 401 * Returns a resolved path object relative to the given pathname. 402 402 * 403 * @see https://reactrouter.com/ utils/resolve-path403 * @see https://reactrouter.com/v6/utils/resolve-path 404 404 */ 405 405 export declare function resolvePath(to: To, fromPathname?: string): Path; … … 457 457 * This is a shortcut for creating `application/json` responses. Converts `data` 458 458 * 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. 459 462 */ 460 463 export declare const json: JsonFunction; … … 498 501 } 499 502 export 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 */ 500 507 export declare const defer: DeferFunction; 501 508 export type RedirectFunction = (url: string, init?: number | ResponseInit) => Response;
Note:
See TracChangeset
for help on using the changeset viewer.