From b8d005cca6b07b52f4b52bb5e4c4eefc7d06a3c9 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Wed, 8 May 2019 11:30:17 -0700 Subject: [PATCH] chore: fix tsdoc comments for @example Embedded typescript code in comments cannot be rendered correctly inside markdown tables. Add @example to extract example code snippets. --- examples/log-extension/src/mixins/log.mixin.ts | 2 ++ packages/authentication/src/keys.ts | 5 +++++ .../authentication/src/services/user.service.ts | 1 + packages/boot/src/mixins/boot.mixin.ts | 2 ++ packages/context/src/binding-filter.ts | 1 + packages/context/src/binding-inspector.ts | 4 +++- packages/context/src/binding-key.ts | 2 +- packages/context/src/binding.ts | 5 +++-- packages/context/src/context.ts | 11 ++++++++--- packages/context/src/inject.ts | 8 +++++--- packages/core/src/application.ts | 4 ++++ packages/core/src/component.ts | 9 ++++++--- packages/core/src/extension-point.ts | 6 ++++-- packages/metadata/src/decorator-factory.ts | 7 +++++-- .../src/decorators/parameter.decorator.ts | 4 +++- .../src/decorators/request-body.decorator.ts | 1 + packages/repository/src/common-types.ts | 6 ++++-- .../src/decorators/repository.decorator.ts | 2 ++ packages/repository/src/mixins/repository.mixin.ts | 8 +++++++- packages/repository/src/model.ts | 6 ++++-- packages/repository/src/query.ts | 14 +++++++++----- .../src/repositories/legacy-juggler-bridge.ts | 1 + packages/repository/src/repositories/repository.ts | 14 +++++++------- packages/rest/src/rest.application.ts | 5 +++++ packages/rest/src/rest.server.ts | 9 +++++++++ packages/rest/src/sequence.ts | 4 +++- packages/service-proxy/src/mixins/service.mixin.ts | 5 +++++ 27 files changed, 110 insertions(+), 36 deletions(-) diff --git a/examples/log-extension/src/mixins/log.mixin.ts b/examples/log-extension/src/mixins/log.mixin.ts index 6fbd96dbb0f1..7ce096f42843 100644 --- a/examples/log-extension/src/mixins/log.mixin.ts +++ b/examples/log-extension/src/mixins/log.mixin.ts @@ -12,6 +12,7 @@ import {LogComponent} from '../component'; * Also provides .logLevel() to bind application wide logLevel. * Functions with a log level set to logLevel or higher sill log data * + * @example * ```ts * class MyApplication extends LogMixin(Application) {} * ``` @@ -34,6 +35,7 @@ export function LogMixin>(superClass: T) { * * @param level The log level to set for @log decorator * + * @example * ```ts * app.logLevel(LOG_LEVEL.INFO); * ``` diff --git a/packages/authentication/src/keys.ts b/packages/authentication/src/keys.ts index cc65e887e777..98ac8620a0a3 100644 --- a/packages/authentication/src/keys.ts +++ b/packages/authentication/src/keys.ts @@ -16,6 +16,7 @@ export namespace AuthenticationBindings { * Key used to bind an authentication strategy to the context for the * authentication function to use. * + * @example * ```ts * server * .bind(AuthenticationBindings.STRATEGY) @@ -29,6 +30,7 @@ export namespace AuthenticationBindings { /** * Key used to inject the authentication function into the sequence. * + * @example * ```ts * class MySequence implements SequenceHandler { * constructor( @@ -64,6 +66,7 @@ export namespace AuthenticationBindings { * Key used to inject authentication metadata, which is used to determine * whether a request requires authentication or not. * + * @example * ```ts * class MyPassportStrategyProvider implements Provider { * constructor( @@ -86,6 +89,8 @@ export namespace AuthenticationBindings { /** * Key used to inject the user instance retrieved by the * authentication function + * + * @example * ```ts * class MyController { * constructor( diff --git a/packages/authentication/src/services/user.service.ts b/packages/authentication/src/services/user.service.ts index 23d2cba3c1c0..71fbaa7e10b9 100644 --- a/packages/authentication/src/services/user.service.ts +++ b/packages/authentication/src/services/user.service.ts @@ -55,6 +55,7 @@ export interface UserService { * Verify the identity of a user, construct a corresponding user profile using * the user information and return the user profile. * + * @example * A pseudo code for basic authentication: * ```ts * verifyCredentials(credentials: C): Promise { diff --git a/packages/boot/src/mixins/boot.mixin.ts b/packages/boot/src/mixins/boot.mixin.ts index f50b6dbdce4a..3a40b9aee7b4 100644 --- a/packages/boot/src/mixins/boot.mixin.ts +++ b/packages/boot/src/mixins/boot.mixin.ts @@ -79,6 +79,7 @@ export function BootMixin>(superClass: T) { * * @param booterCls Booter classes to bind to the Application * + * @example * ```ts * app.booters(MyBooter, MyOtherBooter) * ``` @@ -94,6 +95,7 @@ export function BootMixin>(superClass: T) { * * @param component The component to add. * + * @example * ```ts * * export class ProductComponent { diff --git a/packages/context/src/binding-filter.ts b/packages/context/src/binding-filter.ts index 1364baba3317..129bb2813a6c 100644 --- a/packages/context/src/binding-filter.ts +++ b/packages/context/src/binding-filter.ts @@ -10,6 +10,7 @@ import {BindingAddress} from './binding-key'; * A function that filters bindings. It returns `true` to select a given * binding. * + * @remarks * TODO(semver-major): We might change this type in the future to either remove * the `` or make it as type guard by asserting the matched binding * to be typed with ``. diff --git a/packages/context/src/binding-inspector.ts b/packages/context/src/binding-inspector.ts index 8e81210da371..80a1ad6eb734 100644 --- a/packages/context/src/binding-inspector.ts +++ b/packages/context/src/binding-inspector.ts @@ -155,7 +155,9 @@ export function bindingTemplateFor( } /** - * Mapping artifact types to binding key namespaces (prefixes). For example: + * Mapping artifact types to binding key namespaces (prefixes). + * + * @example * ```ts * { * repository: 'repositories' diff --git a/packages/context/src/binding-key.ts b/packages/context/src/binding-key.ts index 2aca919546a3..3c61d98219ff 100644 --- a/packages/context/src/binding-key.ts +++ b/packages/context/src/binding-key.ts @@ -12,7 +12,7 @@ export class BindingKey { /** * Create a new key for a binding bound to a value of type `ValueType`. * - * **Example** + * @example * * ```ts * BindingKey.create('application.name'); diff --git a/packages/context/src/binding.ts b/packages/context/src/binding.ts index 7e1d1748ef50..b7077d5c84c1 100644 --- a/packages/context/src/binding.ts +++ b/packages/context/src/binding.ts @@ -233,9 +233,10 @@ export class Binding { * - the bound value * - a promise of the bound value * - * Consumers wishing to consume sync values directly should use `isPromise` + * Consumers wishing to consume sync values directly should use `isPromiseLike` * to check the type of the returned value to decide how to handle it. * + * @example * ``` * const result = binding.getValue(ctx); * if (isPromiseLike(result)) { @@ -540,7 +541,7 @@ export class Binding { * Apply one or more template functions to set up the binding with scope, * tags, and other attributes as a group. * - * For example, + * @example * ```ts * const serverTemplate = (binding: Binding) => * binding.inScope(BindingScope.SINGLETON).tag('server'); diff --git a/packages/context/src/context.ts b/packages/context/src/context.ts index 88733c48f60d..ff158753e952 100644 --- a/packages/context/src/context.ts +++ b/packages/context/src/context.ts @@ -97,7 +97,9 @@ export class Context extends EventEmitter { private notificationQueue: AsyncIterableIterator | undefined; /** - * Create a new context. For example, + * Create a new context. + * + * @example * ```ts * // Create a new root context, let the framework to create a unique name * const rootCtx = new Context(); @@ -354,12 +356,15 @@ export class Context extends EventEmitter { } /** - * Unbind a binding from the context. No parent contexts will be checked. If - * you need to unbind a binding owned by a parent context, use the code below: + * Unbind a binding from the context. No parent contexts will be checked. + * + * @remarks + * If you need to unbind a binding owned by a parent context, use the code below: * ```ts * const ownerCtx = ctx.getOwnerContext(key); * return ownerCtx != null && ownerCtx.unbind(key); * ``` + * * @param key Binding key * @returns true if the binding key is found and removed from this context */ diff --git a/packages/context/src/inject.ts b/packages/context/src/inject.ts index 304a2ad67113..43ce0e800e43 100644 --- a/packages/context/src/inject.ts +++ b/packages/context/src/inject.ts @@ -81,6 +81,7 @@ export interface Injection { * A decorator to annotate method arguments for automatic injection * by LoopBack IoC container. * + * @example * Usage - Typescript: * * ```ts @@ -206,7 +207,7 @@ export namespace Getter { * The function injected by `@inject.setter(bindingKey)`. It sets the underlying * binding to a constant value using `binding.to(value)`. * - * For example: + * @example * * ```ts * setterFn('my-value'); @@ -282,7 +283,7 @@ export namespace inject { * `metadata.bindingCreation` option. See `BindingCreationPolicy` for more * details. * - * For example: + * @example * * ```ts * class MyAuthAction { @@ -311,7 +312,7 @@ export namespace inject { /** * Inject an array of values by a tag pattern string or regexp * - * For example, + * @example * ```ts * class AuthenticationManager { * constructor( @@ -336,6 +337,7 @@ export namespace inject { /** * Inject matching bound values by the filter function * + * @example * ```ts * class MyControllerWithView { * @inject.view(filterByTag('foo')) diff --git a/packages/core/src/application.ts b/packages/core/src/application.ts index fbf95e9104d4..a0e3a4e5b2ef 100644 --- a/packages/core/src/application.ts +++ b/packages/core/src/application.ts @@ -51,6 +51,7 @@ export class Application extends Context implements LifeCycleObserver { * further modify the binding, e.g. lock the value to prevent further * modifications. * + * @example * ```ts * class MyController { * } @@ -74,6 +75,7 @@ export class Application extends Context implements LifeCycleObserver { * Each server constructor added in this way must provide a unique prefix * to prevent binding overlap. * + * @example * ```ts * app.server(RestServer); * // This server constructor will be bound under "servers.RestServer". @@ -107,6 +109,7 @@ export class Application extends Context implements LifeCycleObserver { * Each server added in this way will automatically be named based on the * class constructor name with the "servers." prefix. * + * @remarks * If you wish to control the binding keys for particular server instances, * use the app.server function instead. * ```ts @@ -181,6 +184,7 @@ export class Application extends Context implements LifeCycleObserver { * @param componentCtor The component class to add. * @param {string=} name Optional component name, default to the class name * + * @example * ```ts * * export class ProductComponent { diff --git a/packages/core/src/component.ts b/packages/core/src/component.ts index ce6cc6a94124..e0b8cfafdd61 100644 --- a/packages/core/src/component.ts +++ b/packages/core/src/component.ts @@ -40,7 +40,8 @@ export interface Component { /** * A map of providers to be bound to the application context - * * For example: + * + * @example * ```ts * { * 'authentication.strategies.ldap': LdapStrategyProvider @@ -52,7 +53,7 @@ export interface Component { /** * A map of classes to be bound to the application context. * - * For example: + * @example * ```ts * { * 'rest.body-parsers.xml': XmlBodyParser @@ -71,7 +72,9 @@ export interface Component { lifeCycleObservers?: Constructor[]; /** - * An array of bindings to be aded to the application context. For example, + * An array of bindings to be aded to the application context. + * + * @example * ```ts * const bindingX = Binding.bind('x').to('Value X'); * this.bindings = [bindingX] diff --git a/packages/core/src/extension-point.ts b/packages/core/src/extension-point.ts index cf86c2bea350..7d970297f6e9 100644 --- a/packages/core/src/extension-point.ts +++ b/packages/core/src/extension-point.ts @@ -21,8 +21,9 @@ import {CoreTags} from './keys'; /** * Decorate a class as a named extension point. If the decoration is not - * present, the name of the class will be used. For example: + * present, the name of the class will be used. * + * @example * ```ts * import {extensionPoint} from '@loopback/core'; * @@ -39,8 +40,9 @@ export function extensionPoint(name: string, ...specs: BindingSpec[]) { } /** - * Shortcut to inject extensions for the given extension point. For example: + * Shortcut to inject extensions for the given extension point. * + * @example * ```ts * import {Getter} from '@loopback/context'; * import {extensionPoint, extensions} from '@loopback/core'; diff --git a/packages/metadata/src/decorator-factory.ts b/packages/metadata/src/decorator-factory.ts index 4b4b9c488003..430fe4c240b9 100644 --- a/packages/metadata/src/decorator-factory.ts +++ b/packages/metadata/src/decorator-factory.ts @@ -623,8 +623,11 @@ export class ParameterDecoratorFactory extends DecoratorFactory< } /** - * Factory for method level parameter decorator. For example, the following - * code uses `@param` to declare two parameters for `greet()`. + * Factory for method level parameter decorator. + * + * @example + * For example, the following code uses `@param` to declare two parameters for + * `greet()`. * ```ts * class MyController { * @param('name') // Parameter 0 diff --git a/packages/openapi-v3/src/decorators/parameter.decorator.ts b/packages/openapi-v3/src/decorators/parameter.decorator.ts index 4c26d9a11774..e24856c11d6d 100644 --- a/packages/openapi-v3/src/decorators/parameter.decorator.ts +++ b/packages/openapi-v3/src/decorators/parameter.decorator.ts @@ -103,7 +103,9 @@ const builtinTypes = { * takes an argument of `ParameterObject` to define how to map the parameter * to OpenAPI specification. * - * `@param(paramSpec)` must be applied to parameters. For example, + * `@param(paramSpec)` must be applied to parameters. + * + * @example * ```ts * class MyController { * @get('/') diff --git a/packages/openapi-v3/src/decorators/request-body.decorator.ts b/packages/openapi-v3/src/decorators/request-body.decorator.ts index dd2ea443326c..105701bc85c9 100644 --- a/packages/openapi-v3/src/decorators/request-body.decorator.ts +++ b/packages/openapi-v3/src/decorators/request-body.decorator.ts @@ -23,6 +23,7 @@ export const REQUEST_BODY_INDEX = 'x-parameter-index'; * A typical OpenAPI requestBody spec contains property * `description`, `required`, and `content`: * + * @example * ```ts * requestBodySpec: { * description: 'a user', diff --git a/packages/repository/src/common-types.ts b/packages/repository/src/common-types.ts index 6df206ed72d0..8d70a00a96be 100644 --- a/packages/repository/src/common-types.ts +++ b/packages/repository/src/common-types.ts @@ -19,8 +19,10 @@ export interface Class { } /** - * Interface for constructor functions without `new` operator, for example, - * ``` + * Interface for constructor functions without `new` operator. + * + * @example + * ```ts * function Foo(x) { * if (!(this instanceof Foo)) { return new Foo(x); } * this.x = x; diff --git a/packages/repository/src/decorators/repository.decorator.ts b/packages/repository/src/decorators/repository.decorator.ts index b18b8b6558f4..1987568178ef 100644 --- a/packages/repository/src/decorators/repository.decorator.ts +++ b/packages/repository/src/decorators/repository.decorator.ts @@ -85,6 +85,7 @@ export class RepositoryMetadata { /** * Decorator for repository injections on properties or method arguments * + * @example * ```ts * class CustomerController { * @repository(CustomerRepository) public custRepo: CustomerRepository; @@ -106,6 +107,7 @@ export function repository( * Decorator for DefaultCrudRepository generation and injection on properties * or method arguments based on the given model and dataSource (or their names) * + * @example * ```ts * class CustomerController { * @repository('Customer', 'mySqlDataSource') diff --git a/packages/repository/src/mixins/repository.mixin.ts b/packages/repository/src/mixins/repository.mixin.ts index e9a3fec8c40b..70be27012282 100644 --- a/packages/repository/src/mixins/repository.mixin.ts +++ b/packages/repository/src/mixins/repository.mixin.ts @@ -17,8 +17,8 @@ const debug = debugFactory('loopback:repository:mixin'); * function to register a repository automatically. Also overrides * component function to allow it to register repositories automatically. * + * @example * ```ts - * * class MyApplication extends RepositoryMixin(Application) {} * ``` * @@ -40,6 +40,7 @@ export function RepositoryMixin>(superClass: T) { * * @param repoClass The repository to add. * + * @example * ```ts * * class NoteRepo { @@ -93,6 +94,7 @@ export function RepositoryMixin>(superClass: T) { * @param dataSource The dataSource to add. * @param name The binding name of the datasource; defaults to dataSource.name * + * @example * ```ts * * const ds: juggler.DataSource = new juggler.DataSource({ @@ -138,6 +140,7 @@ export function RepositoryMixin>(superClass: T) { * * @param component The component to add. * + * @example * ```ts * * export class ProductComponent { @@ -257,6 +260,7 @@ export class RepositoryMixinDoc { * * @param repo The repository to add. * + * @example * ```ts * * class NoteRepo { @@ -300,6 +304,7 @@ export class RepositoryMixinDoc { * @param dataSource The dataSource to add. * @param name The binding name of the datasource; defaults to dataSource.name * + * @example * ```ts * * const ds: juggler.DataSource = new juggler.DataSource({ @@ -328,6 +333,7 @@ export class RepositoryMixinDoc { * * @param component The component to add. * + * @example * ```ts * * export class ProductComponent { diff --git a/packages/repository/src/model.ts b/packages/repository/src/model.ts index 006749ee5c28..9d1a82a85791 100644 --- a/packages/repository/src/model.ts +++ b/packages/repository/src/model.ts @@ -131,8 +131,10 @@ export class ModelDefinition { /** * Get an array of names of ID properties, which are specified in - * the model settings or properties with `id` attribute. For example, - * ``` + * the model settings or properties with `id` attribute. + * + * @example + * ```ts * { * settings: { * id: ['id'] diff --git a/packages/repository/src/query.ts b/packages/repository/src/query.ts index 6ea45fe6bed8..bc8123ddde43 100644 --- a/packages/repository/src/query.ts +++ b/packages/repository/src/query.ts @@ -3,8 +3,8 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {AnyObject} from './common-types'; import * as assert from 'assert'; +import {AnyObject} from './common-types'; // tslint:disable:no-any @@ -78,7 +78,8 @@ export type KeyOf = Exclude< /** * Condition clause - * For example: + * + * @example * ```ts * { * name: {inq: ['John', 'Mary']}, @@ -95,7 +96,8 @@ export type Condition = { /** * Where clause - * For example: + * + * @example * ```ts * { * name: {inq: ['John', 'Mary']}, @@ -112,7 +114,8 @@ export type Where = /** * And clause - * For example: + * + * @example * ```ts * { * and: [...], @@ -125,7 +128,8 @@ export interface AndClause { /** * Or clause - * For example: + * + * @example * ```ts * { * or: [...], diff --git a/packages/repository/src/repositories/legacy-juggler-bridge.ts b/packages/repository/src/repositories/legacy-juggler-bridge.ts index 5e3b028292a3..cdf67976eb13 100644 --- a/packages/repository/src/repositories/legacy-juggler-bridge.ts +++ b/packages/repository/src/repositories/legacy-juggler-bridge.ts @@ -198,6 +198,7 @@ export class DefaultCrudRepository /** * Function to create a constrained relation repository factory * + * @example * ```ts * class CustomerRepository extends DefaultCrudRepository< * Customer, diff --git a/packages/repository/src/repositories/repository.ts b/packages/repository/src/repositories/repository.ts index 1f8a36d9ea49..b1fd92663050 100644 --- a/packages/repository/src/repositories/repository.ts +++ b/packages/repository/src/repositories/repository.ts @@ -3,20 +3,20 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -import {Entity, ValueObject, Model} from '../model'; import { - DataObject, - Options, AnyObject, Command, + Count, + DataObject, NamedParameters, + Options, PositionalParameters, - Count, } from '../common-types'; -import {DataSource} from '../datasource'; import {CrudConnector} from '../connectors'; -import {Filter, Where} from '../query'; +import {DataSource} from '../datasource'; import {EntityNotFoundError} from '../errors'; +import {Entity, Model, ValueObject} from '../model'; +import {Filter, Where} from '../query'; // tslint:disable:no-unused @@ -190,7 +190,7 @@ export interface EntityCrudRepository /** * Repository implementation * - * Example: + * @example * * User can import `CrudRepositoryImpl` and call its functions like: * `CrudRepositoryImpl.find(somefilters, someoptions)` diff --git a/packages/rest/src/rest.application.ts b/packages/rest/src/rest.application.ts index 05c34e390d78..3824600c733a 100644 --- a/packages/rest/src/rest.application.ts +++ b/packages/rest/src/rest.application.ts @@ -124,6 +124,7 @@ export class RestApplication extends Application implements HttpServerLike { /** * Register a new Controller-based route. * + * @example * ```ts * class MyController { * greet(name: string) { @@ -152,6 +153,7 @@ export class RestApplication extends Application implements HttpServerLike { /** * Register a new route invoking a handler function. * + * @example * ```ts * function greet(name: string) { * return `hello ${name}`; @@ -175,6 +177,7 @@ export class RestApplication extends Application implements HttpServerLike { /** * Register a new route. * + * @example * ```ts * function greet(name: string) { * return `hello ${name}`; @@ -190,6 +193,7 @@ export class RestApplication extends Application implements HttpServerLike { /** * Register a new route. * + * @example * ```ts * function greet(name: string) { * return `hello ${name}`; @@ -237,6 +241,7 @@ export class RestApplication extends Application implements HttpServerLike { /** * Register a route redirecting callers to a different URL. * + * @example * ```ts * app.redirect('/explorer', '/explorer/'); * ``` diff --git a/packages/rest/src/rest.server.ts b/packages/rest/src/rest.server.ts index 071023d06d22..02169a041af3 100644 --- a/packages/rest/src/rest.server.ts +++ b/packages/rest/src/rest.server.ts @@ -82,6 +82,8 @@ const cloneDeep: (value: T) => T = require('lodash/cloneDeep'); /** * A REST API server for use with Loopback. * Add this server to your application by importing the RestComponent. + * + * @example * ```ts * const app = new MyApplication(); * app.component(RestComponent); @@ -458,6 +460,7 @@ export class RestServer extends Context implements Server, HttpServerLike { * further modify the binding, e.g. lock the value to prevent further * modifications. * + * @example * ```ts * class MyController { * } @@ -474,6 +477,7 @@ export class RestServer extends Context implements Server, HttpServerLike { /** * Register a new Controller-based route. * + * @example * ```ts * class MyController { * greet(name: string) { @@ -502,6 +506,7 @@ export class RestServer extends Context implements Server, HttpServerLike { /** * Register a new route invoking a handler function. * + * @example * ```ts * function greet(name: string) { * return `hello ${name}`; @@ -525,6 +530,7 @@ export class RestServer extends Context implements Server, HttpServerLike { /** * Register a new generic route. * + * @example * ```ts * function greet(name: string) { * return `hello ${name}`; @@ -604,6 +610,7 @@ export class RestServer extends Context implements Server, HttpServerLike { /** * Register a route redirecting callers to a different URL. * + * @example * ```ts * server.redirect('/explorer', '/explorer/'); * ``` @@ -687,6 +694,7 @@ export class RestServer extends Context implements Server, HttpServerLike { /** * Configure a custom sequence class for handling incoming requests. * + * @example * ```ts * class MySequence implements SequenceHandler { * constructor( @@ -708,6 +716,7 @@ export class RestServer extends Context implements Server, HttpServerLike { /** * Configure a custom sequence function for handling incoming requests. * + * @example * ```ts * app.handler(({request, response}, sequence) => { * sequence.send(response, 'hello world'); diff --git a/packages/rest/src/sequence.ts b/packages/rest/src/sequence.ts index 71aca4f98f6c..ddfc4adf0c6b 100644 --- a/packages/rest/src/sequence.ts +++ b/packages/rest/src/sequence.ts @@ -5,9 +5,9 @@ const debug = require('debug')('loopback:rest:sequence'); import {inject} from '@loopback/context'; -import {FindRoute, InvokeMethod, Send, Reject, ParseParams} from './types'; import {RestBindings} from './keys'; import {RequestContext} from './request-context'; +import {FindRoute, InvokeMethod, ParseParams, Reject, Send} from './types'; const SequenceActions = RestBindings.SequenceActions; @@ -37,6 +37,7 @@ export interface SequenceHandler { /** * The default implementation of SequenceHandler. * + * @remarks * This class implements default Sequence for the LoopBack framework. * Default sequence is used if user hasn't defined their own Sequence * for their application. @@ -45,6 +46,7 @@ export interface SequenceHandler { * when the API request comes in. User defines APIs in their Application * Controller class. * + * @example * User can bind their own Sequence to app as shown below * ```ts * app.bind(CoreBindings.SEQUENCE).toClass(MySequence); diff --git a/packages/service-proxy/src/mixins/service.mixin.ts b/packages/service-proxy/src/mixins/service.mixin.ts index 9e12aeee264a..e8e24d8eee54 100644 --- a/packages/service-proxy/src/mixins/service.mixin.ts +++ b/packages/service-proxy/src/mixins/service.mixin.ts @@ -20,6 +20,7 @@ export interface Class { * function to register a service automatically. Also overrides * component function to allow it to register repositories automatically. * + * @example * ```ts * class MyApplication extends ServiceMixin(Application) {} * ``` @@ -42,6 +43,7 @@ export function ServiceMixin>(superClass: T) { * * @param provider The service provider to register. * + * @example * ```ts * export interface GeocoderService { * geocode(address: string): Promise; @@ -81,6 +83,7 @@ export function ServiceMixin>(superClass: T) { * * @param component The component to add. * + * @example * ```ts * * export class ProductComponent { @@ -150,6 +153,7 @@ export class ServiceMixinDoc { * * @param provider The service provider to register. * + * @example * ```ts * export interface GeocoderService { * geocode(address: string): Promise; @@ -179,6 +183,7 @@ export class ServiceMixinDoc { * * @param component The component to add. * + * @example * ```ts * * export class ProductComponent {