From: Eduardo San Martin Morote Date: Thu, 2 May 2019 13:04:48 +0000 (+0200) Subject: docs: add docs to typings so they appear on vscode X-Git-Tag: v4.0.0-alpha.0~411 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d820f5b22b4a064c20abf0d2154fe1e7e75ad9e;p=thirdparty%2Fvuejs%2Frouter.git docs: add docs to typings so they appear on vscode --- diff --git a/src/types/index.ts b/src/types/index.ts index 078bb9c5..59f84558 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -61,7 +61,20 @@ export interface RouteLocationNormalized // TODO: type this for beforeRouteUpdate and beforeRouteLeave export interface RouteComponentInterface { beforeRouteEnter?: NavigationGuard + /** + * Guard called when the router is navigating away from the current route + * that is rendering this component. + * @param to RouteLocation we are navigating to + * @param from RouteLocation we are navigating from + * @param next function to validate, cancel or modify (by redirectering) the navigation + */ beforeRouteLeave?: NavigationGuard + /** + * Guard called whenever the route that renders this component has changed but + * it is reused for the new route. This allows you to guard for changes in params, + * the query or the hash. + */ + beforeRouteUpdate?: NavigationGuard } // TODO: have a real type with augmented properties // export type RouteComponent = TODO & RouteComponentInterface