From f144e8b02664ee0c5c7b188fd943f5680e6b649b Mon Sep 17 00:00:00 2001 From: Chris Thielen Date: Sat, 11 Aug 2018 13:41:54 -0700 Subject: [PATCH] docs(*): make module headers more consistent --- src/angular.ts | 12 ++++-------- src/directives/stateDirectives.ts | 6 ++---- src/directives/viewDirective.ts | 6 +----- src/index.ts | 3 +-- src/injectables.ts | 4 +--- src/interface.ts | 5 +---- src/legacy/resolveService.ts | 2 +- src/legacy/stateEvents.ts | 2 +- src/locationServices.ts | 6 ++---- src/services.ts | 6 ++---- src/stateFilters.ts | 2 +- src/stateProvider.ts | 2 +- src/statebuilders/onEnterExitRetain.ts | 4 +++- src/statebuilders/views.ts | 9 ++++++++- src/templateFactory.ts | 3 +-- src/urlRouterProvider.ts | 3 ++- src/viewScroll.ts | 2 +- typedoc.json | 4 ++-- 18 files changed, 35 insertions(+), 46 deletions(-) diff --git a/src/angular.ts b/src/angular.ts index 8eb861183..778930ee8 100644 --- a/src/angular.ts +++ b/src/angular.ts @@ -1,9 +1,5 @@ -/** - * @hidden - * @module ng1 - */ /** */ -declare var angular; +/** @publicapi @module ng1 */ /** */ import * as ng_from_import from 'angular'; -const ng_from_global = angular; - -export const ng = ng_from_import && ng_from_import.module ? ng_from_import : ng_from_global; +/** @hidden */ declare var angular; +/** @hidden */ const ng_from_global = angular; +/** @hidden */ export const ng = ng_from_import && ng_from_import.module ? ng_from_import : ng_from_global; diff --git a/src/directives/stateDirectives.ts b/src/directives/stateDirectives.ts index eba214627..3be9365db 100644 --- a/src/directives/stateDirectives.ts +++ b/src/directives/stateDirectives.ts @@ -4,10 +4,8 @@ * These are the directives included in UI-Router for Angular 1. * These directives are used in templates to create viewports and link/navigate to states. * - * @ng1api - * @preferred - * @module directives - */ /** for typedoc */ + * @preferred @publicapi @module directives + */ /** */ import { ng as angular } from '../angular'; import { IAugmentedJQuery, ITimeoutService, IScope, IInterpolateService } from 'angular'; diff --git a/src/directives/viewDirective.ts b/src/directives/viewDirective.ts index c9c0cf84b..54286eb5b 100644 --- a/src/directives/viewDirective.ts +++ b/src/directives/viewDirective.ts @@ -1,8 +1,4 @@ -/** - * @ng1api - * @module directives - */ - +/** @publicapi @module directives */ /** */ import { $QLike, ActiveUIView, diff --git a/src/index.ts b/src/index.ts index e4b276d71..b9b1b66e1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,7 @@ /** * Main entry point for angular 1.x build - * @module ng1 + * @publicapi @module ng1 */ /** */ - export * from './interface'; export * from './services'; export * from './statebuilders/views'; diff --git a/src/injectables.ts b/src/injectables.ts index e7946cad8..8c0fe602f 100644 --- a/src/injectables.ts +++ b/src/injectables.ts @@ -46,9 +46,7 @@ * - [[$stateParams]]: State param values for pending Transition (deprecated) * - Any resolve data defined using [[Ng1StateDeclaration.resolve]] * - * @ng1api - * @preferred - * @module injectables + * @preferred @publicapi @module injectables */ /** */ /* tslint:disable:prefer-const */ import { StateProvider } from './stateProvider'; diff --git a/src/interface.ts b/src/interface.ts index 4ae8356a8..a6a8ec381 100644 --- a/src/interface.ts +++ b/src/interface.ts @@ -1,7 +1,4 @@ -/** - * @ng1api - * @module ng1 - */ /** */ +/** @publicapi @module ng1 */ /** */ import { StateDeclaration, _ViewDeclaration, IInjectable, Transition, HookResult } from '@uirouter/core'; /** diff --git a/src/legacy/resolveService.ts b/src/legacy/resolveService.ts index d22361ef7..57956fe07 100644 --- a/src/legacy/resolveService.ts +++ b/src/legacy/resolveService.ts @@ -1,4 +1,4 @@ -/** @module ng1 */ /** */ +/** @publicapi @module ng1 */ /** */ import { StateObject, PathNode, ResolveContext, Obj, mapObj, resolvablesBuilder } from '@uirouter/core'; import * as angular from 'angular'; diff --git a/src/legacy/stateEvents.ts b/src/legacy/stateEvents.ts index 5804dc360..2f1fd71a0 100644 --- a/src/legacy/stateEvents.ts +++ b/src/legacy/stateEvents.ts @@ -16,7 +16,7 @@ * angular.module("myApplication", ['ui.router', 'ui.router.state.events'] * ``` * - * @module ng1_state_events + * @publicapi @module ng1_state_events */ /** */ import { ng as angular } from '../angular'; import { IScope, IAngularEvent, IServiceProviderFactory } from 'angular'; diff --git a/src/locationServices.ts b/src/locationServices.ts index 2da9247ed..98870d727 100644 --- a/src/locationServices.ts +++ b/src/locationServices.ts @@ -1,13 +1,11 @@ -/** - * @internalapi - * @module ng1 - */ /** */ +/** @publicapi @module ng1 */ /** */ import { LocationConfig, LocationServices, UIRouter, ParamType, isDefined } from '@uirouter/core'; import { val, createProxyFunctions, removeFrom, isObject } from '@uirouter/core'; import { ILocationService, ILocationProvider, IWindowService } from 'angular'; /** * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service + * @internalapi */ export class Ng1LocationServices implements LocationConfig, LocationServices { private $locationProvider: ILocationProvider; diff --git a/src/services.ts b/src/services.ts index 8a7da2446..0294f3e4c 100644 --- a/src/services.ts +++ b/src/services.ts @@ -6,10 +6,8 @@ * * The optional [[$resolve]] service is also documented here. * - * @module ng1 - * @preferred - */ -/** for typedoc */ + * @preferred @publicapi @module ng1 + */ /** */ import { ng as angular } from './angular'; import { IRootScopeService, diff --git a/src/stateFilters.ts b/src/stateFilters.ts index dacd14a66..d6ca23655 100644 --- a/src/stateFilters.ts +++ b/src/stateFilters.ts @@ -1,4 +1,4 @@ -/** @module ng1 */ /** for typedoc */ +/** @publicapi @module ng1 */ /** */ import { ng as angular } from './angular'; import { Obj, StateService, StateOrName } from '@uirouter/core'; diff --git a/src/stateProvider.ts b/src/stateProvider.ts index f07f00017..3e625c4f4 100644 --- a/src/stateProvider.ts +++ b/src/stateProvider.ts @@ -1,4 +1,4 @@ -/** @module ng1 */ /** for typedoc */ +/** @publicapi @module ng1 */ /** */ import { val, isObject, diff --git a/src/statebuilders/onEnterExitRetain.ts b/src/statebuilders/onEnterExitRetain.ts index 85253b2a4..e3b89c373 100644 --- a/src/statebuilders/onEnterExitRetain.ts +++ b/src/statebuilders/onEnterExitRetain.ts @@ -1,4 +1,4 @@ -/** @module ng1 */ /** */ +/** @publicapi @module ng1 */ /** */ import { StateObject, TransitionStateHookFn, @@ -18,6 +18,8 @@ import { Ng1StateDeclaration } from '../interface'; * * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder * ensures that those hooks are injectable for @uirouter/angularjs (ng1). + * + * @internalapi */ export const getStateHookBuilder = (hookName: 'onEnter' | 'onExit' | 'onRetain') => function stateHookBuilder(stateObject: StateObject, parentFn: BuilderFunction): TransitionStateHookFn { diff --git a/src/statebuilders/views.ts b/src/statebuilders/views.ts index 85eda5b8a..cad420c33 100644 --- a/src/statebuilders/views.ts +++ b/src/statebuilders/views.ts @@ -1,4 +1,4 @@ -/** @module ng1 */ /** */ +/** @publicapi @module ng1 */ /** */ import { ng as angular } from '../angular'; import { StateObject, @@ -24,6 +24,7 @@ import { Ng1ViewDeclaration } from '../interface'; import { TemplateFactory } from '../templateFactory'; import IInjectorService = angular.auto.IInjectorService; +/** @internalapi */ export function getNg1ViewConfigFactory(): ViewConfigFactory { let templateFactory: TemplateFactory = null; return (path, view) => { @@ -32,6 +33,7 @@ export function getNg1ViewConfigFactory(): ViewConfigFactory { }; } +/** @internalapi */ const hasAnyKey = (keys, obj) => keys.reduce((acc, key) => acc || isDefined(obj[key]), false); /** @@ -42,6 +44,8 @@ const hasAnyKey = (keys, obj) => keys.reduce((acc, key) => acc || isDefined(obj[ * * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object * and applies the state-level configuration to a view named `$default`. + * + * @internalapi */ export function ng1ViewsBuilder(state: StateObject) { // Do not process root state @@ -98,7 +102,10 @@ export function ng1ViewsBuilder(state: StateObject) { return views; } +/** @hidden */ let id = 0; + +/** @internalapi */ export class Ng1ViewConfig implements ViewConfig { $id = id++; loaded = false; diff --git a/src/templateFactory.ts b/src/templateFactory.ts index 3ad945348..6343acf16 100644 --- a/src/templateFactory.ts +++ b/src/templateFactory.ts @@ -1,5 +1,4 @@ -/** @module view */ -/** for typedoc */ +/** @publicapi @module view */ /** */ import { ng as angular } from './angular'; import { IAugmentedJQuery } from 'angular'; import { diff --git a/src/urlRouterProvider.ts b/src/urlRouterProvider.ts index d497a4556..d1ed6523e 100644 --- a/src/urlRouterProvider.ts +++ b/src/urlRouterProvider.ts @@ -1,4 +1,4 @@ -/** @module url */ /** */ +/** @publicapi @module url */ /** */ import { UIRouter, LocationServices, @@ -27,6 +27,7 @@ export interface RawNg1RuleFunction { * * This provider remains for backwards compatibility. * + * @internalapi * @deprecated */ export class UrlRouterProvider { diff --git a/src/viewScroll.ts b/src/viewScroll.ts index 21baade05..f69601b26 100644 --- a/src/viewScroll.ts +++ b/src/viewScroll.ts @@ -1,4 +1,4 @@ -/** @module ng1 */ /** */ +/** @publicapi @module ng1 */ /** */ import { ng as angular } from './angular'; import { IServiceProviderFactory } from 'angular'; import IAnchorScrollService = angular.IAnchorScrollService; diff --git a/typedoc.json b/typedoc.json index 0de7e7454..6306c3a73 100644 --- a/typedoc.json +++ b/typedoc.json @@ -25,8 +25,8 @@ "name": "@uirouter/angularjs", "theme": "node_modules/ui-router-typedoc-themes/bin/default", "out": "_doc", - "internal-aliases": "internal,coreapi,ng1api", - "external-aliases": "internalapi,external", + "internal-aliases": "internal,publicapi,publicapi", + "external-aliases": "external,internalapi", "navigation-label-globals": "@uirouter/angularjs" } }