Skip to content

Commit

Permalink
chore: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Dec 23, 2024
1 parent a515a21 commit 42c9849
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions packages/router/src/experimental/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ export interface EXPERIMENTAL_RouterOptions_Base extends PathParserOptions {
* }
* ```
*/

scrollBehavior?: RouterScrollBehavior

/**
* Custom implementation to parse a query. See its counterpart,
* {@link EXPERIMENTAL_RouterOptions_Base.stringifyQuery}.
Expand All @@ -145,26 +145,27 @@ export interface EXPERIMENTAL_RouterOptions_Base extends PathParserOptions {
* })
* ```
*/

parseQuery?: typeof originalParseQuery

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

stringifyQuery?: typeof originalStringifyQuery

/**
* Default class applied to active {@link RouterLink}. If none is provided,
* `router-link-active` will be applied.
*/

linkActiveClass?: string

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

linkExactActiveClass?: string

/**
* Default class applied to non-active {@link RouterLink}. If none is provided,
* `router-link-inactive` will be applied.
Expand All @@ -191,7 +192,7 @@ export interface EXPERIMENTAL_RouterOptions<TRouteRecordRaw, TRouteRecord>
}

/**
* Router instance.
* Router base instance.
* @experimental This version is not stable, it's meant to replace {@link Router} in the future.
*/
export interface EXPERIMENTAL_Router_Base<TRouteRecordRaw, TRouteRecord> {
Expand Down Expand Up @@ -1161,7 +1162,6 @@ export function experimental_createRouter(
}

// Initialization and Errors

let readyHandlers = useCallbacks<_OnReadyCallback>()
let errorListeners = useCallbacks<_ErrorListener>()
let ready: boolean
Expand Down Expand Up @@ -1206,9 +1206,9 @@ export function experimental_createRouter(
* only be called once, otherwise does nothing.
* @param err - optional error
*/
function markAsReady<E = any>(err: E): E
function markAsReady<E = any>(): void
function markAsReady<E = any>(err?: E): E | void {
function markAsReady<E = unknown>(err: E): E
function markAsReady(): void
function markAsReady<E = unknown>(err?: E): E | void {
if (!ready) {
// still not ready if an error happened
ready = !err
Expand Down
2 changes: 0 additions & 2 deletions packages/router/src/new-route-resolver/matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,6 @@ export function createCompiledMatcher(
// }

parsedParams = { ...pathParams, ...queryParams, ...hashParams }

if (parsedParams) break
} catch (e) {
// for debugging tests
// console.log('❌ ERROR matching', e)
Expand Down
6 changes: 4 additions & 2 deletions packages/router/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export type RouteComponent = Component | DefineComponent
*/
export type RawRouteComponent = RouteComponent | Lazy<RouteComponent>

// TODO: could this be moved to matcher?
// TODO: could this be moved to matcher? YES, it's on the way
/**
* Internal type for common properties among all kind of {@link RouteRecordRaw}.
*/
Expand Down Expand Up @@ -278,7 +278,9 @@ export interface RouteRecordSingleView extends _RouteRecordBase {
}

/**
* Route Record defining one single component with a nested view.
* Route Record defining one single component with a nested view. Differently
* from {@link RouteRecordSingleView}, this record has children and allows a
* `redirect` option.
*/
export interface RouteRecordSingleViewWithChildren extends _RouteRecordBase {
/**
Expand Down

0 comments on commit 42c9849

Please sign in to comment.