import type { ExecutionResult, GraphQLSchema, ValidationRule } from 'graphql';
import type { OperationArgs, Request as graphQLRequest } from 'graphql-http';
import type { SendMailOptions } from 'nodemailer';
import type pino from 'pino';
import type { AuthArgs } from './auth/operations/auth.js';
import type { Result as ForgotPasswordResult } from './auth/operations/forgotPassword.js';
import type { Options as ForgotPasswordOptions } from './auth/operations/local/forgotPassword.js';
import type { Options as LoginOptions } from './auth/operations/local/login.js';
import type { Options as ResetPasswordOptions } from './auth/operations/local/resetPassword.js';
import type { Options as UnlockOptions } from './auth/operations/local/unlock.js';
import type { Options as VerifyEmailOptions } from './auth/operations/local/verifyEmail.js';
import type { Result as LoginResult } from './auth/operations/login.js';
import type { Result as ResetPasswordResult } from './auth/operations/resetPassword.js';
import type { AuthStrategy } from './auth/types.js';
import type { BulkOperationResult, Collection, TypeWithID } from './collections/config/types.js';
import type { Options as CreateOptions } from './collections/operations/local/create.js';
import type { ByIDOptions as DeleteByIDOptions, ManyOptions as DeleteManyOptions } from './collections/operations/local/delete.js';
import type { Options as DuplicateOptions } from './collections/operations/local/duplicate.js';
import type { Options as FindOptions } from './collections/operations/local/find.js';
import type { Options as FindByIDOptions } from './collections/operations/local/findByID.js';
import type { Options as FindVersionByIDOptions } from './collections/operations/local/findVersionByID.js';
import type { Options as FindVersionsOptions } from './collections/operations/local/findVersions.js';
import type { Options as RestoreVersionOptions } from './collections/operations/local/restoreVersion.js';
import type { ByIDOptions as UpdateByIDOptions, ManyOptions as UpdateManyOptions } from './collections/operations/local/update.js';
import type { EmailOptions, InitOptions, SanitizedConfig } from './config/types.js';
import type { BaseDatabaseAdapter, PaginatedDocs } from './database/types.js';
import type { BuildEmailResult } from './email/types.js';
import type { TypeWithID as GlobalTypeWithID, Globals } from './globals/config/types.js';
import type { Options as FindGlobalOptions } from './globals/operations/local/findOne.js';
import type { Options as FindGlobalVersionByIDOptions } from './globals/operations/local/findVersionByID.js';
import type { Options as FindGlobalVersionsOptions } from './globals/operations/local/findVersions.js';
import type { Options as RestoreGlobalVersionOptions } from './globals/operations/local/restoreVersion.js';
import type { Options as UpdateGlobalOptions } from './globals/operations/local/update.js';
import type { TypeWithVersion } from './versions/types.js';
import { decrypt, encrypt } from './auth/crypto.js';
/**
 * @description Payload
 */
export declare class BasePayload<TGeneratedTypes extends GeneratedTypes> {
    /**
     * @description Authorization and Authentication using headers and cookies to run auth user strategies
     * @returns cookies: Map<string, string>
     * @returns permissions: Permissions
     * @returns user: User
     */
    auth: (options: AuthArgs) => Promise<import("./auth/operations/auth.js").AuthResult>;
    authStrategies: AuthStrategy[];
    collections: {
        [slug: number | string | symbol]: Collection;
    };
    config: SanitizedConfig;
    /**
     * @description Performs create operation
     * @param options
     * @returns created document
     */
    create: <T extends keyof TGeneratedTypes["collections"]>(options: CreateOptions<T>) => Promise<TGeneratedTypes['collections'][T]>;
    db: DatabaseAdapter;
    decrypt: typeof decrypt;
    duplicate: <T extends keyof TGeneratedTypes["collections"]>(options: DuplicateOptions<T>) => Promise<TGeneratedTypes['collections'][T]>;
    email: BuildEmailResult;
    emailOptions: EmailOptions;
    encrypt: typeof encrypt;
    extensions: (args: {
        args: OperationArgs<any>;
        req: graphQLRequest<unknown, unknown>;
        result: ExecutionResult;
    }) => Promise<any>;
    /**
     * @description Find documents with criteria
     * @param options
     * @returns documents satisfying query
     */
    find: <T extends keyof TGeneratedTypes["collections"]>(options: FindOptions<T>) => Promise<PaginatedDocs<TGeneratedTypes['collections'][T]>>;
    /**
     * @description Find document by ID
     * @param options
     * @returns document with specified ID
     */
    findByID: <T extends keyof TGeneratedTypes["collections"]>(options: FindByIDOptions<T>) => Promise<TGeneratedTypes['collections'][T]>;
    findGlobal: <T extends keyof TGeneratedTypes["globals"]>(options: FindGlobalOptions<T>) => Promise<TGeneratedTypes['globals'][T]>;
    /**
     * @description Find global version by ID
     * @param options
     * @returns global version with specified ID
     */
    findGlobalVersionByID: <T extends keyof TGeneratedTypes["globals"]>(options: FindGlobalVersionByIDOptions<T>) => Promise<TypeWithVersion<TGeneratedTypes['globals'][T]>>;
    /**
     * @description Find global versions with criteria
     * @param options
     * @returns versions satisfying query
     */
    findGlobalVersions: <T extends keyof TGeneratedTypes["globals"]>(options: FindGlobalVersionsOptions<T>) => Promise<PaginatedDocs<TypeWithVersion<TGeneratedTypes['globals'][T]>>>;
    /**
     * @description Find version by ID
     * @param options
     * @returns version with specified ID
     */
    findVersionByID: <T extends keyof TGeneratedTypes["collections"]>(options: FindVersionByIDOptions<T>) => Promise<TypeWithVersion<TGeneratedTypes['collections'][T]>>;
    /**
     * @description Find versions with criteria
     * @param options
     * @returns versions satisfying query
     */
    findVersions: <T extends keyof TGeneratedTypes["collections"]>(options: FindVersionsOptions<T>) => Promise<PaginatedDocs<TypeWithVersion<TGeneratedTypes['collections'][T]>>>;
    forgotPassword: <T extends keyof TGeneratedTypes["collections"]>(options: ForgotPasswordOptions<T>) => Promise<ForgotPasswordResult>;
    getAPIURL: () => string;
    getAdminURL: () => string;
    globals: Globals;
    logger: pino.Logger;
    login: <T extends keyof TGeneratedTypes["collections"]>(options: LoginOptions<T>) => Promise<LoginResult & {
        user: TGeneratedTypes['collections'][T];
    }>;
    resetPassword: <T extends keyof TGeneratedTypes["collections"]>(options: ResetPasswordOptions<T>) => Promise<ResetPasswordResult>;
    /**
     * @description Restore global version by ID
     * @param options
     * @returns version with specified ID
     */
    restoreGlobalVersion: <T extends keyof TGeneratedTypes["globals"]>(options: RestoreGlobalVersionOptions<T>) => Promise<TGeneratedTypes['globals'][T]>;
    /**
     * @description Restore version by ID
     * @param options
     * @returns version with specified ID
     */
    restoreVersion: <T extends keyof TGeneratedTypes["collections"]>(options: RestoreVersionOptions<T>) => Promise<TGeneratedTypes['collections'][T]>;
    schema: GraphQLSchema;
    secret: string;
    sendEmail: (message: SendMailOptions) => Promise<unknown>;
    types: {
        arrayTypes: any;
        blockInputTypes: any;
        blockTypes: any;
        fallbackLocaleInputType?: any;
        groupTypes: any;
        localeInputType?: any;
        tabTypes: any;
    };
    unlock: <T extends keyof TGeneratedTypes["collections"]>(options: UnlockOptions<T>) => Promise<boolean>;
    updateGlobal: <T extends keyof TGeneratedTypes["globals"]>(options: UpdateGlobalOptions<T>) => Promise<TGeneratedTypes['globals'][T]>;
    validationRules: (args: OperationArgs<any>) => ValidationRule[];
    verifyEmail: <T extends keyof TGeneratedTypes["collections"]>(options: VerifyEmailOptions<T>) => Promise<boolean>;
    versions: {
        [slug: string]: any;
    };
    /**
     * @description delete one or more documents
     * @param options
     * @returns Updated document(s)
     */
    delete<T extends keyof TGeneratedTypes['collections']>(options: DeleteByIDOptions<T>): Promise<TGeneratedTypes['collections'][T]>;
    delete<T extends keyof TGeneratedTypes['collections']>(options: DeleteManyOptions<T>): Promise<BulkOperationResult<T>>;
    /**
     * @description Initializes Payload
     * @param options
     */
    init(options: InitOptions): Promise<Payload>;
    update<T extends keyof TGeneratedTypes['collections']>(options: UpdateManyOptions<T>): Promise<BulkOperationResult<T>>;
    /**
     * @description Update one or more documents
     * @param options
     * @returns Updated document(s)
     */
    update<T extends keyof TGeneratedTypes['collections']>(options: UpdateByIDOptions<T>): Promise<TGeneratedTypes['collections'][T]>;
}
declare const initialized: BasePayload<GeneratedTypes>;
export default initialized;
export declare const getPayload: (options: InitOptions) => Promise<BasePayload<GeneratedTypes>>;
type GeneratedTypes = {
    collections: {
        [slug: number | string | symbol]: TypeWithID & Record<string, unknown>;
    };
    globals: {
        [slug: number | string | symbol]: GlobalTypeWithID & Record<string, unknown>;
    };
    locale: null | string;
    user: TypeWithID & Record<string, unknown> & {
        collection: string;
    };
};
type Payload = BasePayload<GeneratedTypes>;
interface RequestContext {
    [key: string]: unknown;
}
type DatabaseAdapter = BaseDatabaseAdapter;
export type { DatabaseAdapter, GeneratedTypes, Payload, RequestContext };
//# sourceMappingURL=index.d.ts.map