class Foo {
public function __construct(string $name, array $options)
{
$this->name = $name;
if ($options->enableFlag) { ...
I want to declare what $options are, in TS I could do:type TFooOptions = { enableFlag: boolean; userIds: number[]; }
Then
function __construct(string $name, TFooOptions $options) ...
Otherwise how do I get proper typechecking if the IDE doesn't know what $options are?