Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Type Definitions for Mac #48

Open
UncleSamSwiss opened this issue Mar 15, 2021 · 1 comment
Open

Wrong Type Definitions for Mac #48

UncleSamSwiss opened this issue Mar 15, 2021 · 1 comment

Comments

@UncleSamSwiss
Copy link

When running ps-tree on a Mac, the resulting array looks as follows:

[ { PPID: '65302', PID: '65304', STAT: 'S+', COMM: '/usr/local/Cellar/node/15.5.1/bin/node' } ]

The type definition (done by @alessiopcc) does thus not work:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/57293cfddb2e48ff8c7deaa7ee3ac0101d83d014/types/ps-tree/index.d.ts#L8-L13

It would be great, if either the type definition is fixed or if ps-tree returned the same array for Mac as it does for other systems.

I would prefer to have the same type for Mac and others.

@micalevisk
Copy link

micalevisk commented Jan 16, 2022

to circumvent that, write an ambient file ps-tree.d.ts with this content:

declare namespace ps_tree {
  interface PS {
    COMM: string
  }
}

I don't think there's a way to address this besides making PS having both COMMAND and COMM props (marked as optional would better, I guess).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants