Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ScreenManager

Hierarchy

  • ScreenManager

Index

Properties

Readonly screenWrapper

screenWrapper: Component<HTMLElement> = new Component().setId("screens").appendTo("body")

Methods

all

  • Streams all initialized screens.

    Returns Stream<Screen>

get

  • get<S>(screenId: ScreenId): S | undefined
  • Returns a screen, or undefined, if the screen is not initialized.

    Type parameters

    Parameters

    • screenId: ScreenId

      The ID of the screen to return

    Returns S | undefined

getTop

  • getTop<S>(): undefined | S
  • Returns the "top" screen.

    There are two screen layers:

    1. The main layer
    2. The overlay layer

    The overlay layer is always in front of the main layer, therefore if there is no overlay screen visible, this method returns the main layer screen. Otherwise, this method returns the overlay layer screen.

    Type parameters

    Returns undefined | S

hide

  • Hides the given screen, or the current screen if none is passed.

    Parameters

    Returns void

initialize

  • If the screen by the given ID is not already initialized, initializes it.

    Type parameters

    Parameters

    • screenId: ScreenId

      The ID of the screen to initialize

    Returns S

    The initialized screen

isTop

  • Returns if the given screen id is the "top" screen.

    There are two screen layers:

    1. The main layer
    2. The overlay layer

    The overlay layer is always in front of the main layer, therefore if there is no overlay screen visible, this method returns if the given screen ID is the main layer screen. Otherwise, this method returns if the given screen ID is the overlay layer screen.

    Parameters

    Returns boolean

isVisible

  • isVisible(screenId: ScreenId): boolean
  • Returns if the given screen id is a currently visible screen (either the main screen or the overlay screen).

    Parameters

    Returns boolean

show

  • show<S>(screenId: ScreenId, screenInitializer?: undefined | ((screen: S) => any)): S extends undefined | null ? never : S
  • Shows a screen

    Type parameters

    Parameters

    • screenId: ScreenId

      The id of the screen to show

    • Optional screenInitializer: undefined | ((screen: S) => any)

    Returns S extends undefined | null ? never : S

Generated using TypeDoc