Logos DX
    Preparing search index...

    Class ConfigStore<H, P, S>

    Manages configuration options for FetchEngine with deep path access.

    Provides a clean API for getting and setting nested configuration values with type-safe paths and automatic event emission on mutations. ConfigStore is the single source of truth for ALL configuration.

    The store is fully typed with EngineConfig, ensuring:

    • get('baseUrl') returns string
    • get('retry.maxAttempts') returns number
    • get('dedupePolicy') returns the correct policy type
    • set('timeout', value) validates value is a number
    // Access via engine.config
    engine.config.get('baseUrl') // string
    engine.config.get('retry.maxAttempts') // number

    // Set options (runtime configurable)
    engine.config.set('baseUrl', 'https://new-api.com')
    engine.config.set('retry.maxAttempts', 5)

    // Merge partial options
    engine.config.set({ retry: { maxAttempts: 5 } })

    Type Parameters

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Get a deep clone of all options or a specific nested value.

      Returns a cloned copy to prevent external mutations. All return types are properly inferred from EngineConfig.

      Returns EngineConfig<H, P, S>

      // Get all options
      const opts = engine.config.get(); // EngineConfig<H, P, S>

      // Get nested value
      const maxAttempts = engine.config.get('retry.maxAttempts'); // number
      const baseUrl = engine.config.get('baseUrl'); // string
    • Get a deep clone of all options or a specific nested value.

      Returns a cloned copy to prevent external mutations. All return types are properly inferred from EngineConfig.

      Type Parameters

      • K extends string

      Parameters

      • path: K

      Returns PathValue<EngineConfig<H, P, S>, K>

      // Get all options
      const opts = engine.config.get(); // EngineConfig<H, P, S>

      // Get nested value
      const maxAttempts = engine.config.get('retry.maxAttempts'); // number
      const baseUrl = engine.config.get('baseUrl'); // string
    • Set options by path-value or by partial object merge.

      Emits 'options-change' event after successful update. All values are type-checked against EngineConfig.

      Type Parameters

      • K extends string

      Parameters

      Returns void

      // Set by path (type-checked)
      engine.config.set('baseUrl', 'https://new-api.com'); // OK
      engine.config.set('retry.maxAttempts', 5); // OK
      engine.config.set('retry.maxAttempts', 'five'); // Type error!

      // Merge partial options
      engine.config.set({ retry: { maxAttempts: 5 } });
    • Set options by path-value or by partial object merge.

      Emits 'options-change' event after successful update. All values are type-checked against EngineConfig.

      Type Parameters

      • K extends string

      Parameters

      • path: K
      • value: undefined

      Returns void

      // Set by path (type-checked)
      engine.config.set('baseUrl', 'https://new-api.com'); // OK
      engine.config.set('retry.maxAttempts', 5); // OK
      engine.config.set('retry.maxAttempts', 'five'); // Type error!

      // Merge partial options
      engine.config.set({ retry: { maxAttempts: 5 } });
    • Set options by path-value or by partial object merge.

      Emits 'options-change' event after successful update. All values are type-checked against EngineConfig.

      Parameters

      Returns void

      // Set by path (type-checked)
      engine.config.set('baseUrl', 'https://new-api.com'); // OK
      engine.config.set('retry.maxAttempts', 5); // OK
      engine.config.set('retry.maxAttempts', 'five'); // Type error!

      // Merge partial options
      engine.config.set({ retry: { maxAttempts: 5 } });