Hosanna UI API v1.30.2-next
    Preparing search index...

    AppUtils is a utility class that provides helper methods for platform detection, dependency resolution, timer management, and accessing application-level services.

    Index

    Constructors

    Properties

    __hs_global: any

    Global platform-specific object, decorated with @platformGlobal.

    _instance: undefined | AppUtils.AppUtils

    Singleton instance of AppUtils.

    Accessors

    Methods

    • Clears a timer with the specified timer ID.

      Parameters

      • timerId: number

        The ID of the timer to clear.

      Returns void

    • Type Parameters

      • T

      Parameters

      • key: string
      • OptionaldefaultValue: unknown

      Returns T

    • Type Parameters

      • T

      Parameters

      • key: string

      Returns T

      Use getBuildConfig.

    • Registers a service in the global container.

      Parameters

      • key: string

        The key to associate with the service.

      • service: any

        The service instance to register.

      Returns void

    • Resolves a dependency from the global container or IoC container. Throws an error if the dependency is required but not found.

      Type Parameters

      • T

      Parameters

      • key: string

        The key of the dependency to resolve.

      • isRequired: boolean = true

        Whether the dependency is required (default: true).

      Returns T

      The resolved dependency instance.

      Error if the dependency is required but not found.

    • Sets a timer with the specified callback, interval, and repeat flag.

      Parameters

      • callback: Function

        The function to execute when the timer elapses.

      • interval: number

        The interval in milliseconds.

      • repeat: boolean = false

        Whether the timer should repeat (default: false).

      Returns number

      The timer ID.