Custom classes for Type-safe handling of exceptions in your application.
npm install @fastkit/vue-location
Location Service
A class for referencing and manipulating the state of vue-router.
(ctx: LocationServiceContext): LocationService
Name | Type | Default |
---|---|---|
ctx* | LocationServiceContext |
LocationService
LocationServiceState
The state of the location service
Router
Router instance.
(): import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.4.0_vue@3.4.33/node_modules/vue-router/dist/vue-router").RouteLocationNormalizedLoadedGeneric
The currently active route
Name | Type | Default |
---|
RouteLocationNormalizedLoadedGeneric
The currently active route
<Immediate extends Readonly<boolean> = false>(cb: WatchCallback<RouteLocationNormalizedLoaded, Immediate extends true ? RouteLocationNormalizedLoaded | undefined : RouteLocationNormalizedLoaded>, options?: WatchRouteOptions<Immediate>): WatchStopHandle
Watching route transitions
Name | Type | Default |
---|---|---|
cb* | WatchCallback<RouteLocationNormalizedLoadedGeneric, Immediate extends true ? RouteLocationNormalizedLoadedGeneric | undefined : RouteLocationNormalizedLoadedGeneric> | |
Callback function | ||
options | WatchRouteOptions<Immediate> | undefined | |
Watch options |
WatchStopHandle
Stop function for the watcher
(): _RouteLocationBase | null
The route location object that will be the destination when the route is in the process of transitioning
Name | Type | Default |
---|
null | _RouteLocationBase
The route location object that will be the destination when the route is in the process of transitioning
(): LocationTransitioning | null
The state of route transition
Name | Type | Default |
---|
null | LocationTransitioning
The state of route transition
(target: RouteLocationRaw): boolean
Checks whether the specified location matches the current route.
Name | Type | Default |
---|---|---|
target* | string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | |
The location to be checked for a match with the current route. |
boolean
Returns true if the specified location matches the current route, otherwise returns false.
(queries?: string | string[]): boolean
Check if the specified query is in the process of transitioning
Name | Type | Default |
---|---|---|
queries | string | string[] | undefined | |
The query name or a list of queries to check |
boolean
Returns true
if it is in the process of transitioning
(raw?: RouteLocationRaw, opts?: SameRouteCheckOptions): boolean
Check if the specified route matches the current route
Name | Type | Default |
---|---|---|
raw | string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined | |
The route object to check | ||
opts | SameRouteCheckOptions | undefined | |
boolean
Returns true
if it matches
(): RawRouteComponent[]
Retrieve an array of components that match the currently active route
Name | Type | Default |
---|
RawRouteComponent[]
An array of matching components
(raw: RouteLocationRaw): RawRouteComponent[]
Get an array of components that match the specified route
Name | Type | Default |
---|---|---|
raw* | string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | |
The route object from which to extract components |
RawRouteComponent[]
An array of matching components
(): boolean
Check if the current route is a valid route
This checks if there are one or more matching components.
Name | Type | Default |
---|
boolean
Check if the current route is a valid route
This checks if there are one or more matching components.
(raw?: RouteLocationRaw): boolean
Check if the specified route object is a valid route
Name | Type | Default |
---|---|---|
raw | string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined | |
The route object to check
This checks if there are one or more matching components. |
boolean
Check if the specified route object is a valid route
<Schema extends QueriesSchema>(schema: Schema): TypedQuery<Schema>
Generate an interface for extracting and utility functions for query values corresponding to the specified schema:
Name | Type | Default |
---|---|---|
schema* | Schema | |
Queries schema |
TypedQuery<Schema>
An interface for extracting query values corresponding to a schema and utility functions
(key: string): string | undefined
Name | Type | Default |
---|---|---|
key* | string |
undefined | string
(key: string, type: undefined, defaultValue: string): string
Name | Type | Default |
---|---|---|
key* | string | |
type* | undefined | |
defaultValue* | string |
string
(key: string, type: StringConstructor): string | undefined
Name | Type | Default |
---|---|---|
key* | string | |
type* | StringConstructor |
undefined | string
(key: string, type: StringConstructor, defaultValue: string): string
Name | Type | Default |
---|---|---|
key* | string | |
type* | StringConstructor | |
defaultValue* | string |
string
(key: string, type: NumberConstructor): number | undefined
Name | Type | Default |
---|---|---|
key* | string | |
type* | NumberConstructor |
undefined | number
(key: string, type: NumberConstructor, defaultValue: number): number
Name | Type | Default |
---|---|---|
key* | string | |
type* | NumberConstructor | |
defaultValue* | number |
number
(key: string, type: BooleanConstructor): boolean
Name | Type | Default |
---|---|---|
key* | string | |
type* | BooleanConstructor |
boolean
(key: string, type: BooleanConstructor, defaultValue: boolean): boolean
Name | Type | Default |
---|---|---|
key* | string | |
type* | BooleanConstructor | |
defaultValue* | boolean |
boolean
(query: LocationQueryRaw, route?: import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.4.0_vue@3.4.33/node_modules/vue-router/dist/vue-router").RouteLocationNormalizedLoadedGeneric): _RouteLocationBase
Name | Type | Default |
---|---|---|
query* | LocationQueryRaw | |
route | RouteLocationNormalizedLoadedGeneric | this.currentRoute |
_RouteLocationBase
(to: string | import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.4.0_vue@3.4.33/node_modules/vue-router/dist/vue-router").RouteLocationAsRelativeGeneric | import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.4.0_vue@3.4.33/node_modules/vue-router/dist/vue-router").RouteLocationAsPathGeneric): Promise<...>
Name | Type | Default |
---|---|---|
args | [to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric] |
Promise<void | NavigationFailure | undefined>
(query: LocationQueryRaw): Promise<void | import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.4.0_vue@3.4.33/node_modules/vue-router/dist/vue-router").NavigationFailure | undefined>
Name | Type | Default |
---|---|---|
query* | LocationQueryRaw |
Promise<void | NavigationFailure | undefined>
(to: string | import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.4.0_vue@3.4.33/node_modules/vue-router/dist/vue-router").RouteLocationAsRelativeGeneric | import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.4.0_vue@3.4.33/node_modules/vue-router/dist/vue-router").RouteLocationAsPathGeneric): Promise<...>
Name | Type | Default |
---|---|---|
args | [to: string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric] |
Promise<void | NavigationFailure | undefined>
(query: LocationQueryRaw): Promise<void | import("/home/runner/work/fastkit/fastkit/node_modules/.pnpm/vue-router@4.4.0_vue@3.4.33/node_modules/vue-router/dist/vue-router").NavigationFailure | undefined>
Name | Type | Default |
---|---|---|
query* | LocationQueryRaw |
Promise<void | NavigationFailure | undefined>
(delta: number): void
Name | Type | Default |
---|---|---|
args | [delta: number] |
void
(): void
Name | Type | Default |
---|---|---|
args | [] |
void
(): void
Name | Type | Default |
---|---|---|
args | [] |
void