LynxSystemInfo
Device and platform facts, such as the screen size and the operating system. import { LynxSystemInfo } from '@blotch/angular-lynx';
Usage
API
LynxSystemInfo
Reads Lynx's global SystemInfo. Lynx fills it in once when the page starts, so the values never change and aren't signals. osVersion is the exception, below.
- Creating it throws outside Lynx, such as in unit tests.
LynxSystemInfo.platform
The platform, such as 'iOS', 'Android' or 'web'. See PlatformType for every value.
LynxSystemInfo.osVersion
The operating system's version, such as '26.1' on iOS or '15' on Android. Empty while it isn't known.
- On iOS and Android, Lynx leaves it out of the SystemInfo your components see, so it comes from elsewhere. The apps
ng build --platformmakes send it as theosVersionglobal prop. Your own native app can send it the same way. - Without the global prop, it's asked of the background thread, which has it, and arrives shortly after the first frame. Reading it in a
computed()picks the answer up.
LynxSystemInfo.engineVersion
The Lynx engine's version, such as '3.2'.
LynxSystemInfo.pixelWidth and pixelHeight
The screen's size in physical pixels.
LynxSystemInfo.pixelRatio
Physical pixels per CSS pixel.
LynxSystemInfo.screenWidth and screenHeight
The screen's size in CSS pixels: the physical size divided by pixelRatio.
- It's the size when the page started. It doesn't follow a phone folding or unfolding, a rotation or split screen. For a size that does, as signals, use
LynxViewport.
LynxSystemInfo.runtimeType
The JavaScript engine that runs the background thread. Lynx sets it only on that thread.
LynxSystemInfo.theme
A theme object, if the host app provides one. For light or dark mode, use LynxTheme.
Types
PlatformType
The platform, spelled exactly as Lynx reports it. Compare with the strings as written: 'iOS' matches, 'ios' never does.
- The casing is Lynx's. Each platform names itself, so
'windows'is lower case and'macOS'isn't. 'web'is the web preview.@lynx-js/types' ownPlatformTypeleaves it out.'pc'isn't a value.@lynx-js/typesstill lists it: desktop Lynx reported it before Lynx 3.3, and no supported version does.
