Skip to content

Types for Astal services not entirely accurate. #651

@Jas-SinghFSU

Description

@Jas-SinghFSU

I see that ts-for-gir is being used to generate types for Typescript but I have noticed some discrepancies in types for various different Astal services. Some notable culprits are:

  1. AstalNetwork.Wifi - can be null but isn't typed accordingly. Which leads to startup errors if bindings are relying on a null value or if a property of a null Wifi (imagine no wifi adapter exists) is getting accessed.
  2. AstalBluetooth.Adapter - same as above
  3. AstalNetwork.Wired - same as above

Culprit example:

bind(networkService.wifi, 'iconName')

This will fail and prevent the component from rendering if networkService.wifi is null. However, the type definition doesn't indicate that this can be null in the absence of a wifi adapter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions