@theredhead — Frontend Library - v1.0.0
    Preparing search index...

    Strategy interface for key-value storage.

    Implement this interface to provide alternative storage backends (e.g. sessionStorage, in-memory, IndexedDB, or a server-side store).

    All methods should handle errors internally and never throw.

    interface IStorageStrategy {
        getItem(key: string): string | null;
        removeItem(key: string): void;
        setItem(key: string, value: string): void;
    }

    Implemented by

    Index

    Methods

    • Retrieve a value by key. Returns null when the key does not exist.

      Parameters

      • key: string

      Returns string | null

    • Remove the value for the given key.

      Parameters

      • key: string

      Returns void

    • Store a value under the given key.

      Parameters

      • key: string
      • value: string

      Returns void