This is an automated email from the ASF dual-hosted git repository.

gerben pushed a commit to branch simpler-matcher-creation
in repository https://gitbox.apache.org/repos/asf/incubator-annotator.git

commit 3ad290fa030ce87770d5f76b66cb9611781fe50d
Author: Gerben <[email protected]>
AuthorDate: Wed Sep 2 18:51:58 2020 +0200

    Use 'this' for the type of refinedBy
---
 packages/selector/src/index.ts | 4 +---
 packages/selector/src/types.ts | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/packages/selector/src/index.ts b/packages/selector/src/index.ts
index c66bd94..ffbf9d2 100644
--- a/packages/selector/src/index.ts
+++ b/packages/selector/src/index.ts
@@ -24,9 +24,7 @@ export type { Matcher, Selector } from './types';
 export type { CssSelector, RangeSelector, TextQuoteSelector } from './types';
 
 export function makeRefinable<
-  // Any subtype of Selector can be made refinable; but note we limit the value
-  // of refinedBy because it must also be accepted by matcherCreator.
-  TSelector extends Selector & { refinedBy: TSelector },
+  TSelector extends Selector,
   TScope,
   // To enable refinement, the implementation’s Match object must be usable as 
a
   // Scope object itself.
diff --git a/packages/selector/src/types.ts b/packages/selector/src/types.ts
index fc4f64b..7bfa0cd 100644
--- a/packages/selector/src/types.ts
+++ b/packages/selector/src/types.ts
@@ -19,7 +19,7 @@
  */
 
 export interface Selector {
-  refinedBy?: Selector;
+  refinedBy?: this;
 }
 
 export interface CssSelector extends Selector {

Reply via email to