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

    Interface AsyncSettingsStorage

    Asynchronous settings storage.

    interface AsyncSettingsStorage {
        getSettingJson<T>(
            pGroupKey: string,
            pKey: string,
        ): Promise<T | undefined>;
        getSettingString(
            pGroupKey: string,
            pKey: string,
        ): Promise<string | undefined>;
        setSettingJson(
            pGroupKey: string,
            pKey: string,
            pValue: unknown,
        ): Promise<void>;
        setSettingString(
            pGroupKey: string,
            pKey: string,
            pValue: string | undefined,
        ): Promise<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 Promise<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 Promise<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 Promise<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 Promise<void>