]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: add docs to typings so they appear on vscode
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 2 May 2019 13:04:48 +0000 (15:04 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 2 May 2019 13:04:48 +0000 (15:04 +0200)
src/types/index.ts

index 078bb9c55700cb36e7c1293ada1f1982e4a996bb..59f84558015dc0f3954a712c399702458e470e72 100644 (file)
@@ -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<void>
+  /**
+   * 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<void>
 }
 // TODO: have a real type with augmented properties
 // export type RouteComponent = TODO & RouteComponentInterface