import { Context, DAL, FindOptions, InferEntityType, InferRepositoryReturnType, FilterQuery as InternalFilterQuery, PerformedActions, RepositoryService, RepositoryTransformOptions, UpsertWithReplaceConfig } from "@medusajs/types"; import { EntityClass, EntitySchema } from "@medusajs/deps/mikro-orm/core"; export declare class MikroOrmBase { readonly manager_: any; protected constructor({ manager }: { manager: any; }); getFreshManager(): TManager; getActiveManager({ transactionManager, manager, }?: Context): TManager; transaction(task: (transactionManager: TManager) => Promise, options?: { manager?: TManager; isolationLevel?: string; enableNestedTransactions?: boolean; transaction?: TManager; }): Promise; serialize(data: any, options?: any): Promise; } /** * Privileged extends of the abstract classes unless most of the methods can't be implemented * in your repository. This base repository is also used to provide a base repository * injection if needed to be able to use the common methods without being related to an entity. * In this case, none of the method will be implemented except the manager and transaction * related ones. */ export declare class MikroOrmBaseRepository extends MikroOrmBase implements RepositoryService { entity: EntityClass>; constructor(...args: any[]); static buildUniqueCompositeKeyValue(keys: string[], data: object): string; static retrievePrimaryKeys(entity: EntityClass | EntitySchema): string[]; /** * When using the select-in strategy, the populated fields are not selected by default unlike when using the joined strategy. * This method will add the populated fields to the fields array if they are not already specifically selected. * * TODO: Revisit if this is still needed in v6 as it seems to be a workaround for a bug in v5 * * @param {FindOptions} findOptions */ static compensateRelationFieldsSelectionFromLoadStrategy({ findOptions, }: { findOptions: DAL.FindOptions; }): void; create(data: unknown[], context?: Context): Promise[]>; update(data: { entity: any; update: any; }[], context?: Context): Promise[]>; delete(idsOrPKs: FindOptions["where"], context?: Context): Promise; find(options?: DAL.FindOptions, context?: Context): Promise[]>; findAndCount(options?: DAL.FindOptions, context?: Context): Promise<[InferRepositoryReturnType[], number]>; upsert(data: unknown[], context?: Context): Promise[]>; upsertWithReplace(data: unknown[], config?: UpsertWithReplaceConfig>, context?: Context): Promise<{ entities: InferRepositoryReturnType[]; performedActions: PerformedActions; }>; softDelete(filters: string | string[] | DAL.FindOptions["where"] | DAL.FindOptions["where"][], sharedContext?: Context): Promise<[InferRepositoryReturnType[], Record]>; restore(idsOrFilter: string[] | InternalFilterQuery, sharedContext?: Context): Promise<[InferRepositoryReturnType[], Record]>; } export declare class MikroOrmBaseTreeRepository extends MikroOrmBase { constructor(); find(options?: DAL.FindOptions, transformOptions?: RepositoryTransformOptions, context?: Context): Promise[]>; findAndCount(options?: DAL.FindOptions, transformOptions?: RepositoryTransformOptions, context?: Context): Promise<[InferRepositoryReturnType[], number]>; create(data: unknown[], context?: Context): Promise[]>; update(data: unknown[], context?: Context): Promise[]>; delete(ids: string[], context?: Context): Promise; } export declare function mikroOrmBaseRepositoryFactory(entity: T): { new ({ manager }: { manager: any; }): MikroOrmBaseRepository; }; //# sourceMappingURL=mikro-orm-repository.d.ts.map