diff --git a/packages/router-core/src/route.ts b/packages/router-core/src/route.ts index 73f213b424..4524e3b541 100644 --- a/packages/router-core/src/route.ts +++ b/packages/router-core/src/route.ts @@ -987,7 +987,7 @@ export interface FilebaseRouteOptionsInterface< ( opt: RemountDepsOptions< TId, - FullSearchSchemaOption, + ResolveFullSearchSchema, Expand>, TLoaderDeps >, diff --git a/packages/router-core/tests/remountDeps.test-d.ts b/packages/router-core/tests/remountDeps.test-d.ts new file mode 100644 index 0000000000..34692546ba --- /dev/null +++ b/packages/router-core/tests/remountDeps.test-d.ts @@ -0,0 +1,16 @@ +import { describe, expectTypeOf, test } from 'vitest' +import type { RemountDepsOptions } from '../src' + +type SearchSchema = { + testParam: string +} + +type TestRemountDepsOptions = RemountDepsOptions<'/test', SearchSchema, {}, {}> + +describe('RemountDepsOptions type test', () => { + test('search field should be directly accessible', () => { + expectTypeOf< + TestRemountDepsOptions['search'] + >().toEqualTypeOf() + }) +}) diff --git a/packages/router-core/tests/remountDeps.test.ts b/packages/router-core/tests/remountDeps.test.ts new file mode 100644 index 0000000000..5413213db4 --- /dev/null +++ b/packages/router-core/tests/remountDeps.test.ts @@ -0,0 +1,21 @@ +import { describe, expect, test } from 'vitest' +import type { RemountDepsOptions } from '../src' + +describe('RemountDepsOptions unit tests', () => { + test('search field should be directly accessible', () => { + type SearchSchema = { + testParam: string + } + + const mockOptions: RemountDepsOptions<'/test', SearchSchema, {}, {}> = { + routeId: '/test', + search: { + testParam: 'test-value', + }, + params: {}, + loaderDeps: {}, + } + + expect(mockOptions.search.testParam).toBe('test-value') + }) +})