Hosanna UI API v1.40.0-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

    • Returns BaseApp.BaseApp

      Retained for backwards compatibility. New framework code should use HosannaAppUtils for UI-dependent helpers.

    • Returns AsyncCommand

      Retained for backwards compatibility. New framework code should use HosannaAppUtils for UI-dependent helpers.

    • 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.

    • Parameters

      Returns void

      Use HosannaAppUtils.sayAudioGuideItem.

    • Parameters

      • text: string
      • Optionalpriority: number
      • Optional_origin: IHosannaView<ViewState>
      • OptionalflushPrevious: boolean

      Returns void

      Use HosannaAppUtils.sayText.

    • Parameters

      • level: SystemMessageLevel
      • text: string

      Returns void

      Use HosannaAppUtils.sendSystemMessage.

    • 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.