import { CoreObject, CoreObjectAttributes } from "../core-object"; import { Service } from "../service"; export type QuerySearch> = (object: T) => boolean; export declare class RelationCache { private readonly _cache; /** * Checks the current status of the provided object type's cache */ checkStatus(objectType: typeof CoreObject): boolean; /** * Clears the cache of the provided objects. If nothing is provided cache * will be cleared for all objects (hard-reset) */ clear(...objectType: Array): void; /** * Adds a new object of type as a relation into the cache */ put(objectType: string, objects: Array>): void; /** * Appends a new record into an existing relationship list */ append(object: CoreObject): void; /** * Returns all objects related to this instance that matches the provided query */ get>(objectType: typeof CoreObject, search?: QuerySearch | null, optArr?: Array | null): Array; /** * Returns the first object related to this instance that matches the provided query */ first>(objectType: typeof CoreObject, search?: QuerySearch | null): T | null; } export declare class CoreObjectRelations { private readonly _instance; private readonly _cache; constructor(instance: CoreObject); /** * Returns the cache instance */ get cache(): RelationCache; /** * Returns all objects related to this instance that matches the provided query */ get>(objectType: typeof CoreObject, search?: QuerySearch | null, service?: Service | null): Promise>; /** * Returns the first object related to this instance that matches the provided query */ first>(objectType: typeof CoreObject, search?: QuerySearch | null): Promise; }