Singleton class that manages warnings across the entire application session. Tracks which warnings have been shown and batches them for clean, grouped output.

Constructors

Properties

debounceTimer: Timeout = null
pendingEntityDeprecationWarnings: Map<string, PendingEntityDeprecationWarning> = ...
pendingFieldDeprecationWarnings: Map<string, PendingFieldDeprecationWarning[]> = ...
pendingFieldNotFoundWarnings: Map<string, PendingFieldNotFoundWarning[]> = ...
pendingRedundantLoadWarnings: Map<string, PendingRedundantLoadWarning> = ...
warnedDeprecatedEntities: Set<string> = ...
warnedDeprecatedFields: Map<string, Set<string>> = ...
warnedFieldNotFound: Map<string, Set<string>> = ...
warnedRedundantLoads: Set<string> = ...
instance: WarningManager

Accessors

Methods

  • Immediately flushes all pending warnings to the console. Can be called manually to force output before the debounce period.

    Returns void

  • Records a deprecation warning for an entity.

    Parameters

    • entityName: string

      The name of the deprecated entity

    • callerName: string

      The name of the caller (e.g., 'BaseEntity::constructor')

    Returns boolean

    true if this warning should be emitted immediately (when ShowAll is true)

  • Records a deprecation warning for an entity field.

    Parameters

    • entityName: string

      The name of the entity containing the deprecated field

    • fieldName: string

      The name of the deprecated field

    • callerName: string

      The name of the caller (e.g., 'AIPromptEntity::validate')

    Returns boolean

    true if this warning should be emitted immediately (when ShowAll is true)

  • Records a warning when a field is not found in an entity definition. This typically occurs during data loading when source data contains fields that don't exist in the entity schema.

    Parameters

    • entityName: string

      The name of the entity where the field was not found

    • fieldName: string

      The name of the field that was not found

    • context: string

      Context description (e.g., 'BaseEntity::SetMany during data load')

    Returns boolean

    true if this warning should be emitted immediately (when ShowAll is true)

  • Records a warning when multiple engines load the same entity data. This helps developers identify redundant data loading that could be optimized.

    Parameters

    • entityName: string

      The name of the entity being loaded

    • engines: string[]

      Array of engine class names that have loaded this entity

    Returns boolean

    true if this is a new warning that will be emitted

  • Resets all tracking state. Useful for testing or starting fresh. Does NOT clear pending warnings - call FlushWarnings first if needed.

    Returns void

  • Updates the configuration for the warning system. This allows runtime customization of behavior.

    Parameters

    Returns void

  • Internal method that formats and outputs all pending warnings.

    Returns void

  • Schedules a flush of pending warnings after the debounce period. Resets the timer if new warnings arrive.

    Returns void