arbre-app / read-gedcom

A modern Gedcom parser written in Typescript
https://docs.arbre.app/read-gedcom
MIT License
15 stars 4 forks source link

`SelectionWithNoteMixin#getNote` has an incorrect return type #3

Closed FlorianCassayre closed 2 years ago

FlorianCassayre commented 2 years ago

In SelectionWithNoteMixin.ts, the method getNote returns SelectionAny although it should have returned SelectionNoteReferenceMixed (technically the type can also be inferred).

To reproduce:

const gedcom: Gedcom = ...

gedcom
  .getIndividualRecord()
  .getNote()
  .getNoteRecord(); // TS2339: Property 'getNoteRecord' does not exist on type 'SelectionAny'.