"@vue/devtools-api": "^6.6.4"
},
"devDependencies": {
- "@microsoft/api-extractor": "^7.52.11",
- "@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-commonjs": "^25.0.8",
"@rollup/plugin-node-resolve": "^15.3.1",
"@rollup/plugin-replace": "^5.0.7",
"nightwatch-helpers": "^1.2.0",
"rimraf": "^6.0.1",
"rollup": "^3.29.5",
- "rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-typescript2": "^0.36.0",
"tsdown": "^0.12.9",
"tsup": "^8.5.0",
*
* @template TIn - type of the input value to match against the pattern
* @template TParams - type of the output value after matching
+ * @template TParamsRaw - type of the input value to build the input from
*
* In the case of the `path`, the `TIn` is a `string`, but in the case of the
- * query, it's the object of query params.
+ * query, it's the object of query params. `TParamsRaw` allows for a more permissive
+ * type when building the value, for example allowing numbers and strings like
+ * the old params.
*
* @internal this is the base interface for all matcher patterns, it shouldn't
* be used directly
// not allow `null` within an array or `undefined`)
TUrlParam = MatcherQueryParamsValue,
// the type that can be passed as a location when navigating: `router.push({ params: { }})`
- // it's sometimes for more permissive than TParam, for example allowing nullish values
+ // it's sometimes more permissive than TParam, for example allowing nullish values
TParamRaw = TParam,
> {
get?: (value: NoInfer<TUrlParam>) => TParam
* serialization of params, query, and hash.
*
* - `TMatcherRecordRaw` represents the raw record type passed to {@link addMatcher}.
- * - `TMatcherRecord` represents the normalized record type returned by {@link getRecords}.
+ * - `TMatcherRecord` represents the normalized record type returned by {@link getRoutes}.
*/
export interface EXPERIMENTAL_Resolver_Base<TRecord> {
/**
*/
resolve(
location: ResolverLocationAsNamed,
- // TODO: is this useful?
+ // TODO: is this type strictness useful?
currentLocation?: undefined
// currentLocation?: undefined | NEW_LocationResolved<TMatcherRecord>
): ResolverLocationResolved<TRecord>
): ResolverLocationResolved<TRecord>
/**
- * Get a list of all resolver records.
- * Previously named `getRoutes()`
+ * Get a list of all resolver route records.
*/
- getRecords(): TRecord[]
+ getRoutes(): TRecord[]
/**
* Get a resolver record by its name.
* Previously named `getRecordMatcher()`
*/
- getRecord(name: RecordName): TRecord | undefined
+ getRoute(name: RecordName): TRecord | undefined
}
/**
*/
export interface EXPERIMENTAL_ResolverRecord_Group
extends EXPERIMENTAL_ResolverRecord_Base {
+ /**
+ * A group route cannot be matched directly and so names are not allowed.
+ */
name?: undefined
path?: undefined
// Query is the only kind of matcher that is non-exclusive
}
/**
- * A matchable record is a record that can be matched by a path, query or hash and will resolve to a location.
+ * A matchable record is a record that can be matched by a path, query or hash
+ * and will resolve to a location.
*/
export interface EXPERIMENTAL_ResolverRecord_Matchable
extends EXPERIMENTAL_ResolverRecord_Base {
return {
resolve,
- getRecords: () => records,
- getRecord: name => recordMap.get(name),
+ getRoutes: () => records,
+ getRoute: name => recordMap.get(name),
}
}
resolver: EXPERIMENTAL_ResolverFixed<EXPERIMENTAL_RouteRecordNormalized_Matchable>
}
+// TODO: Make the Router extends the resolver so that it automatically exposes
+// getRoutes and resolve. This should make it automatic to have a dynamic
+// resolver
+
/**
* Router base instance.
*
history.scrollRestoration = 'manual'
}
- function getRoutes() {
- return resolver.getRecords()
- }
-
- function hasRoute(name: NonNullable<RouteRecordNameGeneric>): boolean {
- return !!resolver.getRecord(name)
- }
-
// NOTE: to support multiple overloads
type TRecord = EXPERIMENTAL_RouteRecordNormalized
type _resolveArgs =
currentRoute,
listening: true,
- hasRoute,
- getRoutes,
+ hasRoute: name => !!resolver.getRoute(name),
+ getRoutes: () => resolver.getRoutes(),
// @ts-expect-error FIXME: update EXPERIMENTAL_Router types
resolve,
options,
specifier: ^6.6.4
version: 6.6.4
devDependencies:
- '@microsoft/api-extractor':
- specifier: ^7.52.11
- version: 7.52.11(@types/node@24.3.0)
- '@rollup/plugin-alias':
- specifier: ^5.1.1
- version: 5.1.1(rollup@3.29.5)
'@rollup/plugin-commonjs':
specifier: ^25.0.8
version: 25.0.8(rollup@3.29.5)
rollup:
specifier: ^3.29.5
version: 3.29.5
- rollup-plugin-analyzer:
- specifier: ^4.0.0
- version: 4.0.0
rollup-plugin-typescript2:
specifier: ^0.36.0
version: 0.36.0(rollup@3.29.5)(typescript@5.8.3)
'@rolldown/pluginutils@1.0.0-beta.29':
resolution: {integrity: sha512-NIJgOsMjbxAXvoGq/X0gD7VPMQ8j9g0BiDaNjVNVjvl+iKXxL3Jre0v31RmBYeLEmkbj2s02v8vFTbUXi5XS2Q==}
- '@rollup/plugin-alias@5.1.1':
- resolution: {integrity: sha512-PR9zDb+rOzkRb2VD+EuKB7UC41vU5DIwZ5qqCpk0KJudcWAyi8rvYOhS7+L5aZCspw1stTViLgN5v6FF1p5cgQ==}
- engines: {node: '>=14.0.0'}
- peerDependencies:
- rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
- peerDependenciesMeta:
- rollup:
- optional: true
-
'@rollup/plugin-commonjs@25.0.8':
resolution: {integrity: sha512-ZEZWTK5n6Qde0to4vS9Mr5x/0UZoqCxPVR9KRUjU4kA2sO7GEUn1fop0DAwpO6z0Nw/kJON9bDmSxdWxO/TT1A==}
engines: {node: '>=14.0.0'}
resolution: {integrity: sha512-QOANlVluwwrLP5snQqKfC2lv/KJphMkjh4V0gpw0K40GdKmhd8eShIGOJNAC51idk5cn3xI08SZTRWj0R2XlDw==}
hasBin: true
- rollup-plugin-analyzer@4.0.0:
- resolution: {integrity: sha512-LL9GEt3bkXp6Wa19SNR5MWcvHNMvuTFYg+eYBZN2OIFhSWN+pEJUQXEKu5BsOeABob3x9PDaLKW7w5iOJnsESQ==}
- engines: {node: '>=8.0.0'}
-
rollup-plugin-typescript2@0.36.0:
resolution: {integrity: sha512-NB2CSQDxSe9+Oe2ahZbf+B4bh7pHwjV5L+RSYpCu7Q5ROuN94F9b6ioWwKfz3ueL3KTtmX4o2MUH2cgHDIEUsw==}
peerDependencies:
'@iconify/types@2.0.0': {}
- '@isaacs/balanced-match@4.0.1': {}
+ '@isaacs/balanced-match@4.0.1':
+ optional: true
'@isaacs/brace-expansion@5.0.0':
dependencies:
'@isaacs/balanced-match': 4.0.1
+ optional: true
'@isaacs/cliui@8.0.2':
dependencies:
'@rushstack/node-core-library': 5.14.0(@types/node@24.3.0)
transitivePeerDependencies:
- '@types/node'
+ optional: true
'@microsoft/api-extractor@7.52.11(@types/node@24.3.0)':
dependencies:
typescript: 5.8.2
transitivePeerDependencies:
- '@types/node'
+ optional: true
'@microsoft/tsdoc-config@0.17.1':
dependencies:
ajv: 8.12.0
jju: 1.4.0
resolve: 1.22.8
+ optional: true
- '@microsoft/tsdoc@0.15.1': {}
+ '@microsoft/tsdoc@0.15.1':
+ optional: true
'@napi-rs/wasm-runtime@1.0.0':
dependencies:
'@rolldown/pluginutils@1.0.0-beta.29': {}
- '@rollup/plugin-alias@5.1.1(rollup@3.29.5)':
- optionalDependencies:
- rollup: 3.29.5
-
'@rollup/plugin-commonjs@25.0.8(rollup@3.29.5)':
dependencies:
'@rollup/pluginutils': 5.1.0(rollup@3.29.5)
semver: 7.5.4
optionalDependencies:
'@types/node': 24.3.0
+ optional: true
'@rushstack/rig-package@0.5.3':
dependencies:
resolve: 1.22.8
strip-json-comments: 3.1.1
+ optional: true
'@rushstack/terminal@0.15.4(@types/node@24.3.0)':
dependencies:
supports-color: 8.1.1
optionalDependencies:
'@types/node': 24.3.0
+ optional: true
'@rushstack/ts-command-line@5.0.2(@types/node@24.3.0)':
dependencies:
string-argv: 0.3.2
transitivePeerDependencies:
- '@types/node'
+ optional: true
'@sec-ant/readable-stream@0.4.1': {}
tslib: 2.8.1
optional: true
- '@types/argparse@1.0.38': {}
+ '@types/argparse@1.0.38':
+ optional: true
'@types/chai@4.3.16': {}
ajv-draft-04@1.0.0(ajv@8.13.0):
optionalDependencies:
ajv: 8.13.0
+ optional: true
ajv-formats@3.0.1(ajv@8.13.0):
optionalDependencies:
ajv: 8.13.0
+ optional: true
ajv@8.12.0:
dependencies:
json-schema-traverse: 1.0.0
require-from-string: 2.0.2
uri-js: 4.4.1
+ optional: true
ajv@8.13.0:
dependencies:
json-schema-traverse: 1.0.0
require-from-string: 2.0.2
uri-js: 4.4.1
+ optional: true
algoliasearch@5.34.0:
dependencies:
argparse@1.0.10:
dependencies:
sprintf-js: 1.0.3
+ optional: true
argparse@2.0.1: {}
faked-promise@2.2.2: {}
- fast-deep-equal@3.1.3: {}
+ fast-deep-equal@3.1.3:
+ optional: true
fast-fifo@1.3.2: {}
graceful-fs: 4.2.11
jsonfile: 6.2.0
universalify: 2.0.1
+ optional: true
fs.realpath@1.0.0: {}
immediate@3.0.6: {}
- import-lazy@4.0.0: {}
+ import-lazy@4.0.0:
+ optional: true
indent-string@4.0.0: {}
jiti@2.4.2: {}
- jju@1.4.0: {}
+ jju@1.4.0:
+ optional: true
joycon@3.1.1: {}
json-parse-even-better-errors@2.3.1: {}
- json-schema-traverse@1.0.0: {}
+ json-schema-traverse@1.0.0:
+ optional: true
json-stringify-safe@5.0.1: {}
universalify: 2.0.1
optionalDependencies:
graceful-fs: 4.2.11
+ optional: true
jsonparse@1.3.1: {}
minimatch@10.0.3:
dependencies:
'@isaacs/brace-expansion': 5.0.0
+ optional: true
minimatch@3.1.2:
dependencies:
require-directory@2.1.1: {}
- require-from-string@2.0.2: {}
+ require-from-string@2.0.2:
+ optional: true
requires-port@1.0.0: {}
'@rolldown/binding-win32-ia32-msvc': 1.0.0-beta.28
'@rolldown/binding-win32-x64-msvc': 1.0.0-beta.28
- rollup-plugin-analyzer@4.0.0: {}
-
rollup-plugin-typescript2@0.36.0(rollup@3.29.5)(typescript@5.8.3):
dependencies:
'@rollup/pluginutils': 4.2.1
semver@7.5.4:
dependencies:
lru-cache: 6.0.0
+ optional: true
semver@7.7.1: {}
dependencies:
through: 2.3.8
- sprintf-js@1.0.3: {}
+ sprintf-js@1.0.3:
+ optional: true
sprintf-js@1.1.3: {}
typescript: 5.8.3
yaml: 2.8.0
- typescript@5.8.2: {}
+ typescript@5.8.2:
+ optional: true
typescript@5.8.3: {}
uri-js@4.4.1:
dependencies:
punycode: 2.3.1
+ optional: true
url-parse@1.5.10:
dependencies: