Member Junction
    Preparing search index...

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

    Uses BaseSingleton to guarantee a single instance across the entire process, even if bundlers duplicate this module across multiple execution paths.

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    • get GlobalKey(): string

      Returns string

    Methods

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

      Returns void

    • The Global Object Store is a place to store global objects that need to be shared across the application. Depending on the execution environment, this could be the window object in a browser, or the global object in a node environment, or something else in other contexts. The key here is that in some cases static variables are not truly shared because it is possible that a given class might have copies of its code in multiple paths in a deployed application. This approach ensures that no matter how many code copies might exist, there is only one instance of the object in question by using the Global Object Store.

      Returns GlobalObjectStore | null

    • 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., 'MJAIPromptEntity::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

    • Returns the singleton instance of the class. If the instance does not exist, it is created and stored in the Global Object Store. If className is provided it will be used as part of the key in the Global Object Store, otherwise the actual class name will be used. NOTE: the class name used by default is the lowest level of the object hierarchy, so if you have a class that extends another class, the lowest level class name will be used.

      Type Parameters

      Parameters

      • this: new () => T
      • OptionalclassName: string

      Returns T