From 2030d24f39afbda2d0065116532ae91501875376 Mon Sep 17 00:00:00 2001 From: Mark Dalgleish Date: Fri, 11 Aug 2023 14:25:22 +1000 Subject: [PATCH] rename type for consistency --- packages/router/__tests__/router-test.ts | 12 ++++++------ packages/router/utils.ts | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/router/__tests__/router-test.ts b/packages/router/__tests__/router-test.ts index 06dfb682ea..7feffb7d99 100644 --- a/packages/router/__tests__/router-test.ts +++ b/packages/router/__tests__/router-test.ts @@ -34,7 +34,7 @@ import type { AgnosticNonIndexRouteObject, AgnosticRouteObject, DeferredData, - ShouldRevalidateArgs, + ShouldRevalidateFunctionArgs, TrackedPromise, } from "../utils"; import { @@ -1861,7 +1861,7 @@ describe("a router", () => { router.navigate("/params/aValue/bValue"); await tick(); expect(rootLoader.mock.calls.length).toBe(1); - let expectedArg: ShouldRevalidateArgs = { + let expectedArg: ShouldRevalidateFunctionArgs = { currentParams: {}, currentUrl: expect.URL("http://localhost/child"), nextParams: { @@ -1926,7 +1926,7 @@ describe("a router", () => { expect(shouldRevalidate.mock.calls.length).toBe(1); // @ts-expect-error let arg = shouldRevalidate.mock.calls[0][0]; - let expectedArg: ShouldRevalidateArgs = { + let expectedArg: ShouldRevalidateFunctionArgs = { currentParams: {}, currentUrl: expect.URL("http://localhost/child"), nextParams: {}, @@ -1980,7 +1980,7 @@ describe("a router", () => { expect(shouldRevalidate.mock.calls.length).toBe(1); // @ts-expect-error let arg = shouldRevalidate.mock.calls[0][0]; - let expectedArg: ShouldRevalidateArgs = { + let expectedArg: ShouldRevalidateFunctionArgs = { currentParams: {}, currentUrl: expect.URL("http://localhost/child"), nextParams: {}, @@ -2026,7 +2026,7 @@ describe("a router", () => { expect(shouldRevalidate.mock.calls.length).toBe(1); // @ts-expect-error let arg = shouldRevalidate.mock.calls[0][0]; - let expectedArg: Partial = { + let expectedArg: Partial = { formMethod: "post", formAction: "/", formEncType: "application/json", @@ -2068,7 +2068,7 @@ describe("a router", () => { expect(shouldRevalidate.mock.calls.length).toBe(1); // @ts-expect-error let arg = shouldRevalidate.mock.calls[0][0]; - let expectedArg: Partial = { + let expectedArg: Partial = { formMethod: "post", formAction: "/", formEncType: "text/plain", diff --git a/packages/router/utils.ts b/packages/router/utils.ts index 78f96f618b..0a1b771771 100644 --- a/packages/router/utils.ts +++ b/packages/router/utils.ts @@ -177,7 +177,7 @@ export interface ActionFunction { /** * Arguments passed to shouldRevalidate function */ -export interface ShouldRevalidateArgs { +export interface ShouldRevalidateFunctionArgs { currentUrl: URL; currentParams: AgnosticDataRouteMatch["params"]; nextUrl: URL; @@ -200,7 +200,7 @@ export interface ShouldRevalidateArgs { * have to re-run based on the data models that were potentially mutated. */ export interface ShouldRevalidateFunction { - (args: ShouldRevalidateArgs): boolean; + (args: ShouldRevalidateFunctionArgs): boolean; } /**