indexzero / ps-tree

MIT License
149 stars 29 forks source link

Wrong Type Definitions for Mac #48

Open UncleSamSwiss opened 3 years ago

UncleSamSwiss commented 3 years ago

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 commented 2 years ago

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).