pCon.basket - Plugin Development
    Preparing search index...

    Interface SettingsStorage

    Synchronous settings storage.

    interface SettingsStorage {
        getSettingJson<T>(pGroupKey: string, pKey: string): T | undefined;
        getSettingString(pGroupKey: string, pKey: string): string | undefined;
        setSettingJson(pGroupKey: string, pKey: string, pValue: unknown): void;
        setSettingString(
            pGroupKey: string,
            pKey: string,
            pValue: string | undefined,
        ): void;
    }
    Index
    • Retrieves the persisted value of a setting. The value will be parsed as a JSON string. Undefined will be returend if the setting does currently not have a value.

      Type Parameters

      • T

      Parameters

      • pGroupKey: string
      • pKey: string

      Returns T | undefined

    • Retrieves the persisted string value of a setting. undefined will be returend if the setting does not have a value yet.

      Parameters

      • pGroupKey: string
      • pKey: string

      Returns string | undefined

    • Sets or overrides the persisted value of a setting. Values have to be serializable as a JSON string. The group key should be a unique identifer (e.g. a plugin name or vendor) undefined can be used as value to delete the setting the setting from the storage.

      Parameters

      • pGroupKey: string
      • pKey: string
      • pValue: unknown

      Returns void

    • Sets or overrides the persisted string value of a setting. The group key should be a unique identifer (e.g. a plugin name or vendor) undefined can be used as value to delete the setting from the storage.

      Parameters

      • pGroupKey: string
      • pKey: string
      • pValue: string | undefined

      Returns void