import type { Buffer } from '../../../lib/utils/buffer.js';
/**
 * Result of a validation operation
 */
export type ValidationResult = {
    valid: true;
} | {
    valid: false;
    error: string;
};
/**
 * Interface for namespace validators that validate content at specific paths
 */
export interface NamespaceValidator {
    /**
     * Path pattern this validator applies to.
     * Can be a glob pattern string or a RegExp.
     *
     * @example
     * pathPattern: "/user/*"  // Glob: matches paths under /user/
     * @example
     * pathPattern: /^\/user\/[^/]+\/icon$/  // RegExp: matches user icons
     */
    pathPattern: string | RegExp;
    /**
     * Validate decrypted content before storage.
     * Called only when anchor can decrypt (i.e., anchor is a principal).
     *
     * @param path - The full storage path
     * @param content - The decrypted content
     * @param mimeType - The mime-type from inside the EncryptedContainer
     * @returns ValidationResult indicating if the content is valid
     */
    validate(path: string, content: Buffer, mimeType: string): Promise<ValidationResult>;
}
/**
 * Checks if a path matches a validator's pattern
 */
export declare function matchesPattern(path: string, pattern: string | RegExp): boolean;
/**
 * Finds all validators that match a given path
 */
export declare function findMatchingValidators(path: string, validators: NamespaceValidator[]): NamespaceValidator[];
/**
 * Checks if a path requires validation (matches any validator pattern)
 */
export declare function requiresValidation(path: string, validators: NamespaceValidator[]): boolean;
/**
 * Abstract base class for content validators.
 * Provides common validation logic for mime type and size checking.
 * Subclasses should override validateContent for custom validation.
 */
export declare abstract class ContentValidator implements NamespaceValidator {
    abstract readonly pathPattern: string | RegExp;
    abstract readonly maxSize: number;
    abstract readonly allowedMimeTypes: readonly string[];
    validate(path: string, content: Buffer, mimeType: string): Promise<ValidationResult>;
    /**
     * Override to add custom content validation beyond mime type and size checks.
     * Default implementation accepts all content that passes basic checks.
     */
    protected validateContent(_ignorePath: string, _ignoreContent: Buffer, _ignoreMimeType: string): Promise<ValidationResult>;
}
//# sourceMappingURL=validators.d.ts.map