import * as better_auth_adapters from 'better-auth/adapters';
import { MikroORM } from '@mikro-orm/core';
import { BetterAuthOptions } from 'better-auth/types';

interface MikroOrmAdapterConfig {
    /**
     * Enable debug logs.
     *
     * @default false
     */
    debugLogs?: boolean | {
        isRunningAdapterTests: boolean;
    } | {
        logCondition?: () => boolean;
    };
    /**
     * Indicates whether or not JSON is supported by target database.
     *
     * This option is enabled by default, because Mikro ORM supports JSON serialization/deserialization via [JsonType](https://mikro-orm.io/docs/custom-types#jsontype).
     * See documentation for more info: https://mikro-orm.io/docs/json-properties
     *
     * If disabled, Better Auth will handle these transformations for you.
     *
     * @default true
     */
    supportsJSON?: boolean;
    /**
     * Options for the Better Auth adapter.
     */
    options?: BetterAuthOptions;
}
/**
 * Creates Mikro ORM adapter for Better Auth.
 *
 * Current limitations:
 *   * No m:m and 1:m and embedded references support
 *   * No complex primary key support
 *   * No schema generation
 *
 * @param orm - Instance of Mikro ORM returned from `MikroORM.init` or `new MikroORM` constructor
 * @param config - Additional configuration for Mikro ORM adapter
 */
declare const mikroOrmAdapter: (orm: MikroORM, { debugLogs, supportsJSON, options }?: MikroOrmAdapterConfig) => better_auth_adapters.AdapterFactory<BetterAuthOptions>;

export { type MikroOrmAdapterConfig, mikroOrmAdapter };
