/**
 * Soft Delete Plugin for Drizzle ORM
 * Provides Sequelize-style paranoid mode functionality
 *
 * Features:
 * - Automatic deletedAt field addition
 * - Query filtering to exclude soft-deleted records
 * - Restore functionality
 * - Force delete option
 */
import { timestamp } from 'drizzle-orm/pg-core';
import { SQL } from 'drizzle-orm';
export interface SoftDeleteOptions {
    deletedAtColumn?: string;
    defaultScope?: boolean;
}
export interface SoftDeleteMixin {
    deletedAt: ReturnType<typeof timestamp>;
}
/**
 * Add soft delete capability to a table schema
 * Usage:
 *   const users = softDeleteTable('users', {
 *     id: uuid('id').primaryKey(),
 *     name: varchar('name', { length: 255 })
 *   });
 */
export declare function withSoftDelete<T extends Record<string, any>>(tableName: string, columns: T, options?: SoftDeleteOptions): T & SoftDeleteMixin;
/**
 * Soft Delete Query Helper
 * Provides methods to work with soft-deleted records
 */
export declare class SoftDeleteHelper {
    private deletedAtColumn;
    constructor(deletedAtColumn?: string);
    /**
     * Get filter to exclude soft-deleted records
     * Usage: where(table, softDelete.excludeDeleted(table))
     */
    excludeDeleted(table: any): SQL;
    /**
     * Get filter to include only soft-deleted records
     * Usage: where(table, softDelete.onlyDeleted(table))
     */
    onlyDeleted(table: any): SQL;
    /**
     * Add soft-delete filter to existing where clause
     * Usage: where(table, and(customFilter, softDelete.withSoftDelete(table)))
     */
    withSoftDelete(table: any, includeDeleted?: boolean): SQL | undefined;
    /**
     * Create a soft-delete timestamp
     * Returns current timestamp for deletedAt field
     */
    markAsDeleted(): Date;
    /**
     * Create a restore value (null for deletedAt)
     * Returns null to restore a soft-deleted record
     */
    markAsRestored(): null;
}
/**
 * Soft Delete Middleware
 * Automatically applies soft-delete filters to queries
 */
export declare class SoftDeleteMiddleware {
    private helper;
    private paranoidMode;
    constructor(paranoidMode?: boolean, deletedAtColumn?: string);
    /**
     * Wrap a where clause with soft-delete filter
     */
    applyFilter(table: any, existingWhere?: SQL, options?: {
        paranoid?: boolean;
    }): SQL | undefined;
    /**
     * Soft delete a record (set deletedAt to current timestamp)
     */
    getSoftDeleteUpdate(): {
        deletedAt: Date;
    };
    /**
     * Restore a soft-deleted record (set deletedAt to null)
     */
    getRestoreUpdate(): {
        deletedAt: null;
    };
}
/**
 * Default soft delete helper instance
 */
export declare const softDeleteHelper: SoftDeleteHelper;
/**
 * Default soft delete middleware instance
 */
export declare const softDeleteMiddleware: SoftDeleteMiddleware;
/**
 * Utility functions for common soft-delete operations
 */
/**
 * Build a soft delete update object
 * Usage: db.update(users).set(softDelete(userId))
 */
export declare function softDelete(userId?: string): {
    userDeleted_Id: string;
    deletedAt: Date;
};
/**
 * Build a restore update object
 * Usage: db.update(users).set(restore())
 */
export declare function restore(): {
    deletedAt: any;
};
/**
 * Check if a record is soft-deleted
 * Usage: if (isSoftDeleted(record)) { ... }
 */
export declare function isSoftDeleted(record: any, deletedAtColumn?: string): boolean;
/**
 * Filter array of records to exclude soft-deleted
 * Usage: const active = filterSoftDeleted(allRecords)
 */
export declare function filterSoftDeleted<T extends Record<string, any>>(records: T[], deletedAtColumn?: string): T[];
/**
 * Filter array of records to include only soft-deleted
 * Usage: const deleted = filterOnlyDeleted(allRecords)
 */
export declare function filterOnlyDeleted<T extends Record<string, any>>(records: T[], deletedAtColumn?: string): T[];
/**
 * Example usage in a query builder wrapper
 */
export declare class SoftDeleteQueryBuilder<T> {
    private table;
    private middleware;
    private withDeleted;
    private onlyDeletedFlag;
    constructor(table: any, paranoidMode?: boolean);
    /**
     * Include soft-deleted records in results
     */
    includeDeleted(): this;
    /**
     * Only return soft-deleted records
     */
    onlyDeleted(): this;
    /**
     * Get the appropriate where clause
     */
    getWhereClause(existingWhere?: SQL): SQL | undefined;
    /**
     * Perform soft delete
     */
    getSoftDeleteData(userId?: string): {
        userDeleted_Id: string;
        deletedAt: Date;
    };
    /**
     * Perform restore
     */
    getRestoreData(): {
        deletedAt: any;
    };
}
declare const _default: {
    withSoftDelete: typeof withSoftDelete;
    SoftDeleteHelper: typeof SoftDeleteHelper;
    SoftDeleteMiddleware: typeof SoftDeleteMiddleware;
    SoftDeleteQueryBuilder: typeof SoftDeleteQueryBuilder;
    softDeleteHelper: SoftDeleteHelper;
    softDeleteMiddleware: SoftDeleteMiddleware;
    softDelete: typeof softDelete;
    restore: typeof restore;
    isSoftDeleted: typeof isSoftDeleted;
    filterSoftDeleted: typeof filterSoftDeleted;
    filterOnlyDeleted: typeof filterOnlyDeleted;
};
export default _default;
//# sourceMappingURL=softDelete.d.ts.map