Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation type should be interface so it can be documented #37384

Open
jbogarthyde opened this issue Jun 1, 2020 · 0 comments
Open

Navigation type should be interface so it can be documented #37384

jbogarthyde opened this issue Jun 1, 2020 · 0 comments

Comments

@jbogarthyde
Copy link
Contributor

@jbogarthyde jbogarthyde commented Jun 1, 2020

🐞 bug report

Affected Package

@angular/router

Is this a regression?

Yes, the previous version in which this bug was not present was: ....

Description

The property documentation strings that are present in the file do not render because this is a type. Per @petebacondarwin, it could just as easily be an interface, which could be properly documented.

🔬 Minimal Reproduction

Compare: https://angular.io/api/router/Navigation
Source doc: packages/router/src/router.ts

/**
 * Information about a navigation operation. Retrieve the most recent
 * navigation object with the {@link Router#getCurrentNavigation()} method.
 *
 * @see [Router#getCurrentNavigation()](api/router/Router#getcurrentnavigation)
 *
 * @publicApi
 */
export type Navigation = {
  /**
   * The unique identifier of the current navigation.
   */
  id: number;
  /**
   * The target URL passed into the `Router#navigateByUrl()` call before navigation. This is
   * the value before the router has parsed or applied redirects to it.
   */
  initialUrl: string | UrlTree;
  /**
   * The initial target URL after being parsed with `UrlSerializer.extract()`.
   */
  extractedUrl: UrlTree;
  /**
   * The extracted URL after redirects have been applied.
   * This URL may not be available immediately, therefore this property can be `undefined`.
   * It is guaranteed to be set after the `RoutesRecognized` event fires.
   */
  finalUrl?: UrlTree;
  /**
   * Identifies how this navigation was triggered.
   *
   * * 'imperative'--Triggered by `router.navigateByUrl` or `router.navigate`.
   * * 'popstate'--Triggered by a popstate event.
   * * 'hashchange'--Triggered by a hashchange event.
   */
  trigger: 'imperative' | 'popstate' | 'hashchange';
  /**
   * Options that controlled the strategy used for this navigation.
   * See `NavigationExtras`.
   */
  extras: NavigationExtras;
  /**
   * The previously successful `Navigation` object. Only one previous navigation
   * is available, therefore this previous `Navigation` object has a `null` value
   * for its own `previousNavigation`.
   */
  previousNavigation: Navigation | null;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
docs
Awaiting triage
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.