@intlify/vue-router-bridge
Advanced tools
Comparing version 0.2.0 to 0.3.0-1c66b25
@@ -8,3 +8,38 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
declare const VueRouter: any | ||
// Stub VueRouter class interfaces | ||
declare interface VueRouter { | ||
app: Vue | ||
options: RouterOptions | ||
mode: RouterMode | ||
currentRoute: Route | ||
beforeEach(guard: NavigationGuard): Function | ||
beforeResolve(guard: NavigationGuard): Function | ||
afterEach(hook: (to: Route, from: Route) => any): Function | ||
push(location: RawLocation): Promise<Route> | ||
push(location: RawLocation, onComplete?: Function, onAbort?: ErrorHandler): void | ||
replace(location: RawLocation): Promise<Route> | ||
replace(location: RawLocation, onComplete?: Function, onAbort?: ErrorHandler): void | ||
go(n: number): void | ||
back(): void | ||
forward(): void | ||
match(raw: RawLocation, current?: Route, redirectedFrom?: Location): Route | ||
getMatchedComponents(to?: RawLocation | Route): Component[] | ||
onReady(cb: Function, errorCb?: ErrorHandler): void | ||
onError(cb: ErrorHandler): void | ||
addRoutes(routes: RouteConfig[]): void | ||
AddRoute(parent: string, route: RouteConfig): void | ||
AddRoute(route: RouteConfig): void | ||
resolve( | ||
to: RawLocation, | ||
current?: Route, | ||
append?: boolean | ||
): { | ||
location: Location | ||
route: Route | ||
href: string | ||
normalizedTo: Location | ||
resolved: Route | ||
} | ||
} | ||
declare type ErrorHandler = (err: Error) => void | ||
declare type RouterMode = 'hash' | 'history' | 'abstract' | ||
@@ -39,3 +74,21 @@ declare type Dictionary<T> = { [key: string]: T } | ||
} | ||
declare type Vue = any // emulate Vue (v2) | ||
declare type Component = any // emulate Vue Component (v2) | ||
declare type Position = { x: number; y: number } | ||
declare type PositionResult = Position | { selector: string; offset?: Position; behavior?: ScrollBehavior } | void | ||
declare interface RouterOptions { | ||
routes?: RouteConfig[] | ||
mode?: RouterMode | ||
fallback?: boolean | ||
base?: string | ||
linkActiveClass?: string | ||
linkExactActiveClass?: string | ||
parseQuery?: (query: string) => Record<string, any> | ||
stringifyQuery?: (query: Record<string, any>) => string | ||
scrollBehavior?: ( | ||
to: Route, | ||
from: Route, | ||
savedPosition: Position | void | ||
) => PositionResult | Promise<PositionResult> | undefined | null | ||
} | ||
declare type RoutePropsFunction = (route: Route) => Record<string, anu> | ||
@@ -42,0 +95,0 @@ declare interface _RouteConfigBase { |
@@ -8,3 +8,38 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
declare const VueRouter: any | ||
// Stub VueRouter class interfaces | ||
declare interface VueRouter { | ||
app: Vue | ||
options: RouterOptions | ||
mode: RouterMode | ||
currentRoute: Route | ||
beforeEach(guard: NavigationGuard): Function | ||
beforeResolve(guard: NavigationGuard): Function | ||
afterEach(hook: (to: Route, from: Route) => any): Function | ||
push(location: RawLocation): Promise<Route> | ||
push(location: RawLocation, onComplete?: Function, onAbort?: ErrorHandler): void | ||
replace(location: RawLocation): Promise<Route> | ||
replace(location: RawLocation, onComplete?: Function, onAbort?: ErrorHandler): void | ||
go(n: number): void | ||
back(): void | ||
forward(): void | ||
match(raw: RawLocation, current?: Route, redirectedFrom?: Location): Route | ||
getMatchedComponents(to?: RawLocation | Route): Component[] | ||
onReady(cb: Function, errorCb?: ErrorHandler): void | ||
onError(cb: ErrorHandler): void | ||
addRoutes(routes: RouteConfig[]): void | ||
AddRoute(parent: string, route: RouteConfig): void | ||
AddRoute(route: RouteConfig): void | ||
resolve( | ||
to: RawLocation, | ||
current?: Route, | ||
append?: boolean | ||
): { | ||
location: Location | ||
route: Route | ||
href: string | ||
normalizedTo: Location | ||
resolved: Route | ||
} | ||
} | ||
declare type ErrorHandler = (err: Error) => void | ||
declare type RouterMode = 'hash' | 'history' | 'abstract' | ||
@@ -39,3 +74,21 @@ declare type Dictionary<T> = { [key: string]: T } | ||
} | ||
declare type Vue = any // emulate Vue (v2) | ||
declare type Component = any // emulate Vue Component (v2) | ||
declare type Position = { x: number; y: number } | ||
declare type PositionResult = Position | { selector: string; offset?: Position; behavior?: ScrollBehavior } | void | ||
declare interface RouterOptions { | ||
routes?: RouteConfig[] | ||
mode?: RouterMode | ||
fallback?: boolean | ||
base?: string | ||
linkActiveClass?: string | ||
linkExactActiveClass?: string | ||
parseQuery?: (query: string) => Record<string, any> | ||
stringifyQuery?: (query: Record<string, any>) => string | ||
scrollBehavior?: ( | ||
to: Route, | ||
from: Route, | ||
savedPosition: Position | void | ||
) => PositionResult | Promise<PositionResult> | undefined | null | ||
} | ||
declare type RoutePropsFunction = (route: Route) => Record<string, anu> | ||
@@ -42,0 +95,0 @@ declare interface _RouteConfigBase { |
{ | ||
"name": "@intlify/vue-router-bridge", | ||
"version": "0.2.0", | ||
"version": "0.3.0-1c66b25", | ||
"description": "Vue Router bridging for Vue 2 & Vue 3", | ||
"scripts": { | ||
"postinstall": "node ./scripts/postinstall.js" | ||
}, | ||
"peerDependencies": { | ||
@@ -67,3 +64,6 @@ "@vue/composition-api": "^1.0.0-rc.1", | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"postinstall": "node ./scripts/postinstall.js" | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
25556
601
0