From 759028fe408e7a737912dba9b0bc874652ca599a Mon Sep 17 00:00:00 2001 From: Jimmy Jia Date: Fri, 31 Jul 2020 10:20:57 -0400 Subject: [PATCH] feat: Allow defining additional location descriptor types (#350) --- types/index.d.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index 845f71a..34b3b1a 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -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;