import type { AnyRouter, Constrain, InferFrom, InferMaskFrom, InferMaskTo, InferSelected, InferShouldThrow, InferStrict, InferTo, RegisteredRouter, } from '@tanstack/router-core' import type { LinkComponentProps } from './link' import type { UseParamsOptions } from './useParams' import type { UseSearchOptions } from './useSearch' export type ValidateLinkOptions< TRouter extends AnyRouter = RegisteredRouter, TOptions = unknown, TDefaultFrom extends string = string, TComp = 'a', > = Constrain< TOptions, LinkComponentProps< TComp, TRouter, InferFrom, InferTo, InferMaskFrom, InferMaskTo > > /** * @internal */ export type InferStructuralSharing = TOptions extends { structuralSharing: infer TStructuralSharing } ? TStructuralSharing : unknown export type ValidateUseSearchOptions< TOptions, TRouter extends AnyRouter = RegisteredRouter, > = Constrain< TOptions, UseSearchOptions< TRouter, InferFrom, InferStrict, InferShouldThrow, InferSelected, InferStructuralSharing > > export type ValidateUseParamsOptions< TOptions, TRouter extends AnyRouter = RegisteredRouter, > = Constrain< TOptions, UseParamsOptions< TRouter, InferFrom, InferStrict, InferShouldThrow, InferSelected, InferSelected > > export type ValidateLinkOptionsArray< TRouter extends AnyRouter = RegisteredRouter, TOptions extends ReadonlyArray = ReadonlyArray, TDefaultFrom extends string = string, TComp = 'a', > = { [K in keyof TOptions]: ValidateLinkOptions< TRouter, TOptions[K], TDefaultFrom, TComp > }