Skip to content

Commit

Permalink
feat: Allow defining additional location descriptor types (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
taion authored Jul 31, 2020
1 parent 2d4ff36 commit 759028f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,16 @@ export interface LocationDescriptorObject {
*
* https://github.com/4Catalyzer/farce#locations-and-location-descriptors
*/
export type LocationDescriptor = LocationDescriptorObject | string;
export type LocationDescriptorString = string;

// Using an interface allows consumers to use object merging to add other
// location descriptor types.
export interface LocationDescriptorTypes {
object: LocationDescriptorObject;
string: LocationDescriptorString;
}

export type LocationDescriptor = LocationDescriptorTypes[keyof LocationDescriptorTypes];

export interface HistoryEnhancerOptions {
protocol: Protocol;
Expand Down

0 comments on commit 759028f

Please sign in to comment.