Skip to content

Commit

Permalink
chore: update @param tsdoc comments to use the official format
Browse files Browse the repository at this point in the history
Normalize `@param name description` to be `@param name - description`
See microsoft/tsdoc#128
  • Loading branch information
raymondfeng committed May 21, 2019
1 parent f1da3fe commit d1646d0
Show file tree
Hide file tree
Showing 121 changed files with 909 additions and 909 deletions.
10 changes: 5 additions & 5 deletions docs/site/Context.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,9 @@ To make it easy to support asynchronous event processing, we introduce
```ts
/**
* Listen on `bind`, `unbind`, or other events
* @param eventType Context event type
* @param binding The binding as event source
* @param context Context object for the binding event
* @param eventType - Context event type
* @param binding - The binding as event source
* @param context - Context object for the binding event
*/
export type ContextObserverFn = (
eventType: ContextEventType,
Expand All @@ -322,8 +322,8 @@ export interface ContextObserver {

/**
* Listen on `bind`, `unbind`, or other events
* @param eventType Context event type
* @param binding The binding as event source
* @param eventType - Context event type
* @param binding - The binding as event source
*/
observe: ContextObserverFn;
}
Expand Down
4 changes: 2 additions & 2 deletions docs/site/Extending-request-body-parsing.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ export interface BodyParser {
name: string | symbol;
/**
* Indicate if the given media type is supported
* @param mediaType Media type
* @param mediaType - Media type
*/
supports(mediaType: string): boolean;
/**
* Parse the request body
* @param request http request
* @param request - http request
*/
parse(request: Request): Promise<RequestBody>;
}
Expand Down
12 changes: 6 additions & 6 deletions docs/site/Interceptors.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ parameters:
*/
export interface Interceptor {
/**
* @param context Invocation context
* @param next A function to invoke next interceptor or the target method
* @param context - Invocation context
* @param next - A function to invoke next interceptor or the target method
* @returns A result as value or promise
*/
(
Expand Down Expand Up @@ -513,11 +513,11 @@ bindings. It extends `Context` with additional properties as follows:
export class InvocationContext extends Context {
/**
* Construct a new instance
* @param parent Parent context, such as the RequestContext
* @param target Target class (for static methods) or prototype/object
* @param parent - Parent context, such as the RequestContext
* @param target - Target class (for static methods) or prototype/object
* (for instance methods)
* @param methodName Method name
* @param args An array of arguments
* @param methodName - Method name
* @param args - An array of arguments
*/
constructor(
parent: Context,
Expand Down
4 changes: 2 additions & 2 deletions docs/site/Routing-requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ below:
export interface RestRouter {
/**
* Add a route to the router
* @param route A route entry
* @param route - A route entry
*/
add(route: RouteEntry): boolean;

/**
* Find a matching route for the given http request
* @param request Http request
* @param request - Http request
* @returns The resolved route, if not found, `undefined` is returned
*/
find(request: Request): ResolvedRoute | undefined;
Expand Down
4 changes: 2 additions & 2 deletions docs/site/Sequence.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export class CustomSendProvider implements Provider<Send> {
/**
* Use the mimeType given in the request's Accept header to convert
* the response object!
* @param response The response object used to reply to the client.
* @param result The result of the operation carried out by the controller's
* @param response - The response object used to reply to the client.
* @param result - The result of the operation carried out by the controller's
* handling function.
*/
action(response: Response, result: OperationRetval) {
Expand Down
6 changes: 3 additions & 3 deletions examples/greeter-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class GreetingService {
// ...
/**
* Find a greeter that can speak the given language
* @param language Language code for the greeting
* @param language - Language code for the greeting
*/
async findGreeter(language: string): Promise<Greeter | undefined> {
// Get the latest list of greeters
Expand All @@ -137,8 +137,8 @@ export class GreetingService {

/**
* Greet in the given language
* @param language Language code
* @param name Name
* @param language - Language code
* @param name - Name
*/
async greet(language: string, name: string): Promise<string> {
let greeting: string = '';
Expand Down
6 changes: 3 additions & 3 deletions examples/greeter-extension/src/greeting-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class GreetingService {

/**
* Find a greeter that can speak the given language
* @param language Language code for the greeting
* @param language - Language code for the greeting
*/
async findGreeter(language: string): Promise<Greeter | undefined> {
// Get the latest list of greeters
Expand All @@ -49,8 +49,8 @@ export class GreetingService {

/**
* Greet in the given language
* @param language Language code
* @param name Name
* @param language - Language code
* @param name - Name
*/
async greet(language: string, name: string): Promise<string> {
let greeting: string = '';
Expand Down
6 changes: 3 additions & 3 deletions examples/log-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ import {LevelMetadata} from '../types';
* if it is set at or greater than Application LogLevel.
* LOG_LEVEL.DEBUG < LOG_LEVEL.INFO < LOG_LEVEL.WARN < LOG_LEVEL.ERROR < LOG_LEVEL.OFF
*
* @param level The Log Level at or above it should log
* @param level - The Log Level at or above it should log
*/
export function log(level?: number) {
if (level === undefined) level = LOG_LEVEL.WARN;
Expand All @@ -200,8 +200,8 @@ export function log(level?: number) {
/**
* Fetch log level stored by `@log` decorator.
*
* @param controllerClass Target controller
* @param methodName Target method
* @param controllerClass - Target controller
* @param methodName - Target method
*/
export function getLogMetadata(
controllerClass: Constructor<{}>,
Expand Down
6 changes: 3 additions & 3 deletions examples/log-extension/src/decorators/log.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {LevelMetadata} from '../types';
* if it is set at or greater than Application LogLevel.
* LOG_LEVEL.DEBUG < LOG_LEVEL.INFO < LOG_LEVEL.WARN < LOG_LEVEL.ERROR < LOG_LEVEL.OFF
*
* @param level The Log Level at or above it should log
* @param level - The Log Level at or above it should log
*/
export function log(level?: number) {
if (level === undefined) level = LOG_LEVEL.WARN;
Expand All @@ -31,8 +31,8 @@ export function log(level?: number) {
/**
* Fetch log level stored by `@log` decorator.
*
* @param controllerClass Target controller
* @param methodName Target method
* @param controllerClass - Target controller
* @param methodName - Target method
*/
export function getLogMetadata(
controllerClass: Constructor<{}>,
Expand Down
2 changes: 1 addition & 1 deletion examples/log-extension/src/mixins/log.mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function LogMixin<T extends Constructor<any>>(superClass: T) {
/**
* Set minimum logLevel to be displayed.
*
* @param level The log level to set for @log decorator
* @param level - The log level to set for @log decorator
*
* @example
* ```ts
Expand Down
6 changes: 3 additions & 3 deletions examples/todo-list/src/__tests__/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {Todo, TodoList, TodoListImage} from '../models';

/**
* Generate a complete Todo object for use with tests.
* @param todo A partial (or complete) Todo object.
* @param todo - A partial (or complete) Todo object.
*/
export function givenTodo(todo?: Partial<Todo>) {
const data = Object.assign(
Expand All @@ -44,7 +44,7 @@ export function givenTodo(todo?: Partial<Todo>) {

/**
* Generate a complete TodoList object for use with tests
* @param todoList A partial (or complete) TodoList object.
* @param todoList - A partial (or complete) TodoList object.
*/
export function givenTodoList(todoList?: Partial<TodoList>) {
const data = Object.assign(
Expand All @@ -58,7 +58,7 @@ export function givenTodoList(todoList?: Partial<TodoList>) {

/**
* Generate a complete TodoListImage object for use with tests.
* @param todoListImage A partial (or complete) TodoListImage object.
* @param todoListImage - A partial (or complete) TodoListImage object.
*/
export function givenTodoListImage(todoListImage?: Partial<TodoListImage>) {
const data = Object.assign(
Expand Down
2 changes: 1 addition & 1 deletion examples/todo/src/__tests__/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import * as GEO_CODER_CONFIG from '../datasources/geocoder.datasource.json';
/**
* Generate a complete Todo object for use with tests.
* @param todo A partial (or complete) Todo object.
* @param todo - A partial (or complete) Todo object.
*/
export function givenTodo(todo?: Partial<Todo>) {
const data = Object.assign(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export interface AuthenticationMetadata {
/**
* Mark a controller method as requiring authenticated user.
*
* @param strategyName The name of the authentication strategy to use.
* @param options Additional options to configure the authentication.
* @param strategyName - The name of the authentication strategy to use.
* @param options - Additional options to configure the authentication.
*/
export function authenticate(strategyName: string, options?: Object) {
return MethodDecoratorFactory.createDecorator<AuthenticationMetadata>(
Expand All @@ -37,8 +37,8 @@ export function authenticate(strategyName: string, options?: Object) {
/**
* Fetch authentication metadata stored by `@authenticate` decorator.
*
* @param controllerClass Target controller
* @param methodName Target method
* @param controllerClass - Target controller
* @param methodName - Target method
*/
export function getAuthenticateMetadata(
controllerClass: Constructor<{}>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class AuthenticateActionProvider implements Provider<AuthenticateFn> {

/**
* The implementation of authenticate() sequence action.
* @param request The incoming request provided by the REST layer
* @param request - The incoming request provided by the REST layer
*/
async action(request: Request): Promise<UserProfile | undefined> {
const strategy = await this.getStrategy();
Expand Down
4 changes: 2 additions & 2 deletions packages/authentication/src/services/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ export interface UserService<U, C> {
* }
* };
* ```
* @param credentials Credentials for basic auth or configurations for 3rd party.
* @param credentials - Credentials for basic auth or configurations for 3rd party.
* Example see the
*/
verifyCredentials(credentials: C): Promise<U>;

/**
* Convert the user returned by `verifyCredentials()` to a common
* user profile that describes a user in your application
* @param user The user returned from `verifyCredentials()`
* @param user - The user returned from `verifyCredentials()`
*/
convertToUserProfile(user: U): UserProfile;
}
4 changes: 2 additions & 2 deletions packages/authentication/src/strategy-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const passportRequestMixin = require('passport/lib/http/request');
*/
export class StrategyAdapter {
/**
* @param strategy instance of a class which implements a passport-strategy;
* @param strategy - instance of a class which implements a passport-strategy;
* @description http://passportjs.org/
*/
constructor(private readonly strategy: Strategy) {}
Expand All @@ -35,7 +35,7 @@ export class StrategyAdapter {
* 1. Create an instance of the strategy
* 2. add success and failure state handlers
* 3. authenticate using the strategy
* @param request The incoming request.
* @param request - The incoming request.
*/
authenticate(request: Request): Promise<UserProfile> {
return new Promise<UserProfile>((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/boot/src/boot.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class BootComponent implements Component {

/**
*
* @param app Application instance
* @param app - Application instance
*/
constructor(@inject(CoreBindings.APPLICATION_INSTANCE) app: Application) {
// Bound as a SINGLETON so it can be cached as it has no state
Expand Down
4 changes: 2 additions & 2 deletions packages/boot/src/booters/application-metadata.booter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const debug = debugModule('loopback:boot:booter:application-metadata');
*
* Configure the application with metadata from `package.json`
*
* @param app Application instance
* @param projectRoot Root of User Project
* @param app - Application instance
* @param projectRoot - Root of User Project
*/
export class ApplicationMetadataBooter implements Booter {
constructor(
Expand Down
10 changes: 5 additions & 5 deletions packages/boot/src/booters/booter-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const debug = debugFactory('loopback:boot:booter-utils');
/**
* Returns all files matching the given glob pattern relative to root
*
* @param pattern A glob pattern
* @param root Root folder to start searching for matching files
* @param pattern - A glob pattern
* @param root - Root folder to start searching for matching files
* @returns {string[]} Array of discovered files
*/
export async function discoverFiles(
Expand All @@ -28,7 +28,7 @@ export async function discoverFiles(
/**
* Given a function, returns true if it is a class, false otherwise.
*
* @param target The function to check if it's a class or not.
* @param target - The function to check if it's a class or not.
* @returns {boolean} True if target is a class. False otherwise.
*/
// tslint:disable-next-line:no-any
Expand All @@ -43,8 +43,8 @@ export function isClass(target: any): target is Constructor<any> {
* identifying the exports from the file by getting the keys of the file
* and then testing each exported member to see if it's a class or not.
*
* @param files An array of string of absolute file paths
* @param projectRootDir The project root directory
* @param files - An array of string of absolute file paths
* @param projectRootDir - The project root directory
* @returns {Constructor<{}>[]} An array of Class constructors from a file
*/
export function loadClassesFromFiles(
Expand Down
6 changes: 3 additions & 3 deletions packages/boot/src/booters/controller.booter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import {BootBindings} from '../keys';
*
* Supported phases: configure, discover, load
*
* @param app Application instance
* @param projectRoot Root of User Project relative to which all paths are resolved
* @param [bootConfig] Controller Artifact Options Object
* @param app - Application instance
* @param projectRoot - Root of User Project relative to which all paths are resolved
* @param bootConfig - Controller Artifact Options Object
*/
export class ControllerBooter extends BaseArtifactBooter {
constructor(
Expand Down
6 changes: 3 additions & 3 deletions packages/boot/src/booters/datasource.booter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import {BootBindings} from '../keys';
*
* Supported phases: configure, discover, load
*
* @param app Application instance
* @param projectRoot Root of User Project relative to which all paths are resolved
* @param [bootConfig] DataSource Artifact Options Object
* @param app - Application instance
* @param projectRoot - Root of User Project relative to which all paths are resolved
* @param bootConfig - DataSource Artifact Options Object
*/
export class DataSourceBooter extends BaseArtifactBooter {
constructor(
Expand Down
6 changes: 3 additions & 3 deletions packages/boot/src/booters/lifecyle-observer.booter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ type LifeCycleObserverClass = Constructor<LifeCycleObserver>;
*
* Supported phases: configure, discover, load
*
* @param app Application instance
* @param projectRoot Root of User Project relative to which all paths are resolved
* @param [bootConfig] LifeCycleObserver Artifact Options Object
* @param app - Application instance
* @param projectRoot - Root of User Project relative to which all paths are resolved
* @param bootConfig - LifeCycleObserver Artifact Options Object
*/
export class LifeCycleObserverBooter extends BaseArtifactBooter {
observers: LifeCycleObserverClass[];
Expand Down
6 changes: 3 additions & 3 deletions packages/boot/src/booters/repository.booter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import {ArtifactOptions} from '../interfaces';
*
* Supported phases: configure, discover, load
*
* @param app Application instance
* @param projectRoot Root of User Project relative to which all paths are resolved
* @param [bootConfig] Repository Artifact Options Object
* @param app - Application instance
* @param projectRoot - Root of User Project relative to which all paths are resolved
* @param bootConfig - Repository Artifact Options Object
*/
export class RepositoryBooter extends BaseArtifactBooter {
constructor(
Expand Down
Loading

0 comments on commit d1646d0

Please sign in to comment.