Class: AppViewService

Handle and track page/popup usage for an App

 

Properties

 

currentUiView

Readonly currentUiView: Subscribable<null | UiViewEntry<UiViewRef>>

The page that is currently open in the active view stack.

 

Methods

 

registerView

registerView(key, type, vNodeFactory, options?): UiViewEntry<UiViewRef>

Registers and renders a view (page or popup) to be opened by the service.

 

Parameters
Name Type Description
key string The UiView string key.
type ViewType The view type
vNodeFactory () => TVNode<UiView<UiViewProps>, UiViewProps> A function that returns a UiView VNode for the key
options? Partial<ViewOptions> The UiView ViewOptions

 

Returns

UiViewEntry<UiViewRef>

UiViewEntry

 


 

unload

unload(): void

Destroys every view in registered view entries and resets the view stack.

 

Returns

void

 


 

initialize

initialize(homePageUiViewKey): Promise<void>

 

Parameters
Name Type Description
homePageUiViewKey string the string key of the UiView

 

Returns

Promise<void>

a Promise resolving when all pages are initialized

 


 

onAppContainerRendered

onAppContainerRendered(appViewRef): void

Called by AppContainer to pass in the refs to the view. Should only be called once.

 

Parameters
Name Type Description
appViewRef AppViewContainer The app view ref.

 

Returns

void

 


 

openPage

openPage<Ref>(key): PublicUiViewEntry<Ref>

Opens a UiView as a page and adds it to the stack.

 

Type parameters
Name Type
Ref UiViewRef

 

Parameters
Name Type Description
key string The UiView string key

 

Returns

PublicUiViewEntry<Ref>

the PublicUiViewEntry entry of the UiView

Deprecated

This method has been deprecated in favor of using AppViewService.open.

 


 

openPopup

openPopup<Ref>(key): PublicUiViewEntry<Ref>

Opens a UiView as a popup. The UiView will be brought to the top of the current view stack as the active view

 

Type parameters
Name Type
Ref UiViewRef

 

Parameters
Name Type Description
key string The UiView string key

 

Returns

PublicUiViewEntry<Ref>

the PublicUiViewEntry entry of the UiView

Deprecated

This method has been deprecated in favor of using AppViewService.open.

 


 

goBack

goBack(): undefined | PublicUiViewEntry<UiViewRef>

Returns the most recent previous history state of the view stack

 

Returns

undefined | PublicUiViewEntry<UiViewRef>

the PublicUiViewEntry entry of the previous UiView

 

 


 

update

update(time): void

Updates all the pages/popups that are initialized and visible

 

Parameters
Name Type Description
time number timestamp

 

Returns

void

 


 

routeGamepadInteractionEvent

routeGamepadInteractionEvent(gamepadEvent): void

Routes the event to the current UiView

 

Parameters
Name Type Description
gamepadEvent GamepadEvents the GamepadEvents

 

Returns

void