import { Context } from '@loopback/core'; import { Entity, HasOneDefinition, RelationType } from '@loopback/repository'; import { IRestResolver, RestLinkerParams, RestResolverParams } from '../types'; export declare class HasOneRestResolver implements IRestResolver { private readonly context; type: RelationType; constructor(context: Context); /** * It takes the results of the query, finds the foreign key in each result, and then uses that key to * find the related record in the related service * @param - `relationConfig` is the configuration object for the relation. * @returns A map of related records. */ resolve({ relationConfig, relationMetadata, results, scope, token, }: RestResolverParams & { relationMetadata: HasOneDefinition; }): Promise>; /** * It takes a parent object, looks up the foreign key on the parent, and then uses that foreign key to * look up and link the related object in the resolvedDataMap * @param - `relationMetadata` is the metadata for the relation being linked. * @returns The parent object with the relationName property set to the * resolvedDataMap.get(parent[keyFrom]) */ link({ relationMetadata, parent, resolvedDataMap, }: RestLinkerParams & { relationMetadata: HasOneDefinition; }): Promise; private addConditionToScope; private findRelatedData; private getKeyFrom; private toPascalCase; private getService; }