import type { PathPolicy, PathPolicyContext, FullStorageBackend, StorageObjectMetadata, StoragePutMetadata, StorageGetResult, SearchCriteria, SearchPagination, SearchResults, QuotaStatus, QuotaLimits, UploadReservation } from './common.js';
import type { KeetaStorageAnchorProvider } from './client.js';
import { KeetaNet } from '../../client/index.js';
import { Buffer } from '../../lib/utils/buffer.js';
import KeetaStorageAnchorClient from './client.js';
/**
 * Parsed path for the test path policy: /user/<pubkey>/<relativePath>
 */
export type TestParsedPath = {
    path: string;
    owner: string;
    relativePath: string;
};
/**
 * Test path policy implementing the /user/<pubkey>/<path> pattern.
 * Owner-based access control: only the owner can access their namespace.
 */
export declare class TestPathPolicy implements PathPolicy<TestParsedPath> {
    #private;
    parse(path: string): TestParsedPath | null;
    validate(path: string): TestParsedPath;
    isValid(path: string): boolean;
    checkAccess(account: InstanceType<typeof KeetaNet.lib.Account>, parsed: TestParsedPath, _ignoreOperation: 'get' | 'put' | 'delete' | 'search' | 'metadata'): boolean;
    getAuthorizedSigner(parsed: TestParsedPath): InstanceType<typeof KeetaNet.lib.Account> | null;
    getOwner(path: string): string;
    validateContext(parsed: TestParsedPath, context: PathPolicyContext): void;
    /**
     * Helper to construct a path for a given owner and relative path.
     */
    makePath(owner: string, relativePath: string): string;
    /**
     * Helper to get the namespace prefix for an owner.
     */
    getNamespacePrefix(owner: string): string;
}
/**
 * Shared instance of TestPathPolicy for use in tests.
 */
export declare const testPathPolicy: TestPathPolicy;
/**
 * Create test metadata with sensible defaults.
 */
export declare function testMetadata(owner: string, overrides?: Partial<StoragePutMetadata>): StoragePutMetadata;
/**
 * Create test object metadata with sensible defaults.
 */
export declare function testObjectMetadata(path: string, owner: string, overrides?: Partial<StorageObjectMetadata>): StorageObjectMetadata;
/**
 * In-memory storage backend with full capabilities: CRUD, search, and quota management.
 * Intended for testing and development purposes.
 */
export declare class MemoryStorageBackend implements FullStorageBackend {
    #private;
    private storage;
    private reservations;
    private reservationCounter;
    private readonly quotaConfig;
    put(path: string, data: Buffer, metadata: StoragePutMetadata): Promise<StorageObjectMetadata>;
    get(path: string): Promise<StorageGetResult | null>;
    delete(path: string): Promise<boolean>;
    updateMetadata(path: string, metadata: Omit<StoragePutMetadata, 'owner'>): Promise<StorageObjectMetadata | null>;
    search(criteria: SearchCriteria, pagination: SearchPagination): Promise<SearchResults>;
    getQuotaStatus(owner: string): Promise<QuotaStatus>;
    getQuotaLimits(owner: string): Promise<QuotaLimits | null>;
    setQuotaLimits(owner: string, limits: QuotaLimits): void;
    reserveUpload(owner: string, path: string, size: number, options?: {
        ttlMs?: number;
        quotaLimits?: {
            maxObjectsPerUser: number;
            maxStoragePerUser: number;
        };
    }): Promise<UploadReservation>;
    commitUpload(reservationId: string): Promise<void>;
    releaseUpload(reservationId: string): Promise<void>;
    clear(): void;
    get size(): number;
}
export type Account = InstanceType<typeof KeetaNet.lib.Account>;
export declare function randomSeed(): string | ArrayBuffer;
export interface StorageProviderTestContext {
    provider: KeetaStorageAnchorProvider;
    account: Account;
    storageClient: KeetaStorageAnchorClient;
}
/**
 * Shared test harness that stands up a storage server, resolves a provider,
 * and passes the provider context to the test function.
 */
export declare function withStorageProvider(seed: string | ArrayBuffer, testFunction: (ctx: StorageProviderTestContext) => Promise<void>): Promise<void>;
//# sourceMappingURL=test-utils.d.ts.map