manifesto icon indicating copy to clipboard operation
manifesto copied to clipboard

Update getSequences to also return ranges with sequence behavior

Open MImranAsghar opened this issue 4 years ago • 2 comments

MImranAsghar avatar Dec 08 '20 19:12 MImranAsghar

Change looks good. This will be a breaking change for the UV as it sometimes casts the output of getSequences() like:

const sequences: Array<Sequence> = manifest.getSequences();

I know #79 brings the interfaces closer, but do you think we should align the interfaces so we have something like:

interface SequenceInterface {}

class Sequence implements SequenceInterface {}

class Range implements SequenceInterface /* other interfaces? [...] */  {}

class Manifest {
  // ...
  getSequences(): SequenceInterface[] { /* ... */ }
}

cc @edsilv @demiankatz

stephenwf avatar Jan 22 '21 13:01 stephenwf

Hi @stephenwf , just to make sure i understand correctly, in this case sequence interface would list out the definitions for all functions and types needed for sequence and be implemented by the Sequence and Range classes, and the implementation of those functions like getCanvases would be within each range.ts (like #79) and sequence.ts. So in that case we can use the sequence interface as a type instead of Sequence | Range for getSequences()?

MImranAsghar avatar Jan 22 '21 16:01 MImranAsghar