/** * QA360 Storage Helpers Module * * P0: Simplified access to browser storage APIs * - LocalStorage helpers with type safety * - SessionStorage helpers with type safety * - JSON serialization/deserialization * - Prefix support for namespacing */ import type { Page } from '@playwright/test'; /** * Storage options */ export interface StorageOptions { /** Key prefix for namespacing */ prefix?: string; /** Auto-parse JSON values */ json?: boolean; } /** * Storage get result with metadata */ export interface StorageResult { /** Whether the key exists */ exists: boolean; /** The value (parsed if json=true) */ value: T | null; /** The raw string value */ rawValue: string | null; } /** * LocalStorage Helper */ export declare class LocalStorage { private page; private options; constructor(page: Page, options?: StorageOptions); /** * Get a value from localStorage */ get(key: string): Promise>; /** * Set a value in localStorage */ set(key: string, value: unknown): Promise; /** * Remove a value from localStorage */ remove(key: string): Promise; /** * Check if a key exists */ has(key: string): Promise; /** * Get all keys (with prefix if configured) */ keys(): Promise; /** * Clear all keys (with prefix if configured) */ clear(): Promise; /** * Get the number of items (with prefix if configured) */ size(): Promise; /** * Get all items as an object (with prefix stripped if configured) */ getAll(): Promise>; /** * Set multiple items at once */ setMany(items: Record): Promise; /** * Remove multiple items at once */ removeMany(keys: string[]): Promise; private getFullKey; private tryParseJSON; } /** * SessionStorage Helper */ export declare class SessionStorage { private page; private options; constructor(page: Page, options?: StorageOptions); /** * Get a value from sessionStorage */ get(key: string): Promise>; /** * Set a value in sessionStorage */ set(key: string, value: unknown): Promise; /** * Remove a value from sessionStorage */ remove(key: string): Promise; /** * Check if a key exists */ has(key: string): Promise; /** * Get all keys (with prefix if configured) */ keys(): Promise; /** * Clear all keys (with prefix if configured) */ clear(): Promise; /** * Get the number of items (with prefix if configured) */ size(): Promise; /** * Get all items as an object (with prefix stripped if configured) */ getAll(): Promise>; /** * Set multiple items at once */ setMany(items: Record): Promise; /** * Remove multiple items at once */ removeMany(keys: string[]): Promise; private getFullKey; private tryParseJSON; } /** * Convenience function to create LocalStorage helper */ export declare function createLocalStorage(page: Page, options?: StorageOptions): LocalStorage; /** * Convenience function to create SessionStorage helper */ export declare function createSessionStorage(page: Page, options?: StorageOptions): SessionStorage;