diff --git a/src/common/trace.ts b/src/common/trace.ts index 390dcf3d..f0ffbcd2 100644 --- a/src/common/trace.ts +++ b/src/common/trace.ts @@ -1,5 +1,5 @@ /** - * UI-Router Transition Tracing + * # Transition tracing (debug) * * Enable transition tracing to print transition information to the console, * in order to help debug your application. diff --git a/src/globals.ts b/src/globals.ts index 28b7b7fe..641ab08a 100644 --- a/src/globals.ts +++ b/src/globals.ts @@ -11,7 +11,7 @@ import {TransitionService} from "./transition/transitionService"; import {copy} from "./common/common"; /** - * Global mutable state + * Global router state * * This is where we hold the global mutable state such as current state, current * params, current transition, etc. @@ -43,17 +43,30 @@ export interface UIRouterGlobals { /** - * Global mutable state + * Global router state + * + * This is where we hold the global mutable state such as current state, current + * params, current transition, etc. */ export class Globals implements UIRouterGlobals { + /** @inheritdoc */ params: StateParams = new StateParams(); + /** @inheritdoc */ current: StateDeclaration; + /** @inheritdoc */ $current: State; + /** @inheritdoc */ transition: Transition; + + /** @internalapi */ transitionHistory = new Queue([], 1); + + /** @internalapi */ successfulTransitions = new Queue([], 1); + /** @hidden */ constructor(transitionService: TransitionService) { + // TODO: This probably belongs in a hooks/globals.ts const beforeNewTransition = ($transition$: Transition) => { this.transition = $transition$; diff --git a/src/interface.ts b/src/interface.ts index 4b819f4b..721fef37 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -1,5 +1,5 @@ /** - * Core classes and interfaces + * # Core classes and interfaces * * The classes and interfaces that are core to ui-router and do not belong * to a more specific subsystem (such as resolve). @@ -16,16 +16,23 @@ import {UIRouter} from "./router"; /** * An interface for getting values from dependency injection. * - * This injector primarily returns resolve values (using a [[ResolveContext]]) that match the given token. + * This is primarily used to get resolve values for a given token. + * An instance of the `UIInjector` can be retrieved from the current transition using [[Transition.injector]]. + * + * --- + * * If no resolve is found for a token, then it will delegate to the native injector. - * The native injector may be Angular 1 `$injector`, Angular 2 `Injector`, or a naive polyfill. + * The native injector may be Angular 1 `$injector`, Angular 2 `Injector`, or a simple polyfill. * * In Angular 2, the native injector might be the root Injector, * or it might be a lazy loaded `NgModule` injector scoped to a lazy load state tree. */ export interface UIInjector { /** - * Gets a value from the injector + * Gets a value from the injector. + * + * For a given token, returns the value from the injector that matches the token. + * If the token is for a resolve that has not yet been fetched, this throws an error. * * #### Example: * ```js @@ -34,7 +41,7 @@ export interface UIInjector { * * #### ng1 Example: * ```js - * // Fetch $state service + * // Fetch StateService * injector.get('$state').go('home'); * ``` * @@ -50,26 +57,23 @@ export interface UIInjector { * var stringArray = injector.get('myStringArray'); * ``` * - * --- - * * ### `NOWAIT` policy * * When using [[ResolvePolicy.async]] === `NOWAIT`, the value returned from `get()` is a promise for the result. + * The promise is not automatically unwrapped. * - * @param token the key for the value to get. May be a string or arbitrary object. + * @param token the key for the value to get. May be a string, a class, or any arbitrary object. * @return the Dependency Injection value that matches the token */ get(token: any): any; + /** Gets a value as type `T` (generics parameter) */ get(token: any): T; /** * Asynchronously gets a value from the injector * - * If the [[ResolveContext]] has a [[Resolvable]] matching the token, it will be - * asynchronously resolved. - * - * Returns a promise for a value from the injector. - * Returns resolve values and/or values from the native injector (ng1/ng2). + * For a given token, returns a promise for the value from the injector that matches the token. + * If the token is for a resolve that has not yet been fetched, this triggers the resolve to load. * * #### Example: * ```js @@ -82,6 +86,7 @@ export interface UIInjector { * @return a Promise for the Dependency Injection value that matches the token */ getAsync(token: any): Promise; + /** Asynchronously gets a value as type `T` (generics parameter) */ getAsync(token: any): Promise; /** @@ -101,15 +106,19 @@ export interface UIInjector { getNative(token: any): T; } +/** @internalapi */ export interface UIRouterPlugin extends Disposable { name: string; } -export abstract class UIRouterPluginBase implements UIRouterPlugin { +/** @internalapi */ +export abstract class UIRouterPluginBase implements UIRouterPlugin, Disposable { abstract name: string; dispose(router: UIRouter) { } } +/** @internalapi */ export interface Disposable { + /** Instructs the Disposable to clean up any resources */ dispose(router?: UIRouter); } \ No newline at end of file diff --git a/src/resolve/interface.ts b/src/resolve/interface.ts index dc089b63..f85ee7fc 100644 --- a/src/resolve/interface.ts +++ b/src/resolve/interface.ts @@ -1,5 +1,5 @@ /** - * The Resolve subsystem + * # The Resolve subsystem * * This subsystem is an asynchronous, hierarchical Dependency Injection system. * diff --git a/src/router.ts b/src/router.ts index 667e01d2..ec4e6251 100644 --- a/src/router.ts +++ b/src/router.ts @@ -21,34 +21,53 @@ let _routerInstance = 0; /** * The master class used to instantiate an instance of UI-Router. * - * UI-Router (for a specific framework) will create an instance of this class during bootstrap. + * UI-Router (for each specific framework) will create an instance of this class during bootstrap. * This class instantiates and wires the UI-Router services together. * * After a new instance of the UIRouter class is created, it should be configured for your app. - * For instance, app states should be registered with the [[stateRegistry]]. + * For instance, app states should be registered with the [[UIRouter.stateRegistry]]. * - * Tell UI-Router to monitor the URL by calling `uiRouter.urlRouter.listen()` ([[UrlRouter.listen]]) + * --- + * + * Normally the framework code will bootstrap UI-Router. + * If you are bootstrapping UIRouter manually, tell it to monitor the URL by calling + * [[UrlService.listen]] then [[UrlService.sync]]. */ export class UIRouter { /** @hidden */ $id: number = _routerInstance++; + /** Provides services related to ui-view synchronization */ viewService = new ViewService(); + /** Provides services related to Transitions */ transitionService: TransitionService = new TransitionService(this); + /** Global router state */ globals: UIRouterGlobals = new Globals(this.transitionService); + /** + * Deprecated for public use. Use [[urlService]] instead. + * @deprecated + */ urlMatcherFactory: UrlMatcherFactory = new UrlMatcherFactory(); + /** + * Deprecated for public use. Use [[urlService]] instead. + * @deprecated + */ urlRouter: UrlRouter = new UrlRouter(this); + /** Provides a registry for states, and related registration services */ stateRegistry: StateRegistry = new StateRegistry(this); + /** Provides services related to states */ stateService = new StateService(this); + /** Provides services related to the URL */ urlService: UrlService = new UrlService(this); + /** @hidden */ private _disposables: Disposable[] = []; /** Registers an object to be notified when the router is disposed */ @@ -80,6 +99,13 @@ export class UIRouter { }); } + /** + * Creates a new `UIRouter` object + * + * @param locationService a [[LocationServices]] implementation + * @param locationConfig a [[LocationConfig]] implementation + * @internalapi + */ constructor( public locationService: LocationServices = UrlService.locationServiceStub, public locationConfig: LocationConfig = UrlService.locationConfigStub @@ -99,6 +125,12 @@ export class UIRouter { /** @hidden */ private _plugins: { [key: string]: UIRouterPlugin } = {}; + /** Add plugin (as ES6 class) */ + plugin(plugin: { new(router: UIRouter, options?: any): T }, options?: any): T; + /** Add plugin (as javascript constructor function) */ + plugin(plugin: { (router: UIRouter, options?: any): void }, options?: any): T; + /** Add plugin (as javascript factory function) */ + plugin(plugin: PluginFactory, options?: any): T; /** * Adds a plugin to UI-Router * @@ -152,12 +184,6 @@ export class UIRouter { * @param options options to pass to the plugin class/factory * @returns the registered plugin instance */ - plugin(plugin: { new(router: UIRouter, options?: any): T }, options?: any): T; - /** Allow javascript constructor function */ - plugin(plugin: { (router: UIRouter, options?: any): void }, options?: any): T; - /** Allow javascript factory function */ - plugin(plugin: PluginFactory, options?: any): T; - /** Allow javascript factory function */ plugin(plugin: any, options: any = {}): T { let pluginInstance = new plugin(this, options); if (!pluginInstance.name) throw new Error("Required property `name` missing on plugin: " + pluginInstance); @@ -181,4 +207,5 @@ export class UIRouter { } } +/** @internalapi */ export type PluginFactory = (router: UIRouter, options?: any) => T; diff --git a/src/state/index.ts b/src/state/index.ts index 72d584e1..a02cb7ec 100644 --- a/src/state/index.ts +++ b/src/state/index.ts @@ -1,5 +1,5 @@ /** - * The state subsystem + * # The state subsystem * * This subsystem implements the ui-router state tree * diff --git a/src/state/interface.ts b/src/state/interface.ts index 431616d4..48ea8b78 100644 --- a/src/state/interface.ts +++ b/src/state/interface.ts @@ -27,10 +27,10 @@ export interface TargetStateDef { export type ResolveTypes = Resolvable | ResolvableLiteral | ProviderLike; /** - * Base interface for [[Ng1ViewDeclaration]] and [[Ng2ViewDeclaration]] + * Base interface for declaring a view * * This interface defines the basic data that a normalized view declaration will have on it. - * Framework-specific implementations may add additional fields (to their interfaces which extend this interface). + * Framework-specific implementations should add additional fields (to their interfaces which extend this interface). * * @internalapi */ @@ -107,22 +107,21 @@ export type RedirectToResult = string | TargetState | { state?: string, params?: */ export interface StateDeclaration { /** - * The state name + * The state name (required) * * A unique state name, e.g. `"home"`, `"about"`, `"contacts"`. * To create a parent/child state use a dot, e.g. `"about.sales"`, `"home.newest"`. * - * - * Note: States require unique names. If you omit this property, you must provide - * the state name when you register it with the [[$stateProvider]]. + * Note: [State] objects require unique names. + * The name is used like an id. */ name?: string; /** - * abstract state indicator + * Abstract state indicator * - * An abstract state can never be directly activated. Use an abstract state to provide inherited - * properties (url, resolve, data, etc) to children states. + * An abstract state can never be directly activated. + * Use an abstract state to provide inherited properties (url, resolve, data, etc) to children states. */ abstract?: boolean; @@ -131,8 +130,9 @@ export interface StateDeclaration { * * Normally, a state's parent is implied from the state's [[name]], e.g., `"parentstate.childstate"`. * - * Alternatively, you can explicitly set the parent state using this property. This allows shorter state - * names, e.g., `Child` instead of `Child + * Alternatively, you can explicitly set the parent state using this property. + * This allows shorter state names, e.g., `Child` + * instead of `Child * * When using this property, the state's name should not have any dots in it. * @@ -152,7 +152,7 @@ export interface StateDeclaration { parent?: (string|StateDeclaration); /** - * Gets the internal API + * Gets the internal State object API * * Gets the *internal API* for a registered state. * @@ -408,7 +408,7 @@ export interface StateDeclaration { * - If the property is a function: * - The function is called with two parameters: * - The current [[Transition]] - * - An injector which can be used to get dependencies using [[UIRInjector.get]] + * - An [[UIInjector]] which can be used to get dependencies using [[UIInjector.get]] or resolves using [[UIInjector.getAsync]] * - The return value is processed using the previously mentioned rules. * - If the return value is a promise, the promise is waited for, then the resolved async value is processed using the same rules. * diff --git a/src/state/stateObject.ts b/src/state/stateObject.ts index c8042be7..8f1a1c8b 100644 --- a/src/state/stateObject.ts +++ b/src/state/stateObject.ts @@ -30,22 +30,22 @@ export class State { /** The name used to register the state */ public name: string; - /** Prototypally inherits from [[StateDefinition.abstract]] */ + /** Prototypally inherits from [[StateDeclaration.abstract]] */ public abstract: boolean; - /** Prototypally inherits from [[StateDefinition.resolve]] */ + /** Prototypally inherits from [[StateDeclaration.resolve]] */ public resolve: ({ [key: string]: (string|any[]|Function) }|any[]); /** A list of [[Resolvable]] objects. The internal representation of [[resolve]]. */ public resolvables: Resolvable[]; - /** Prototypally inherits from [[StateDefinition.resolvePolicy]] */ + /** Prototypally inherits from [[StateDeclaration.resolvePolicy]] */ public resolvePolicy: any; /** A compiled URLMatcher which detects when the state's URL is matched */ public url: UrlMatcher; - /** The parameters for the state, built from the URL and [[StateDefinition.params]] */ + /** The parameters for the state, built from the URL and [[StateDeclaration.params]] */ public params: { [key: string]: Param }; /** @@ -68,7 +68,7 @@ export class State { public path: State[]; /** - * Prototypally inherits from [[StateDefinition.data]] + * Prototypally inherits from [[StateDeclaration.data]] * Note: This is the only field on the [[StateDeclaration]] which is mutated. * The definition object's `data` field is replaced with a new object * which prototypally inherits from the parent state definition's `data` field. @@ -78,17 +78,17 @@ export class State { /** An array of strings of the parent States' names */ public includes: { [name: string] : boolean }; - /** Prototypally inherits from [[StateDefinition.onExit]] */ + /** Prototypally inherits from [[StateDeclaration.onExit]] */ public onExit: TransitionStateHookFn; - /** Prototypally inherits from [[StateDefinition.onRetain]] */ + /** Prototypally inherits from [[StateDeclaration.onRetain]] */ public onRetain: TransitionStateHookFn; - /** Prototypally inherits from [[StateDefinition.onEnter]] */ + /** Prototypally inherits from [[StateDeclaration.onEnter]] */ public onEnter: TransitionStateHookFn; - /** Prototypally inherits from [[StateDefinition.lazyLoad]] */ + /** Prototypally inherits from [[StateDeclaration.lazyLoad]] */ public lazyLoad: (transition: Transition) => Promise; - /** Prototypally inherits from [[StateDefinition.redirectTo]] */ + /** Prototypally inherits from [[StateDeclaration.redirectTo]] */ redirectTo: ( string | (($transition$: Transition) => TargetState) | diff --git a/src/state/stateRegistry.ts b/src/state/stateRegistry.ts index e247a5cb..b42278e9 100644 --- a/src/state/stateRegistry.ts +++ b/src/state/stateRegistry.ts @@ -15,7 +15,7 @@ import { UIRouter } from "../router"; import { propEq } from "../common/hof"; /** - * The signature for the callback function provided to [[StateRegistry.onStateRegistryEvent]]. + * The signature for the callback function provided to [[StateRegistry.onStatesChanged]]. * * This callback receives two parameters: * @@ -121,7 +121,6 @@ export class StateRegistry { * Registers a [[StateDeclaration]] or queues it for registration. * * Note: a state will be queued if the state's parent isn't yet registered. - * It will also be queued if the queue is not yet in [[StateQueueManager.autoFlush]] mode. * * @param stateDefinition the definition of the state to register. * @returns the internal [[State]] object. diff --git a/src/transition/hookRegistry.ts b/src/transition/hookRegistry.ts index e220bbbb..ef4c359d 100644 --- a/src/transition/hookRegistry.ts +++ b/src/transition/hookRegistry.ts @@ -51,7 +51,7 @@ export function matchState(state: State, criterion: HookMatchCriterion) { } /** - * @hidden + * @internalapi * The registration data for a registered transition hook */ export class RegisteredHook { @@ -70,11 +70,13 @@ export class RegisteredHook { } /** - * Given an array of PathNodes, and a HookMatchCriteria, returns an array containing - * the PathNodes that the criteria matches, or null if there were no matching nodes. + * Gets the matching [[PathNode]]s + * + * Given an array of [[PathNode]]s, and a [[HookMatchCriterion]], returns an array containing + * the [[PathNode]]s that the criteria matches, or `null` if there were no matching nodes. * - * Returning null is significant to distinguish between the default - * "match-all criterion value" of `true` compared to a () => true, + * Returning `null` is significant to distinguish between the default + * "match-all criterion value" of `true` compared to a `() => true` function, * when the nodes is an empty array. * * This is useful to allow a transition match criteria of `entering: true` @@ -89,17 +91,29 @@ export class RegisteredHook { } /** + * Gets the default match criteria (all `true`) + * * Returns an object which has all the criteria match paths as keys and `true` as values, i.e.: * - * { to: true, from: true, entering: true, exiting: true, retained: true } + * ```js + * { + * to: true, + * from: true, + * entering: true, + * exiting: true, + * retained: true, + * } */ private _getDefaultMatchCriteria(): HookMatchCriteria { return map(this.tranSvc._pluginapi._getPathTypes(), () => true); } /** - * Create a IMatchingNodes object from the TransitionHookTypes that basically looks like this: + * Gets matching nodes as [[IMatchingNodes]] + * + * Create a IMatchingNodes object from the TransitionHookTypes that is roughly equivalent to: * + * ```js * let matches: IMatchingNodes = { * to: _matchingNodes([tail(treeChanges.to)], mc.to), * from: _matchingNodes([tail(treeChanges.from)], mc.from), @@ -107,6 +121,7 @@ export class RegisteredHook { * retained: _matchingNodes(treeChanges.retained, mc.retained), * entering: _matchingNodes(treeChanges.entering, mc.entering), * }; + * ``` */ private _getMatchingNodes(treeChanges: TreeChanges): IMatchingNodes { let criteria = extend(this._getDefaultMatchCriteria(), this.matchCriteria); diff --git a/src/transition/index.ts b/src/transition/index.ts index cb868427..9f4dcce5 100644 --- a/src/transition/index.ts +++ b/src/transition/index.ts @@ -1,4 +1,6 @@ /** + * # Transition subsystem + * * This module contains APIs related to a Transition. * * See: diff --git a/src/transition/interface.ts b/src/transition/interface.ts index 45a4e758..dfbaed1e 100644 --- a/src/transition/interface.ts +++ b/src/transition/interface.ts @@ -14,8 +14,8 @@ import {RegisteredHook} from "./hookRegistry"; /** * The TransitionOptions object can be used to change the behavior of a transition. * - * It is passed as the third argument to [[$state.go]], [[$state.transitionTo]], and - * can be used with the [[ui-sref-opts]] directive. + * It is passed as the third argument to [[StateService.go]], [[StateService.transitionTo]]. + * It can also be used with a `uiSref`. */ export interface TransitionOptions { /** diff --git a/src/transition/transition.ts b/src/transition/transition.ts index 5c6d8ed0..7dfc2724 100644 --- a/src/transition/transition.ts +++ b/src/transition/transition.ts @@ -74,7 +74,7 @@ export class Transition implements IHookRegistry { * This promise is resolved or rejected based on the outcome of the Transition. * * When the transition is successful, the promise is resolved - * When the transition is unsuccessful, the promise is rejected with the [[TransitionRejection]] or javascript error + * When the transition is unsuccessful, the promise is rejected with the [[Rejection]] or javascript error */ promise: Promise = this._deferred.promise; /** diff --git a/src/transition/transitionService.ts b/src/transition/transitionService.ts index e7169bd7..a1099d04 100644 --- a/src/transition/transitionService.ts +++ b/src/transition/transitionService.ts @@ -45,9 +45,33 @@ export let defaultTransOpts: TransitionOptions = { }; +/** + * Plugin API for Transition Service + * @internalapi + */ export interface TransitionServicePluginAPI { + /** + * Adds a Path to be used as a criterion against a TreeChanges path + * + * For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path. + * It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)` + * Each state in the exiting path is checked against the criteria and returned as part of the match. + * + * Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path. + * It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)` + * Only the tail of the `to` path is checked against the criteria and returned as part of the match. + */ _definePathType(name: string, hookScope: TransitionHookScope); + + /** + * Gets a Path definition used as a criterion against a TreeChanges path + */ _getPathTypes(): PathTypes; + + /** + * Defines a transition hook type and returns a transition hook registration + * function (which can then be used to register hooks of this type). + */ _defineEvent(name: string, hookPhase: TransitionHookPhase, hookOrder: number, @@ -56,7 +80,14 @@ export interface TransitionServicePluginAPI { getResultHandler?: GetResultHandler, getErrorHandler?: GetErrorHandler, rejectIfSuperseded?: boolean); + + /** + * Returns the known event types, such as `onBefore` + * If a phase argument is provided, returns only events for the given phase. + */ _getEvents(phase?: TransitionHookPhase): TransitionEventType[]; + + /** Returns the hooks registered for the given hook name */ getHooks(hookName: string): RegisteredHook[]; } @@ -123,6 +154,8 @@ export class TransitionService implements IHookRegistry, Disposable { _registeredHooks = { } as RegisteredHooks; /** @hidden The paths on a criteria object */ private _criteriaPaths = { } as PathTypes; + /** @hidden */ + private _router: UIRouter; /** @internalapi */ _pluginapi: TransitionServicePluginAPI; @@ -147,7 +180,8 @@ export class TransitionService implements IHookRegistry, Disposable { }; /** @hidden */ - constructor(private _router: UIRouter) { + constructor(_router: UIRouter) { + this._router = _router; this.$view = _router.viewService; this._deregisterHookFns = {}; this._pluginapi = createProxyFunctions(val(this), {}, val(this), [ @@ -164,7 +198,10 @@ export class TransitionService implements IHookRegistry, Disposable { this._registerDefaultTransitionHooks(); } - /** @internalapi */ + /** + * dispose + * @internalapi + */ dispose(router: UIRouter) { delete router.globals.transition; @@ -219,11 +256,7 @@ export class TransitionService implements IHookRegistry, Disposable { this._definePathType("entering", STATE); } - /** - * Defines a transition hook type and returns a transition hook registration - * function (which can then be used to register hooks of this type). - * @internalapi - */ + /** @hidden */ _defineEvent(name: string, hookPhase: TransitionHookPhase, hookOrder: number, @@ -239,11 +272,7 @@ export class TransitionService implements IHookRegistry, Disposable { makeEvent(this, this, eventType); }; - /** - * @hidden - * Returns the known event types, such as `onBefore` - * If a phase argument is provided, returns only events for the given phase. - */ + /** @hidden */ private _getEvents(phase?: TransitionHookPhase): TransitionEventType[] { let transitionHookTypes = isDefined(phase) ? this._eventTypes.filter(type => type.hookPhase === phase) : @@ -266,17 +295,13 @@ export class TransitionService implements IHookRegistry, Disposable { * It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)` * Only the tail of the `to` path is checked against the criteria and returned as part of the match. * - * @internalapi + * @hidden */ private _definePathType(name: string, hookScope: TransitionHookScope) { this._criteriaPaths[name] = { name, scope: hookScope }; } - /** - * Gets a Path definition used as a criterion against a TreeChanges path - * - * @internalapi - */ + /** * @hidden */ private _getPathTypes(): PathTypes { return this._criteriaPaths; } diff --git a/src/url/interface.ts b/src/url/interface.ts index 007ea163..def4516b 100644 --- a/src/url/interface.ts +++ b/src/url/interface.ts @@ -1,4 +1,6 @@ /** + * # URL subsystem + * * Contains code related to managing the URL * * The primary API is found in [[UrlService]], [[UrlService.config]], and [[UrlService.rules]]. @@ -221,7 +223,7 @@ export interface UrlRulesApi { * The `$id` is is the order in which the rule was registered. * * The sort function should use these data, or data found on a specific type - * of [[UrlRule]] (such as [[StateUrlRule.state]]), to order the rules as desired. + * of [[UrlRule]] (such as [[StateRule.state]]), to order the rules as desired. * * #### Example: * This compare function prioritizes rules by the order in which the rules were registered. @@ -349,7 +351,7 @@ export interface UrlRulesApi { * Manually adds a URL Rule. * * Usually, a url rule is added using [[StateDeclaration.url]] or [[when]]. - * This api can be used directly for more control (to register [[RawUrlRule]], for example). + * This api can be used directly for more control (to register [[BaseUrlRule]], for example). * Rules can be created using [[UrlRouter.urlRuleFactory]], or create manually as simple objects. * * @return a function that deregisters the rule diff --git a/src/url/urlRouter.ts b/src/url/urlRouter.ts index 2e761ebd..73fa467e 100644 --- a/src/url/urlRouter.ts +++ b/src/url/urlRouter.ts @@ -33,7 +33,7 @@ const getMatcher = prop("urlMatcher"); * * Sorts rules by: * - * - Explicit priority (set rule priority using [[UrlService.when]]) + * - Explicit priority (set rule priority using [[UrlRulesApi.when]]) * - Rule type (STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1) * - `UrlMatcher` specificity ([[UrlMatcher.compare]]): works for STATE and URLMATCHER types to pick the most specific rule. * - Registration order (for rule types other than STATE and URLMATCHER) @@ -230,8 +230,8 @@ export class UrlRouter implements UrlRulesApi, UrlSyncApi, Disposable { * Manually adds a URL Rule. * * Usually, a url rule is added using [[StateDeclaration.url]] or [[when]]. - * This api can be used directly for more control (to register [[RawUrlRule]], for example). - * Rules can be created using [[UrlRouter.ruleFactory]], or create manually as simple objects. + * This api can be used directly for more control (to register a [[BaseUrlRule]], for example). + * Rules can be created using [[UrlRouter.urlRuleFactory]], or create manually as simple objects. * * A rule should have a `match` function which returns truthy if the rule matched. * It should also have a `handler` function which is invoked if the rule is the best match. diff --git a/src/view/interface.ts b/src/view/interface.ts index 2b7170fe..1c79f875 100644 --- a/src/view/interface.ts +++ b/src/view/interface.ts @@ -10,7 +10,7 @@ export interface ViewContext { parent: ViewContext; } -/** @hidden */ +/** @internalapi */ export interface ActiveUIView { /** type of framework, e.g., "ng1" or "ng2" */ $type: string; @@ -29,11 +29,11 @@ export interface ActiveUIView { } /** - * This interface represents a [[ViewDeclaration]] that is bound to a [[PathNode]]. + * This interface represents a [[_ViewDeclaration]] that is bound to a [[PathNode]]. * * A `ViewConfig` is the runtime definition of a single view. * - * During a transition, `ViewConfig`s are created for each [[ViewDeclaration]] defined on each "entering" [[State]]. + * During a transition, `ViewConfig`s are created for each [[_ViewDeclaration]] defined on each "entering" [[State]]. * Then, the [[ViewService]] finds any matching `ui-view`(s) in the DOM, and supplies the ui-view * with the `ViewConfig`. The `ui-view` then loads itself using the information found in the `ViewConfig`. * diff --git a/src/view/view.ts b/src/view/view.ts index bc0eb361..12710009 100644 --- a/src/view/view.ts +++ b/src/view/view.ts @@ -32,8 +32,8 @@ export interface ViewServicePluginAPI { * * - As `ui-view` components pop in and out of existence, they register themselves using [[registerUIView]]. * - * - When the [[sync]] function is called, the registered `ui-view`(s) ([[UIViewConfig]] - * are configured with the matching `ViewConfig`(s) ([[ActiveUIView]]). + * - When the [[sync]] function is called, the registered `ui-view`(s) ([[ActiveUIView]]) + * are configured with the matching [[ViewConfig]](s) * */ export class ViewService {