Files
MaaAssistantArknights/website/apps/web/src/network-information-api.d.ts
Alisa c2bd0133ba refactor: 合并 MAA Website 仓库 (#8886)
* chore: migrate maa website

* ci: change docs build test to website build test

* fix: rename artifact name to dist

* ci: add workflow to deploy website to azure
2024-04-24 09:31:52 +08:00

33 lines
799 B
TypeScript

declare interface Navigator extends NavigatorNetworkInformation {}
declare interface WorkerNavigator extends NavigatorNetworkInformation {}
declare interface NavigatorNetworkInformation {
readonly connection?: NetworkInformation
}
type Megabit = number
type Millisecond = number
type EffectiveConnectionType = '2g' | '3g' | '4g' | 'slow-2g'
type ConnectionType =
| 'bluetooth'
| 'cellular'
| 3
| 4
| 'ethernet'
| 1
| 'mixed'
| 'none'
| 'other'
| 'unknown'
| 0
| 'wifi'
| 2
| 'wimax'
interface NetworkInformation extends EventTarget {
readonly type?: ConnectionType
readonly effectiveType?: EffectiveConnectionType
readonly downlinkMax?: Megabit
readonly downlink?: Megabit
readonly rtt?: Millisecond
readonly saveData?: boolean
onchange?: EventListener
}