Kfg Documentation
    Preparing search index...

    Class Kfg<D, S>

    The main class for Kfg. It is responsible for loading and managing the configuration.

    Type Parameters

    Index

    Constructors

    • Creates a new instance of Kfg.

      Type Parameters

      Parameters

      • driver: D

        The driver instance.

      • schema: S

        The schema to use for validating the configuration.

      Returns Kfg<D, S>

    Properties

    $store: KfgStore = ...
    driver: D
    schema: S

    Accessors

    • get $config(): D["config"]

      Returns the driver configuration from the store.

      Returns D["config"]

    Methods

    • Deletes a value from the configuration.

      Type Parameters

      • P extends string

      Parameters

      • path: P

      Returns inPromise<D["async"], void>

    • Checks if a value exists in the configuration.

      Type Parameters

      • P extends string

      Parameters

      • ...paths: P[]

        The paths to the values.

      Returns inPromise<D["async"], boolean>

      True if all values exist, false otherwise.

    • Alias for mount().

      Parameters

      • Optionaloptions: Partial<D["config"]> & { only_importants?: boolean }

      Returns inPromise<D["async"], void>

    • Mounts the configuration using the driver.

      Parameters

      • Optionaloptions: D["config"] & { only_importants?: boolean }

        The loading options.

      Returns inPromise<D["async"], void>

    • Reloads the configuration.

      Parameters

      • Optionaloptions: Partial<D["config"]> & { only_importants?: boolean }

        The loading options.

      Returns inPromise<D["async"], void>

    • Saves the configuration.

      Parameters

      • Optionaldata: any

        Optional data to save.

      Returns inPromise<D["async"], void>

    • Unmounts the driver.

      Returns void