Skip to content

TitleBar platform type conflicts with process.platform type #77

@mgs95

Description

@mgs95

Describe the bug
TitleBar platform type is set as "darwin" | "linux" | "win32" | undefined but process.platform type is NodeJS.Platform and both are not compatible so casting is required:

Does not work:

<TitleBar
    platform={process.platform}
> </TitleBar>

Work:

<TitleBar
    platform={process.platform as "darwin" | "linux" | "win32" | undefined}
> </TitleBar>

I think that the type should be accepted and an error should occur if the platform is not supported.

To Reproduce
Steps to reproduce the behavior:

  1. Use typescript
  2. Use TitleBar component with platform property set as process.platform.
  3. See typescript error

Expected behavior
process.platform type accepted by the property.

Screenshots
If applicable, add screenshots to help explain your problem.
image
image

Desktop (please complete the following information):

  • OS: ubuntu
  • Version: v2.1.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions