apache / apache/cordova-plugin-network-information
Wrong typing for Connection
- Dominant language
- Objective-C
- Stars
- 465
- Forks
- 339
- PR merge metrics
- No merged PRs in 30d
Description
# Bug Report
## Problem
Interface 'Navigator' incorrectly extends interface 'NavigatorNetworkInformation'.
Types of property 'connection' are incompatible.
**Property 'dispatchEvent' is missing in type 'Connection' but required in type 'NetworkInformation'.ts(2430)**
Also
The types of 'connection.type' are incompatible between these types.
**Type 'string' is not assignable to type 'ConnectionType'.**
### What is expected to happen?
Typescript compilation completes without errors
### What does actually happen?
Typescript compilation errors out
## Information
None that seemed relevant
### Command or Code
tsc
### Environment, Platform, Device
Typescript Compilation
### Version information
Typescript Version 4.5.4
cordova-plugin-network-information Version 3.0.0
## Checklist
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
Contributor guide
Research direction
Start by running tsc with TypeScript 4.5.4 against the plugin and inspect its declared Connection and Navigator types. Done means compilation completes without the dispatchEvent and connection.type errors reported here.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100