Open pyramation opened 2 years ago
I would say there are two different issues:
I think this is what happens in each scenario.
In first scenario is that you can't do spread operator for types, they will be removed because types can't be exported as constant, it should be as a module.
In second scenario what happens behind the scene when you are using the spread operator, you are cloning the govecClient but without its prototype because you are actually creating a new object. It gives the object prototype and for that reason you can't use the type of the class, it ask you to use typeof govecClient, usually you have to do that with objects.
I think this is what happens in each scenario.
In first scenario is that you can't do spread operator for types, they will be removed because types can't be exported as constant, it should be as a module.
In second scenario what happens behind the scene when you are using the spread operator, you are cloning the govecClient but without its prototype because you are actually creating a new object. It gives the object prototype and for that reason you can't use the type of the class, it ask you to use typeof govecClient, usually you have to do that with objects.
wow thank you for the incredible details! I will be looking into this more ;)
scopes can be great, but let's also do something more simple, like this:
https://github.com/nymlab/vectis/blob/b5698087fe08dade8b4ba9492889b6577369e478/cli/types/index.ts
const
? @j0nl1 mentioned here: https://github.com/nymlab/vectis/pull/83#issuecomment-1210906177