Skip to content

Commit

Permalink
Simplify location specification interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
raksooo committed Oct 5, 2023
1 parent 25be377 commit 2bebbe4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ function prepareCustomList(

const disabledReason = isCustomListDisabled(location, locations, disabledLocation);
return {
...list,
label: list.name,
list,
location,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,33 +74,31 @@ interface CommonNormalLocationSpecification
active: boolean;
}

export interface CustomListSpecification
extends Omit<ICustomList, 'locations'>,
CommonNormalLocationSpecification {
export interface CustomListSpecification extends CommonNormalLocationSpecification {
location: RelayLocationCustomList;
list: ICustomList;
expanded: boolean;
locations: Array<GeographicalLocationSpecification>;
}

export interface CountrySpecification
extends Omit<IRelayLocationCountryRedux, 'cities'>,
extends Pick<IRelayLocationCountryRedux, 'name' | 'code'>,
CommonNormalLocationSpecification {
location: RelayLocationCountry;
expanded: boolean;
cities: Array<CitySpecification>;
}

export interface CitySpecification
extends Omit<IRelayLocationCityRedux, 'relays'>,
extends Pick<IRelayLocationCityRedux, 'name' | 'code'>,
CommonNormalLocationSpecification {
location: RelayLocationCity;
expanded: boolean;
relays: Array<RelaySpecification>;
}

export interface RelaySpecification
extends IRelayLocationRelayRedux,
extends Omit<IRelayLocationRelayRedux, 'ipv4AddrIn' | 'includeInCountry' | 'weight'>,
CommonNormalLocationSpecification {
location: RelayLocationRelay;
}
Expand Down

0 comments on commit 2bebbe4

Please sign in to comment.