hosanna-ui-docs - v0.9.0
    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: AppUtils.AppUtils = ...

    Singleton instance of AppUtils.

    Methods

    • 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

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

      Returns void

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