import type { NextAuthConfig } from "next-auth";
import type { Adapter } from "next-auth/adapters";
import type { Payload } from "payload";
import { type PayloadAdapterOptions } from "./PayloadAdapter.js";
type CustomEvent<T extends keyof NonNullable<NextAuthConfig["events"]>> = (message: {
    /**
     * The Auth.js database adapter
     */
    adapter: Adapter;
    /**
     * The payload instance
     */
    payload?: Payload;
} & Parameters<NonNullable<NonNullable<NextAuthConfig["events"]>[T]>>[0]) => void | PromiseLike<void>;
export interface WithPayloadOptions extends PayloadAdapterOptions {
    /**
     * Update the user after every sign in
     *
     * @deprecated updateUserOnSignIn is deprecated and will be removed in the future. Use events.signIn instead
     *
     * @default false
     */
    updateUserOnSignIn?: boolean;
    /**
     * Auth.js events
     * All events from authjs will be forwarded and enriched with additional parameters like the adapter and the payload instance
     *
     * @see https://authjs.dev/reference/nextjs#events
     */
    events?: {
        /**
         * Sign in event
         */
        signIn?: CustomEvent<"signIn">;
        /**
         * Sign out event
         */
        signOut?: CustomEvent<"signOut">;
        /**
         * Create user event
         */
        createUser?: CustomEvent<"createUser">;
        /**
         * Update user event
         */
        updateUser?: CustomEvent<"updateUser">;
        /**
         * Link account event
         */
        linkAccount?: CustomEvent<"linkAccount">;
        /**
         * Session event
         */
        session?: CustomEvent<"session">;
    };
}
/**
 * Wraps the Auth.js configuration
 *
 * @deprecated The `withPayload` function is deprecated and will be removed in the future. See the [migration guide](https://github.com/CrawlerCode/payload-authjs/releases/tag/v0.9.0) for details on how to migrate.
 *
 * @example
 * import { config } from "./auth.config";
 *
 * export const { handlers, signIn, signOut, auth } = NextAuth(
 *   withPayload(config, { payloadConfig }),
 * );
 */
export declare function withPayload(authjsConfig: NextAuthConfig, { updateUserOnSignIn, events, ...options }: WithPayloadOptions): NextAuthConfig;
export {};
