Kfg Documentation
    Preparing search index...

    Class KfgDriver<Config, Async>Abstract

    Type Parameters

    • Config extends Record<string, any>
    • Async extends boolean

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    async: Async
    config: Config
    forceExit: boolean
    name: string

    Methods

    • Optional hook for deletion. Use this ONLY if the driver handles atomic deletion. If implemented, Kfg.del() will call this INSTEAD of save().

      Parameters

      • key: string

        The key deleted.

      Returns inPromise<Async, void>

    • Optional hook to format validation errors.

      Parameters

      • errors: any[]

        The array of errors from TypeBox/Value.

      Returns string

      A formatted string or undefined to use default formatting.

    • Parameters

      • target: object
      • source: object

      Returns any

    • Saves the configuration to the source.

      Parameters

      • data: Record<string, any>

        The full configuration object.

      • Optionaloptions: { description?: string; path?: string }

        Optional metadata for the save operation (e.g. description for a specific update).

      Returns inPromise<Async, void>

    • Optional hook for updates. Use this ONLY if the driver handles atomic updates and doesn't need the full object every time. If implemented, Kfg.set() will call this INSTEAD of save().

      Parameters

      • key: string

        The key updated (dot notation).

      • value: any

        The new value.

      • Optionaldescription: string

      Returns inPromise<Async, void>