libs/upp-base/src/modules/platform.ts
platformService is a service that manages platform detection and configuration.
It provides methods and properties to determine the type of device and control the display mode,
as well as emitting events related to configuration changes.
This service is injected at the root level and depends on DeviceDetectorService, Platform, Router, and ActivatedRoute.
Properties |
|
Methods |
Accessors |
constructor(detector: DeviceDetectorService, platform: Platform, router: Router, route: ActivatedRoute)
|
||||||||||||||||||||
|
Constructor that initializes the platform service with required dependencies and sets up the platform configurations.
Parameters :
|
| is | ||||||||
is(_platform: AvailablePlats)
|
||||||||
|
Determines whether the current platform matches the specified type.
Parameters :
Returns :
any
|
| platforms |
platforms()
|
|
Returns an array of detected platform types.
Returns :
Array<AvailablePlats>
An array containing the available platform types. |
| ready |
ready()
|
|
Resolves when the platform is ready.
Returns :
any
A promise that resolves when the platform setup is complete. |
| Public _isDesktop |
Default value : false
|
|
Indicates whether the current device is a desktop device. |
| Public _isMobile |
Default value : false
|
|
Indicates whether the current device is a mobile device. |
| Public OnKioskChanged |
Default value : this._onKioskChanged.asObservable()
|
|
Observable that emits when kiosk mode changes. |
| Public OnThemeChanged |
Default value : this._onThemeChanged.asObservable()
|
|
Observable that emits when the theme changes. |
| DeviceInfo |
getDeviceInfo()
|
|
Retrieves detailed device information from |
| _isKiosk | ||||||
get_isKiosk()
|
||||||
|
Retrieves the current kiosk mode status. |
||||||
set_isKiosk(value)
|
||||||
|
Sets the kiosk mode and emits an event when the mode changes. Kiosk mode can only be enabled if the device is not recognized as a mobile or tablet device.
Parameters :
Returns :
void
|
| _theme | ||||||||
get_theme()
|
||||||||
|
Retrieves the current theme mode.
Returns :
"dark" | "light" | null
|
||||||||
set_theme(value: "dark" | "light")
|
||||||||
|
Sets the current theme mode to either 'dark' or 'light' and emits a change event.
Parameters :
Returns :
void
|
| _zoomLevel | ||||||
get_zoomLevel()
|
||||||
|
Retrieves the current zoom level of the application. |
||||||
set_zoomLevel(value)
|
||||||
|
Sets the current zoom level of the application.
Parameters :
Returns :
void
|
| _scrollbar | ||||||
get_scrollbar()
|
||||||
|
Retrieves the visibility status of the scrollbar. |
||||||
set_scrollbar(value)
|
||||||
|
Toggles the display of the scroll bar based on the provided value.
Parameters :
Returns :
void
|
| RunningOS |
getRunningOS()
|
|
Returns the Operating System information object. |
| Browser |
getBrowser()
|
|
Returns the browser type as a string (e.g., "Chrome", "Safari", "Firefox"). |
| _viewMode | ||||||
set_viewMode(value: string)
|
||||||
|
Parameters :
Returns :
void
|
| IsReady |
getIsReady()
|
|
Returns the platform ready status |
| resize |
getresize()
|
|
Wraps the platform resize event. |
| LegacyMobile |
getLegacyMobile()
|
|
Determines if the current device should be considered as a legacy mobile device. |
| LegacyTablet |
getLegacyTablet()
|
|
Determines if the current device should be considered as a legacy tablet device. |
| LegacyDesktop |
getLegacyDesktop()
|
|
Determines if the current device should be considered as a legacy desktop device. |