import { ILinkModule, LinkDefinition, LoadedModule, ModuleJoinerRelationship } from "@biryanihouse/types"; import { Modules } from "@biryanihouse/utils"; /** * The details of a data model's record whose linked records should be deleted. Usually used after the * data model's record is deleted. * * The key is the data model's name. Its value is an object that has the ID of the data model's record. */ export type DeleteEntityInput = { [moduleName: string | Modules]: Record; }; export type RestoreEntityInput = DeleteEntityInput; type RemoteRelationship = ModuleJoinerRelationship & { isPrimary: boolean; isForeign: boolean; }; type LoadedLinkModule = LoadedModule & ILinkModule; type DeleteEntities = { [key: string]: string[]; }; type RemovedIds = { [serviceName: string]: DeleteEntities; }; type RestoredIds = RemovedIds; type CascadeError = { serviceName: string; method: String; args: any; error: Error; }; export declare class Link { private modulesMap; private relationsPairs; private relations; constructor(modulesLoaded?: LoadedModule[]); addModule(mod: LoadedModule): void; private addRelationship; getLinkModule(moduleA: string, moduleAKey: string, moduleB: string, moduleBKey: string): LoadedLinkModule | undefined; getRelationships(): Map>; private getLinkableKeys; private executeCascade; private getLinkModuleOrThrow; private getLinkDataConfig; create(link: LinkDefinition | LinkDefinition[]): Promise; dismiss(link: LinkDefinition | LinkDefinition[]): Promise; delete(removedServices: DeleteEntityInput): Promise<[CascadeError[] | null, RemovedIds]>; restore(removedServices: DeleteEntityInput): Promise<[CascadeError[] | null, RestoredIds]>; list(link: LinkDefinition | LinkDefinition[], options?: { asLinkDefinition?: boolean; }): Promise<(object | LinkDefinition)[]>; } export {}; //# sourceMappingURL=link.d.ts.map