@loopback/docs
Version:
Documentation for LoopBack 4
1,078 lines (1,077 loc) • 36.4 kB
JSON
{
"metadata": {
"toolPackage": "@microsoft/api-extractor",
"toolVersion": "7.6.2",
"schemaVersion": 1003,
"oldestForwardsCompatibleVersion": 1001
},
"kind": "Package",
"canonicalReference": "@loopback/service-proxy!",
"docComment": "",
"name": "@loopback/service-proxy",
"members": [
{
"kind": "EntryPoint",
"canonicalReference": "@loopback/service-proxy!",
"name": "",
"members": [
{
"kind": "Interface",
"canonicalReference": "@loopback/service-proxy!ApplicationWithServices:interface",
"docComment": "/**\n * Interface for an Application mixed in with ServiceMixin\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export interface ApplicationWithServices extends "
},
{
"kind": "Reference",
"text": "Application",
"canonicalReference": "@loopback/core!Application:class"
},
{
"kind": "Content",
"text": " "
}
],
"releaseTag": "Public",
"name": "ApplicationWithServices",
"members": [
{
"kind": "MethodSignature",
"canonicalReference": "@loopback/service-proxy!ApplicationWithServices#component:member(1)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "component(component: "
},
{
"kind": "Reference",
"text": "Class",
"canonicalReference": "@loopback/service-proxy!Class:interface"
},
{
"kind": "Content",
"text": "<{}>"
},
{
"kind": "Content",
"text": ", name?: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "Binding",
"canonicalReference": "@loopback/context!Binding:class"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 6,
"endIndex": 7
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "component",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
},
{
"parameterName": "name",
"parameterTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
}
}
],
"name": "component"
},
{
"kind": "MethodSignature",
"canonicalReference": "@loopback/service-proxy!ApplicationWithServices#mountComponentServices:member(1)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "mountComponentServices(component: "
},
{
"kind": "Reference",
"text": "Class",
"canonicalReference": "@loopback/service-proxy!Class:interface"
},
{
"kind": "Content",
"text": "<{}>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "void"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "component",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"name": "mountComponentServices"
},
{
"kind": "MethodSignature",
"canonicalReference": "@loopback/service-proxy!ApplicationWithServices#serviceProvider:member(1)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "serviceProvider<S>(provider: "
},
{
"kind": "Reference",
"text": "Class",
"canonicalReference": "@loopback/service-proxy!Class:interface"
},
{
"kind": "Content",
"text": "<"
},
{
"kind": "Reference",
"text": "Provider",
"canonicalReference": "@loopback/context!Provider:interface"
},
{
"kind": "Content",
"text": "<S>>"
},
{
"kind": "Content",
"text": ", name?: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "Binding",
"canonicalReference": "@loopback/context!Binding:class"
},
{
"kind": "Content",
"text": "<S>"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 8,
"endIndex": 10
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "provider",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 5
}
},
{
"parameterName": "name",
"parameterTypeTokenRange": {
"startIndex": 6,
"endIndex": 7
}
}
],
"typeParameters": [
{
"typeParameterName": "S",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "serviceProvider"
}
],
"extendsTokenRanges": [
{
"startIndex": 1,
"endIndex": 3
}
]
},
{
"kind": "Interface",
"canonicalReference": "@loopback/service-proxy!Class:interface",
"docComment": "/**\n * Interface for classes with `new` operator.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export interface Class<T> "
}
],
"releaseTag": "Public",
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "Class",
"members": [
{
"kind": "ConstructSignature",
"canonicalReference": "@loopback/service-proxy!Class:new(1)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "new (...args: "
},
{
"kind": "Content",
"text": "any[]"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "T"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "args",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
]
}
],
"extendsTokenRanges": []
},
{
"kind": "Interface",
"canonicalReference": "@loopback/service-proxy!GenericService:interface",
"docComment": "/**\n * A generic service interface with any number of methods that return a promise\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export interface GenericService "
}
],
"releaseTag": "Public",
"name": "GenericService",
"members": [
{
"kind": "IndexSignature",
"canonicalReference": "@loopback/service-proxy!GenericService:index(1)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "[methodName: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": "]: "
},
{
"kind": "Content",
"text": "(...args: any[]) => "
},
{
"kind": "Reference",
"text": "Promise",
"canonicalReference": "!Promise:interface"
},
{
"kind": "Content",
"text": "<any>"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 6
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "methodName",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
]
}
],
"extendsTokenRanges": []
},
{
"kind": "Function",
"canonicalReference": "@loopback/service-proxy!getService:function(1)",
"docComment": "/**\n * Get a service proxy from a LoopBack 3.x data source backed by service-oriented connectors such as `rest`, `soap`, and `grpc`.\n *\n * @param ds - A legacy data source\n *\n * @typeParam T - The generic type of service interface\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function getService<T = "
},
{
"kind": "Reference",
"text": "GenericService",
"canonicalReference": "@loopback/service-proxy!GenericService:interface"
},
{
"kind": "Content",
"text": ">(ds: "
},
{
"kind": "Content",
"text": "legacy."
},
{
"kind": "Reference",
"text": "DataSource",
"canonicalReference": "loopback-datasource-juggler!DataSource:class"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "Promise",
"canonicalReference": "!Promise:interface"
},
{
"kind": "Content",
"text": "<T>"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 6,
"endIndex": 8
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "ds",
"parameterTypeTokenRange": {
"startIndex": 3,
"endIndex": 5
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "getService"
},
{
"kind": "Namespace",
"canonicalReference": "@loopback/service-proxy!juggler:namespace",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare namespace juggler "
}
],
"releaseTag": "Public",
"name": "juggler",
"members": []
},
{
"kind": "Variable",
"canonicalReference": "@loopback/service-proxy!SERVICE_PROXY_KEY:var",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "SERVICE_PROXY_KEY: "
},
{
"kind": "Reference",
"text": "MetadataAccessor",
"canonicalReference": "@loopback/metadata!MetadataAccessor:class"
},
{
"kind": "Content",
"text": "<string, "
},
{
"kind": "Reference",
"text": "ServiceProxyDecorator",
"canonicalReference": "@loopback/service-proxy!ServiceProxyDecorator:type"
},
{
"kind": "Content",
"text": ">"
}
],
"releaseTag": "Public",
"name": "SERVICE_PROXY_KEY",
"variableTypeTokenRange": {
"startIndex": 1,
"endIndex": 5
}
},
{
"kind": "Function",
"canonicalReference": "@loopback/service-proxy!ServiceMixin:function(1)",
"docComment": "/**\n * A mixin class for Application that creates a .serviceProvider() function to register a service automatically. Also overrides component function to allow it to register repositories automatically.\n *\n * @example\n * ```ts\n * class MyApplication extends ServiceMixin(Application) {}\n * ```\n *\n * Please note: the members in the mixin function are documented in a dummy class called <a href=\"#ServiceMixinDoc\">ServiceMixinDoc</a>\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function ServiceMixin<T extends "
},
{
"kind": "Reference",
"text": "Class",
"canonicalReference": "@loopback/service-proxy!Class:interface"
},
{
"kind": "Content",
"text": "<any>"
},
{
"kind": "Content",
"text": ">(superClass: "
},
{
"kind": "Content",
"text": "T"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "{\n new (...args: any[]): {\n [x: string]: any;\n serviceProvider<S>(provider: "
},
{
"kind": "Reference",
"text": "Class",
"canonicalReference": "@loopback/service-proxy!Class:interface"
},
{
"kind": "Content",
"text": "<"
},
{
"kind": "Reference",
"text": "Provider",
"canonicalReference": "@loopback/context!Provider:interface"
},
{
"kind": "Content",
"text": "<S>>, name?: string | undefined): "
},
{
"kind": "Reference",
"text": "Binding",
"canonicalReference": "@loopback/context!Binding:class"
},
{
"kind": "Content",
"text": "<S>;\n component(component: "
},
{
"kind": "Reference",
"text": "Class",
"canonicalReference": "@loopback/service-proxy!Class:interface"
},
{
"kind": "Content",
"text": "<unknown>, name?: string | undefined): void;\n mountComponentServices(component: "
},
{
"kind": "Reference",
"text": "Class",
"canonicalReference": "@loopback/service-proxy!Class:interface"
},
{
"kind": "Content",
"text": "<unknown>): void;\n };\n} & T"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 6,
"endIndex": 17
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "superClass",
"parameterTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
}
}
],
"typeParameters": [
{
"typeParameterName": "T",
"constraintTokenRange": {
"startIndex": 1,
"endIndex": 3
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "ServiceMixin"
},
{
"kind": "Class",
"canonicalReference": "@loopback/service-proxy!ServiceMixinDoc:class",
"docComment": "/**\n * A dummy class created to generate the tsdoc for the members in service mixin. Please don't use it.\n *\n * The members are implemented in function <a href=\"#ServiceMixin\">ServiceMixin</a>\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare class ServiceMixinDoc "
}
],
"releaseTag": "Public",
"name": "ServiceMixinDoc",
"members": [
{
"kind": "Constructor",
"canonicalReference": "@loopback/service-proxy!ServiceMixinDoc:constructor(1)",
"docComment": "/**\n * Constructs a new instance of the `ServiceMixinDoc` class\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "constructor(...args: "
},
{
"kind": "Content",
"text": "any[]"
},
{
"kind": "Content",
"text": ");"
}
],
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "args",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
]
},
{
"kind": "Method",
"canonicalReference": "@loopback/service-proxy!ServiceMixinDoc#component:member(1)",
"docComment": "/**\n * Add a component to this application. Also mounts all the components services.\n *\n * @param component - The component to add.\n *\n * @example\n * ```ts\n *\n * export class ProductComponent {\n * controllers = [ProductController];\n * repositories = [ProductRepo, UserRepo];\n * providers = {\n * [AUTHENTICATION_STRATEGY]: AuthStrategy,\n * [AUTHORIZATION_ROLE]: Role,\n * };\n * };\n *\n * app.component(ProductComponent);\n * ```\n *\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "component(component: "
},
{
"kind": "Reference",
"text": "Class",
"canonicalReference": "@loopback/service-proxy!Class:interface"
},
{
"kind": "Content",
"text": "<unknown>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "Binding",
"canonicalReference": "@loopback/context!Binding:class"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "component",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"name": "component"
},
{
"kind": "Method",
"canonicalReference": "@loopback/service-proxy!ServiceMixinDoc#mountComponentServices:member(1)",
"docComment": "/**\n * Get an instance of a component and mount all it's services. This function is intended to be used internally by component()\n *\n * @param component - The component to mount services of\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "mountComponentServices(component: "
},
{
"kind": "Reference",
"text": "Class",
"canonicalReference": "@loopback/service-proxy!Class:interface"
},
{
"kind": "Content",
"text": "<unknown>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "void"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "component",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"name": "mountComponentServices"
},
{
"kind": "Method",
"canonicalReference": "@loopback/service-proxy!ServiceMixinDoc#serviceProvider:member(1)",
"docComment": "/**\n * Add a service to this application.\n *\n * @param provider - The service provider to register.\n *\n * @example\n * ```ts\n * export interface GeocoderService {\n * geocode(address: string): Promise<GeoPoint[]>;\n * }\n *\n * export class GeocoderServiceProvider implements Provider<GeocoderService> {\n * constructor(\n * @inject('datasources.geocoder')\n * protected dataSource: juggler.DataSource = new GeocoderDataSource(),\n * ) {}\n *\n * value(): Promise<GeocoderService> {\n * return getService(this.dataSource);\n * }\n * }\n *\n * app.serviceProvider(GeocoderServiceProvider);\n * ```\n *\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "serviceProvider<S>(provider: "
},
{
"kind": "Reference",
"text": "Class",
"canonicalReference": "@loopback/service-proxy!Class:interface"
},
{
"kind": "Content",
"text": "<"
},
{
"kind": "Reference",
"text": "Provider",
"canonicalReference": "@loopback/context!Provider:interface"
},
{
"kind": "Content",
"text": "<S>>"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Reference",
"text": "Binding",
"canonicalReference": "@loopback/context!Binding:class"
},
{
"kind": "Content",
"text": "<S>"
},
{
"kind": "Content",
"text": ";"
}
],
"isStatic": false,
"returnTypeTokenRange": {
"startIndex": 6,
"endIndex": 8
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "provider",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 5
}
}
],
"typeParameters": [
{
"typeParameterName": "S",
"constraintTokenRange": {
"startIndex": 0,
"endIndex": 0
},
"defaultTypeTokenRange": {
"startIndex": 0,
"endIndex": 0
}
}
],
"name": "serviceProvider"
}
],
"implementsTokenRanges": []
},
{
"kind": "Function",
"canonicalReference": "@loopback/service-proxy!serviceProxy:function(1)",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare function serviceProxy(dataSource: "
},
{
"kind": "Content",
"text": "string | "
},
{
"kind": "Reference",
"text": "juggler.DataSource",
"canonicalReference": "loopback-datasource-juggler!DataSource:class"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "(target: object, key: string, parameterIndex?: number | undefined) => void"
},
{
"kind": "Content",
"text": ";"
}
],
"returnTypeTokenRange": {
"startIndex": 4,
"endIndex": 5
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "dataSource",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
],
"name": "serviceProxy"
},
{
"kind": "TypeAlias",
"canonicalReference": "@loopback/service-proxy!ServiceProxyDecorator:type",
"docComment": "/**\n * Type definition for decorators returned by `@serviceProxy` decorator factory\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare type ServiceProxyDecorator = "
},
{
"kind": "Reference",
"text": "PropertyDecorator",
"canonicalReference": "!PropertyDecorator:type"
},
{
"kind": "Content",
"text": " | "
},
{
"kind": "Reference",
"text": "ParameterDecorator",
"canonicalReference": "!ParameterDecorator:type"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "ServiceProxyDecorator",
"typeTokenRange": {
"startIndex": 1,
"endIndex": 4
}
},
{
"kind": "Class",
"canonicalReference": "@loopback/service-proxy!ServiceProxyMetadata:class",
"docComment": "/**\n * Metadata for a service proxy\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export declare class ServiceProxyMetadata implements "
},
{
"kind": "Reference",
"text": "InjectionMetadata",
"canonicalReference": "@loopback/context!InjectionMetadata:interface"
},
{
"kind": "Content",
"text": " "
}
],
"releaseTag": "Public",
"name": "ServiceProxyMetadata",
"members": [
{
"kind": "Constructor",
"canonicalReference": "@loopback/service-proxy!ServiceProxyMetadata:constructor(1)",
"docComment": "/**\n * Constructs a new instance of the `ServiceProxyMetadata` class\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "constructor(dataSource: "
},
{
"kind": "Content",
"text": "string | "
},
{
"kind": "Reference",
"text": "juggler.DataSource",
"canonicalReference": "loopback-datasource-juggler!DataSource:class"
},
{
"kind": "Content",
"text": ");"
}
],
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "dataSource",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
}
]
},
{
"kind": "Property",
"canonicalReference": "@loopback/service-proxy!ServiceProxyMetadata#dataSource:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "dataSource?: "
},
{
"kind": "Reference",
"text": "juggler.DataSource",
"canonicalReference": "loopback-datasource-juggler!DataSource:class"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "dataSource",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isStatic": false
},
{
"kind": "Property",
"canonicalReference": "@loopback/service-proxy!ServiceProxyMetadata#dataSourceName:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "dataSourceName?: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "dataSourceName",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isStatic": false
},
{
"kind": "Property",
"canonicalReference": "@loopback/service-proxy!ServiceProxyMetadata#decorator:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "decorator: "
},
{
"kind": "Content",
"text": "string"
},
{
"kind": "Content",
"text": ";"
}
],
"releaseTag": "Public",
"name": "decorator",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"isStatic": false
}
],
"implementsTokenRanges": [
{
"startIndex": 1,
"endIndex": 3
}
]
}
]
}
]
}