You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
EmptyNetwork is defined using ValidNetwork<string, never>, which suggests that ValidNetwork was intended to be a generic type. However, ValidNetwork is defined as a concrete type with specific properties and does not accept generic parameters. This is why TypeScript interprets EmptyNetwork as any.
To Reproduce
Steps to reproduce the behavior:
Go to: src/types/network.d.ts
Check type of EmptyNetwork
Expected behavior
If the goal is to create a type EmptyNetwork that represents a "network" with potentially missing or empty fields based on ValidNetwork, generics should not be used in this case.
Instead, you can use utility types like Partial for making all properties optional or use other TypeScript features to modify the existing ValidNetwork type.
Screenshots
Additional context
In the current implementation the type of Network is quite useless, because it implies being "any" because of this incosistency with EmptyNetwork.
Possible solution would look something like this:
type EmptyNetwork = Partial<ValidNetwork>;
The text was updated successfully, but these errors were encountered:
Describe the bug
EmptyNetwork is defined using ValidNetwork<string, never>, which suggests that ValidNetwork was intended to be a generic type. However, ValidNetwork is defined as a concrete type with specific properties and does not accept generic parameters. This is why TypeScript interprets EmptyNetwork as any.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If the goal is to create a type EmptyNetwork that represents a "network" with potentially missing or empty fields based on ValidNetwork, generics should not be used in this case.
Instead, you can use utility types like Partial for making all properties optional or use other TypeScript features to modify the existing ValidNetwork type.
Screenshots
Additional context
In the current implementation the type of Network is quite useless, because it implies being "any" because of this incosistency with EmptyNetwork.
Possible solution would look something like this:
The text was updated successfully, but these errors were encountered: