Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ export interface ResolverLocationAsNamed {
name: RecordName
// FIXME: should this be optional?
params: MatcherParamsFormatted
query?: LocationQueryRaw
hash?: string
query?: LocationQueryRaw | undefined
hash?: string | undefined

/**
* @deprecated This is ignored when `name` is provided
Expand All @@ -168,8 +168,8 @@ export interface ResolverLocationAsNamed {
*/
export interface ResolverLocationAsPathRelative {
path: string
query?: LocationQueryRaw
hash?: string
query?: LocationQueryRaw | undefined
hash?: string | undefined

/**
* @deprecated This is ignored when `path` is provided
Expand Down Expand Up @@ -208,9 +208,9 @@ export interface ResolverLocationAsPathAbsolute extends ResolverLocationAsPathRe
* ```
*/
export interface ResolverLocationAsRelative {
params?: MatcherParamsFormatted
query?: LocationQueryRaw
hash?: string
params?: MatcherParamsFormatted | undefined
query?: LocationQueryRaw | undefined
hash?: string | undefined

/**
* @deprecated This location is relative to the next parameter. This `name` will be ignored.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,35 @@ export interface EXPERIMENTAL_ResolverRecord_Base {
* Name of the matcher. Unique across all matchers. If missing, this record
* cannot be matched. This is useful for grouping records.
*/
name?: RecordName
name?: RecordName | undefined

/**
* {@link MatcherPattern} for the path section of the URI.
*/
path?: MatcherPatternPath
path?: MatcherPatternPath | undefined

/**
* {@link MatcherPattern} for the query section of the URI.
*/
query?: MatcherPatternQuery[]
query?: MatcherPatternQuery[] | undefined

/**
* {@link MatcherPattern} for the hash section of the URI.
*/
hash?: MatcherPatternHash
hash?: MatcherPatternHash | undefined

/**
* Parent record. The parent can be a group or a matchable record.
* It will be included in the `matched` array of a resolved location.
*/
parent?: EXPERIMENTAL_ResolverRecord_Base | null // the parent can be matchable or not
parent?: EXPERIMENTAL_ResolverRecord_Base | null | undefined // the parent can be matchable or not

/**
* If this record is an alias of another record, this points to the original
* record. Alias records are not added to the name map and resolve to the
* original record's name.
*/
aliasOf?: EXPERIMENTAL_ResolverRecord_Base | null
aliasOf?: EXPERIMENTAL_ResolverRecord_Base | null | undefined
}

/**
Expand Down
26 changes: 13 additions & 13 deletions packages/router/src/experimental/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export interface EXPERIMENTAL_RouterOptions_Base extends PathParserOptions {
* }
* ```
*/
scrollBehavior?: RouterScrollBehavior
scrollBehavior?: RouterScrollBehavior | undefined

/**
* Custom implementation to parse a query. See its counterpart,
Expand All @@ -150,26 +150,26 @@ export interface EXPERIMENTAL_RouterOptions_Base extends PathParserOptions {
* })
* ```
*/
parseQuery?: typeof originalParseQuery
parseQuery?: typeof originalParseQuery | undefined

/**
* Custom implementation to stringify a query object. Should not prepend a leading `?`.
* {@link parseQuery} counterpart to handle query parsing.
*/

stringifyQuery?: typeof originalStringifyQuery
stringifyQuery?: typeof originalStringifyQuery | undefined

/**
* Default class applied to active {@link RouterLink}. If none is provided,
* `router-link-active` will be applied.
*/
linkActiveClass?: string
linkActiveClass?: string | undefined

/**
* Default class applied to exact active {@link RouterLink}. If none is provided,
* `router-link-exact-active` will be applied.
*/
linkExactActiveClass?: string
linkExactActiveClass?: string | undefined

/**
* Default class applied to non-active {@link RouterLink}. If none is provided,
Expand All @@ -187,7 +187,7 @@ export interface EXPERIMENTAL_RouteRecord_Base extends EXPERIMENTAL_ResolverReco
* before any navigation guard and triggers a new navigation with the new
* target location.
*/
redirect?: RouteRecordRedirectOption
redirect?: RouteRecordRedirectOption | undefined

// TODO: deprecate, expose utils to compare resolved routes, and document
// how to create a meta field that does the same
Expand All @@ -202,22 +202,22 @@ export interface EXPERIMENTAL_RouteRecord_Base extends EXPERIMENTAL_ResolverReco
/**
* Arbitrary data attached to the record.
*/
meta?: RouteMeta
meta?: RouteMeta | undefined

/**
* Components to display when the URL matches this route. Allow using named views.
*/
components?: Record<string, RawRouteComponent>
components?: Record<string, RawRouteComponent> | undefined

/**
* Parent of this component if any
*/
parent?: EXPERIMENTAL_RouteRecordNormalized | null
parent?: EXPERIMENTAL_RouteRecordNormalized | null | undefined

/**
* References another record if this record is an alias of it.
*/
aliasOf?: EXPERIMENTAL_RouteRecordNormalized | null
aliasOf?: EXPERIMENTAL_RouteRecordNormalized | null | undefined

// TODO:
/**
Expand All @@ -231,7 +231,7 @@ export interface EXPERIMENTAL_RouteRecord_Redirect
extends
Omit<EXPERIMENTAL_RouteRecord_Base, 'name' | 'path'>,
Omit<EXPERIMENTAL_ResolverRecord_Matchable, 'parent' | 'aliasOf'> {
components?: Record<string, RawRouteComponent>
components?: Record<string, RawRouteComponent> | undefined

redirect: RouteRecordRedirectOption // must be defined
}
Expand All @@ -244,7 +244,7 @@ export interface EXPERIMENTAL_RouteRecord_Group
'name' | 'path' | 'query' | 'hash'
>,
Omit<EXPERIMENTAL_ResolverRecord_Group, 'parent' | 'aliasOf'> {
components?: Record<string, RawRouteComponent>
components?: Record<string, RawRouteComponent> | undefined
}

export interface EXPERIMENTAL_RouteRecord_Components
Expand All @@ -254,7 +254,7 @@ export interface EXPERIMENTAL_RouteRecord_Components
Omit<EXPERIMENTAL_ResolverRecord_Matchable, 'parent' | 'aliasOf'> {
components: Record<string, RawRouteComponent>

redirect?: never
redirect?: never | undefined
}

export type EXPERIMENTAL_RouteRecord_Matchable =
Expand Down
8 changes: 4 additions & 4 deletions packages/router/src/matcher/pathParserRanker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,22 @@ export interface _PathParserOptions {
*
* @defaultValue `false`
*/
sensitive?: boolean
sensitive?: boolean | undefined

/**
* Whether to disallow a trailing slash or not.
*
* @defaultValue `false`
*/
strict?: boolean
strict?: boolean | undefined

/**
* Should the RegExp match from the beginning by prepending a `^` to it.
* @internal
*
* @defaultValue `true`
*/
start?: boolean
start?: boolean | undefined

/**
* Should the RegExp match until the end by appending a `$` to it.
Expand All @@ -81,7 +81,7 @@ export interface _PathParserOptions {
*
* @defaultValue `true`
*/
end?: boolean
end?: boolean | undefined
}

export type PathParserOptions = Pick<
Expand Down
8 changes: 4 additions & 4 deletions packages/router/src/scrollBehavior.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { warn } from './warning'
* Note that not all browsers support `behavior`.
*/
export type ScrollPositionCoordinates = {
behavior?: ScrollOptions['behavior']
left?: number
top?: number
behavior?: ScrollOptions['behavior'] | undefined
left?: number | undefined
top?: number | undefined
}

/**
Expand All @@ -24,7 +24,7 @@ export type ScrollPositionCoordinates = {
* @internal
*/
export type _ScrollPositionNormalized = {
behavior?: ScrollOptions['behavior']
behavior?: ScrollOptions['behavior'] | undefined
left: number
top: number
}
Expand Down
8 changes: 4 additions & 4 deletions packages/router/src/typed-routes/route-location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ export type RouteLocationNormalizedLoadedTypedList<
*/
export interface RouteLocationAsRelativeGeneric
extends RouteQueryAndHash, RouteLocationOptions {
name?: RouteRecordNameGeneric
params?: RouteParamsRawGeneric
name?: RouteRecordNameGeneric | undefined
params?: RouteParamsRawGeneric | undefined
/**
* A relative path to the current location. This property should be removed
*/
Expand All @@ -147,8 +147,8 @@ export interface RouteLocationAsRelativeTyped<
RouteMapGeneric,
Name extends keyof RouteMap = keyof RouteMap,
> extends RouteLocationAsRelativeGeneric {
name?: Extract<Name, string | symbol>
params?: RouteMap[Name]['paramsRaw']
name?: Extract<Name, string | symbol> | undefined
params?: RouteMap[Name]['paramsRaw'] | undefined
}

/**
Expand Down
Loading
Loading